aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2017-09-29 05:41:29 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2017-09-29 05:41:29 +0300
commitb24c70523479c16eca848f5aafaa887549689ac6 (patch)
tree164cc016a3a9012c1d92469f9ee06a869d72fbea /ext/bg/js/translator.js
parent9106b59af628df26f86474fc77abb88c7d9bf9c5 (diff)
basic structure for feature-merge-similar-results
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index c915dbc0..8fa2b60b 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -48,6 +48,18 @@ class Translator {
return {length, definitions: definitionsGrouped};
}
+ async findTermsMerged(text, dictionaries, alphanumeric) {
+ const titles = Object.keys(dictionaries);
+ const {length, definitions} = await this.findTerms(text, dictionaries, alphanumeric);
+
+ const definitionsMerged = dictTermsGroup(definitions, dictionaries);
+ // for (const definition of definitionsMerged) {
+ // await this.buildTermFrequencies(definition, titles);
+ // }
+
+ return {length, definitions: definitionsMerged};
+ }
+
async findTermsSplit(text, dictionaries, alphanumeric) {
const titles = Object.keys(dictionaries);
const {length, definitions} = await this.findTerms(text, dictionaries, alphanumeric);
@@ -90,7 +102,8 @@ class Translator {
expression: definition.expression,
reading: definition.reading,
glossary: definition.glossary,
- tags: dictTagsSort(tags)
+ tags: dictTagsSort(tags),
+ sequence: definition.sequence
});
}
}