Merge: Count last word when calculating most frequent words

Not that it really matters.
This commit is contained in:
Abe Jellinek 2024-02-21 15:12:14 -05:00
parent 69d9b01b6e
commit 07296b4506

View file

@ -1351,6 +1351,11 @@ Zotero.Items = function() {
}
}
// Add remaining word, if any
if (currentWord.length > 3) {
freqs.set(currentWord, (freqs.get(currentWord) || 0) + 1);
}
// Break ties in locale order.
return [...freqs.keys()]
.sort((a, b) => (freqs.get(b) - freqs.get(a)) || Zotero.localeCompare(a, b))