summaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-02-26 11:12:54 -0800
committerAlex Yatskov <alex@foosoft.net>2017-02-26 11:12:54 -0800
commit0d2e9be0cebe6d8351d1cb7d6bbcc59b75d708ab (patch)
tree1296d60c54a7b1259c4603b9fb89c46904e71239 /ext/bg/js/translator.js
parent32f95e59a9c5612d2b5658ea8a70b55ec17cca18 (diff)
wip
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 82dffd91..e7c2aac2 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -54,8 +54,8 @@ class Translator {
}
}).then(deinflections => {
let definitions = [];
- for (let deinflection of deinflections) {
- for (let definition of deinflection.definitions) {
+ for (const deinflection of deinflections) {
+ for (const definition of deinflection.definitions) {
const tags = definition.tags.map(tag => buildTag(tag, definition.tagMeta));
tags.push(buildDictTag(definition.dictionary));
definitions.push({
@@ -76,7 +76,7 @@ class Translator {
definitions = sortTermDefs(definitions, dictionaries);
let length = 0;
- for (let definition of definitions) {
+ for (const definition of definitions) {
length = Math.max(length, definition.source.length);
}
@@ -95,7 +95,7 @@ class Translator {
const processed = {};
const promises = [];
- for (let c of text) {
+ for (const c of text) {
if (!processed[c]) {
promises.push(this.database.findKanji(c, titles));
processed[c] = true;
@@ -104,7 +104,7 @@ class Translator {
return Promise.all(promises).then(defSets => {
const definitions = defSets.reduce((a, b) => a.concat(b), []);
- for (let definition of definitions) {
+ for (const definition of definitions) {
const tags = definition.tags.map(tag => buildTag(tag, definition.tagMeta));
tags.push(buildDictTag(definition.dictionary));
definition.tags = sortTags(tags);
@@ -130,7 +130,7 @@ class Translator {
return Promise.all(promises).then(results => {
let deinflections = [];
- for (let result of results) {
+ for (const result of results) {
deinflections = deinflections.concat(result);
}
@@ -139,7 +139,7 @@ class Translator {
}
processKanji(definitions) {
- for (let definition of definitions) {
+ for (const definition of definitions) {
const tags = definition.tags.map(tag => buildTag(tag, definition.tagMeta));
definition.tags = sortTags(tags);
}