From 07296b450618d5a0ed8a591e20786f87761addb1 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 21 Feb 2024 15:12:14 -0500 Subject: [PATCH] Merge: Count last word when calculating most frequent words Not that it really matters. --- chrome/content/zotero/xpcom/data/items.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js index a72cc81375..98e2007f3f 100644 --- a/chrome/content/zotero/xpcom/data/items.js +++ b/chrome/content/zotero/xpcom/data/items.js @@ -1350,6 +1350,11 @@ Zotero.Items = function() { currentWord += codePoint.toLowerCase(); } } + + // 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()]