summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjulian laplace <julescarbon@gmail.com>2026-01-20 15:03:40 +0100
committerjulian laplace <julescarbon@gmail.com>2026-01-20 15:03:40 +0100
commit8227caa7fb399285a12a8a9fc80c95fe87d6a5e8 (patch)
tree09656b9acdd6441c43921debfcca02c77ea99061
parentf907512a39eb4a6c98277fbdbf9e71f73d9c3b3f (diff)
redo lexicon
-rw-r--r--bucky/search/lexicon.js10
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;