Fixes
This commit is contained in:
parent
0587399883
commit
3ec57d5bf6
@ -59,12 +59,18 @@ class Translator {
|
|||||||
const promises = [];
|
const promises = [];
|
||||||
|
|
||||||
for (let i = text.length; i > 0; --i) {
|
for (let i = text.length; i > 0; --i) {
|
||||||
promises.append(
|
promises.push(
|
||||||
this.deinflector.deinflect(text.slice(0, i), term => {
|
this.deinflector.deinflect(text.slice(0, i), term => {
|
||||||
return this.dictionary.findTerm(term).then(definitions => definitions.map(def => def.tags));
|
return this.dictionary.findTerm(term).then(definitions => definitions.map(def => def.tags));
|
||||||
}).then(inflects => {
|
}).then(inflects => {
|
||||||
for (const inflect of inflects) {
|
for (const inflect of inflects) {
|
||||||
this.processTerm(groups, df.source, df.tags, df.rules, df.root);
|
this.processTerm(
|
||||||
|
groups,
|
||||||
|
inflect.source,
|
||||||
|
inflect.tags,
|
||||||
|
inflect.rules,
|
||||||
|
inflect.root
|
||||||
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -297,7 +297,7 @@ class Yomichan {
|
|||||||
}
|
}
|
||||||
|
|
||||||
api_findTerm({text, callback}) {
|
api_findTerm({text, callback}) {
|
||||||
callback(this.translator.findTerm(text));
|
this.translator.findTerm(text).then((result) => callback(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
api_getDeckNames({callback}) {
|
api_getDeckNames({callback}) {
|
||||||
|
Loading…
Reference in New Issue
Block a user