Give findKanji the same API as findTerms

This commit is contained in:
toasted-nutbread 2019-11-04 20:13:03 -05:00
parent af1662acad
commit 58c0997999
2 changed files with 3 additions and 2 deletions

View File

@ -83,7 +83,7 @@ async function apiTermsFind(text, optionsContext) {
async function apiKanjiFind(text, optionsContext) {
const options = await apiOptionsGet(optionsContext);
const definitions = await utilBackend().translator.findKanji(text, dictEnabledSet(options));
const definitions = await utilBackend().translator.findKanji(text, options);
return definitions.slice(0, options.general.maxResults);
}

View File

@ -330,7 +330,8 @@ class Translator {
return deinflections;
}
async findKanji(text, dictionaries) {
async findKanji(text, options) {
const dictionaries = dictEnabledSet(options);
const titles = Object.keys(dictionaries);
const kanjiUnique = {};
const kanjiList = [];