summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2023-10-14 23:41:09 +0000
committerGitHub <noreply@github.com>2023-10-14 23:41:09 +0000
commitc3be9af7b6f00dad7107fcdae60a8004cc81936a (patch)
treeac96fc7576d7f483b54ccd5125dc7615bfd046fa /ext
parent5701cb1c832076c9f4ec9a20ba816d3fd15109ef (diff)
parent30cbe0e1da33b8eeee480619c5720abfc3e2ecf6 (diff)
Merge pull request #274 from praschke/search-page-parsed-frequency
add sort dictionary data to parse results on the search page
Diffstat (limited to 'ext')
-rw-r--r--ext/js/language/translator.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js
index edb38bfb..3b47cc51 100644
--- a/ext/js/language/translator.js
+++ b/ext/js/language/translator.js
@@ -93,6 +93,12 @@ class Translator {
}
if (mode === 'simple') {
+ if (sortFrequencyDictionary !== null) {
+ const sortDictionaryMap = [sortFrequencyDictionary]
+ .filter((key) => enabledDictionaryMap.has(key))
+ .reduce((subMap, key) => subMap.set(key, enabledDictionaryMap.get(key)), new Map());
+ await this._addTermMeta(dictionaryEntries, sortDictionaryMap);
+ }
this._clearTermTags(dictionaryEntries);
} else {
await this._addTermMeta(dictionaryEntries, enabledDictionaryMap);