Navigation Menu

Skip to content

Commit

Permalink
fixed JS tokenizer stopword filter
Browse files Browse the repository at this point in the history
the in operator does not work as it was used here.

fixes yiisoft/yii2-apidoc#42
  • Loading branch information
cebe committed Nov 22, 2016
1 parent 81eaf8f commit 3756a8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/tokenizer/StandardTokenizer.php
Expand Up @@ -76,7 +76,10 @@ function(string) {
return string.split(/[\s$delimiters]+/).map(function(val) {
return val.toLowerCase();
}).filter(function(val) {
return !(val in stopWords);
for (w in stopWords) {
if (stopWords[w] == val) return false;
}
return true;
}).map(function(word) {
return {t: word, w: 1};
});
Expand Down

0 comments on commit 3756a8b

Please sign in to comment.