diff options
| -rw-r--r-- | bucky/search/lexicon.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bucky/search/lexicon.js b/bucky/search/lexicon.js index bd24f11..6dec355 100644 --- a/bucky/search/lexicon.js +++ b/bucky/search/lexicon.js @@ -99,8 +99,10 @@ function parse_terms(opt) { var comment = opt.comment || 0; var file = opt.file || 0; var string = opt.string; - if (!string || !thread) return 0; - var count = 0; + if (!string || !thread) { + return 0; + } + var term_count = 0; var terms = string.replace(underscoreRegexp, " ").split(spaceRegexp); for (const term of terms) { var parsedTerm = parse_term(term); @@ -124,7 +126,7 @@ function parse_terms(opt) { } else { res.strength += 1; } - count += 1; + term_count += 1; if (!lex_counts.has(parsedTerm)) { lex_counts.set(parsedTerm, new Set()); @@ -138,7 +140,7 @@ function parse_terms(opt) { console.log(term, terms, lex_count); } } - return count || 0; + return term_count || 0; } var put_total = 0; |
