commit | d5d0573442a7d9feb9ee9cc25c55ae5aa4479ec3 | [log] [tgz] |
---|---|---|
author | Marc Kupietz <kupietz@ids-mannheim.de> | Tue Jan 30 11:57:35 2018 +0100 |
committer | Marc Kupietz <kupietz@ids-mannheim.de> | Tue Jan 30 11:57:35 2018 +0100 |
tree | 7f9d7c3c3e1686148f3f41167378869db90aa6f8 | |
parent | 5a7f9aca949f26a5bdd4b43b4c639d01f7a2032f [diff] [blame] |
derekovecs: cutoff cannot be larger than number of words in vocabulary Fixes segmentation fault with CoRoLa. TODO: cut-off should be frequency based rather than rank based.
diff --git a/w2v-server.pl b/w2v-server.pl index 26bea4b..e04f212 100755 --- a/w2v-server.pl +++ b/w2v-server.pl
@@ -714,7 +714,7 @@ if(N>MAX_NEIGHBOURS) N=MAX_NEIGHBOURS; - if(cutoff < 1) + if(cutoff < 1 || cutoff > words) cutoff=words; wl = getTargetWords(st1, search_backw);