aboutsummaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/translator.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index ff1d24f3..d04b1cb3 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -47,22 +47,6 @@ class Translator {
await this.database.deleteDictionary(dictionaryName);
}
- async findTermsGrouped(text, dictionaries, alphanumeric, options) {
- const titles = Object.keys(dictionaries);
- const {length, definitions} = await this.findTerms(text, dictionaries, alphanumeric);
-
- const definitionsGrouped = dictTermsGroup(definitions, dictionaries);
- await this.buildTermFrequencies(definitionsGrouped, titles);
-
- if (options.general.compactTags) {
- for (const definition of definitionsGrouped) {
- dictTermsCompressTags(definition.definitions);
- }
- }
-
- return {length, definitions: definitionsGrouped};
- }
-
async getSequencedDefinitions(definitions, mainDictionary) {
const definitionsBySequence = dictTermsMergeBySequence(definitions, mainDictionary);
const defaultDefinitions = definitionsBySequence['-1'];
@@ -157,6 +141,22 @@ class Translator {
return result;
}
+ async findTermsGrouped(text, dictionaries, alphanumeric, options) {
+ const titles = Object.keys(dictionaries);
+ const {length, definitions} = await this.findTerms(text, dictionaries, alphanumeric);
+
+ const definitionsGrouped = dictTermsGroup(definitions, dictionaries);
+ await this.buildTermFrequencies(definitionsGrouped, titles);
+
+ if (options.general.compactTags) {
+ for (const definition of definitionsGrouped) {
+ dictTermsCompressTags(definition.definitions);
+ }
+ }
+
+ return {length, definitions: definitionsGrouped};
+ }
+
async findTermsMerged(text, dictionaries, alphanumeric, options) {
const secondarySearchTitles = Object.keys(options.dictionaries).filter(dict => options.dictionaries[dict].allowSecondarySearches);
const titles = Object.keys(dictionaries);