aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-17 18:38:29 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-17 18:38:29 -0700
commit5bebf3ed2cff5c460afe6f0d3df56f26f12ae240 (patch)
treeb1e4d30eac7ca150fb1a0e38287b7b488869644f /ext/bg/js/translator.js
parent52a8e2207c70573abd1e47cc8d019ba9e592a9dd (diff)
Revert "Support switching between edict and enamdict"
This reverts commit f079db0471424a873f22315c7911571d467e97ad.
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 454d5079..46d63ed0 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -63,14 +63,14 @@ class Translator {
}
}
- findTerm(text, dict) {
+ findTerm(text) {
const groups = {};
for (let i = text.length; i > 0; --i) {
const term = text.slice(0, i);
const dfs = this.deinflector.deinflect(term, t => {
const tags = [];
- for (const d of this.dictionary.findTerm(t, dict)) {
+ for (const d of this.dictionary.findTerm(t)) {
tags.push(d.tags);
}
@@ -79,7 +79,7 @@ class Translator {
if (dfs !== null) {
for (const df of dfs) {
- this.processTerm(dict, groups, df.source, df.tags, df.rules, df.root);
+ this.processTerm(groups, df.source, df.tags, df.rules, df.root);
}
}
}
@@ -125,13 +125,13 @@ class Translator {
return {results: results, length: length};
}
- findKanji(text, dict) {
+ findKanji(text) {
let results = [];
const processed = {};
for (const c of text) {
if (!processed.has(c)) {
- results = results.concat(this.dictionary.findKanji(c, dict));
+ results = results.concat(this.dictionary.findKanji(c));
processed[c] = true;
}
}
@@ -139,8 +139,8 @@ class Translator {
return results;
}
- processTerm(dict, groups, source, tags, rules=[], root='') {
- for (const entry of this.dictionary.findTerm(root, dict)) {
+ processTerm(groups, source, tags, rules=[], root='') {
+ for (const entry of this.dictionary.findTerm(root)) {
if (entry.id in groups) {
continue;
}