summaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-09-13 17:26:02 -0700
committerAlex Yatskov <alex@foosoft.net>2017-09-13 17:26:02 -0700
commit4d4b819d6c197df6e0f91ba170d0ee909dfcb5c9 (patch)
treecb6446be836483d1f961ead28c06c932de444261 /ext/bg/js/translator.js
parent13961e6a10554fdc43c5b1b66f28ea72d2fc21b6 (diff)
tag caching
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 99147618..5de99e8e 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -60,7 +60,7 @@ class Translator {
let definitions = [];
for (const deinflection of deinflections) {
for (const definition of deinflection.definitions) {
- const tags = await this.buildTags(definition.tags, titles);
+ const tags = await this.buildTags(definition.tags, definition.dictionary);
tags.push(dictTagBuildSource(definition.dictionary));
let frequencies = await this.database.findTermFreq(definition.expression, titles);
@@ -124,7 +124,7 @@ class Translator {
}
for (const definition of definitions) {
- const tags = await this.buildTags(definition.tags, titles);
+ const tags = await this.buildTags(definition.tags, definition.dictionary);
tags.push(dictTagBuildSource(definition.dictionary));
definition.tags = dictTagsSort(tags);
@@ -134,10 +134,10 @@ class Translator {
return definitions;
}
- async buildTags(names, titles) {
+ async buildTags(names, title) {
const results = [];
for (const name of names) {
- const meta = await this.database.findTag(name.split(':')[0], titles);
+ const meta = await this.database.findTag(name.split(':')[0], title);
const result = {name};
for (const prop in meta || {}) {