summaryrefslogtreecommitdiff
path: root/ext/js/language/translator.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/language/translator.js')
-rw-r--r--ext/js/language/translator.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js
index 568c12bd..b10af226 100644
--- a/ext/js/language/translator.js
+++ b/ext/js/language/translator.js
@@ -137,6 +137,7 @@ export class Translator {
text = this._getJapaneseOnlyText(text);
}
const {enabledDictionaryMap} = options;
+ /** @type {Set<string>} */
const kanjiUnique = new Set();
for (const c of text) {
kanjiUnique.add(c);
@@ -702,6 +703,7 @@ export class Translator {
* @returns {import('dictionary').TermDictionaryEntry[]}
*/
_groupDictionaryEntriesByHeadword(dictionaryEntries, tagAggregator) {
+ /** @type {Map<string, import('dictionary').TermDictionaryEntry[]>} */
const groups = new Map();
for (const dictionaryEntry of dictionaryEntries) {
const {inflectionRuleChainCandidates, headwords: [{term, reading}]} = dictionaryEntry;
@@ -1039,8 +1041,11 @@ export class Translator {
* @param {TranslatorTagAggregator} tagAggregator
*/
async _addTermMeta(dictionaryEntries, enabledDictionaryMap, tagAggregator) {
+ /** @type {Map<string, Map<string, {headwordIndex: number, pronunciations: import('dictionary').TermPronunciation[], frequencies: import('dictionary').TermFrequency[]}[]>>} */
const headwordMap = new Map();
+ /** @type {string[]} */
const headwordMapKeys = [];
+ /** @type {Map<string, {headwordIndex: number, pronunciations: import('dictionary').TermPronunciation[], frequencies: import('dictionary').TermFrequency[]}[]>[]} */
const headwordReadingMaps = [];
for (const {headwords, pronunciations, frequencies} of dictionaryEntries) {