summaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-07-10 15:20:07 -0700
committerAlex Yatskov <alex@foosoft.net>2017-07-10 15:20:07 -0700
commita73b8fbab747fc5d7d2802b88d4007421cda4d87 (patch)
tree441c0d2972f98080786e6e704c752fda809efb1f /ext/bg/js/translator.js
parent28bc1449d1b2260df2970318982385b0d8456c54 (diff)
cleanup
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index dfe54623..aa11ea63 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -87,14 +87,12 @@ class Translator {
return {length, definitions};
}
- async findTermsDeinflected(text, dictionaries, cache) {
- await this.prepare();
-
+ async findTermsDeinflected(text, titles, cache) {
const definer = async term => {
if (cache.hasOwnProperty(term)) {
return cache[term];
} else {
- return cache[term] = await this.database.findTerms(term, dictionaries);
+ return cache[term] = await this.database.findTerms(term, titles);
}
};
@@ -108,8 +106,6 @@ class Translator {
}
async findKanji(text, dictionaries) {
- await this.prepare();
-
let definitions = [];
const processed = {};
const titles = Object.keys(dictionaries);
@@ -129,7 +125,6 @@ class Translator {
return definitions;
}
-
static loadRules(url) {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();