aboutsummaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-03-01 21:43:36 +0200
committerGitHub <noreply@github.com>2020-03-01 21:43:36 +0200
commitb3994acbac6848e3fd904e5743f86b3d53dd500b (patch)
tree9f418240ea4f71d2c12d49cec30b07fb9bf8433a /ext
parenta4b0a556d48f2b0ae4208f69fa651d2370529db5 (diff)
parent9af8f999f4b18f76464e59f3466734eec8078d98 (diff)
Merge pull request #384 from siikamiika/fix-non-primary-dictionary-format
compatibility transform non-primary definitions
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/translator.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index a675a9f7..781eb968 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -199,8 +199,19 @@ class Translator {
const strayDefinitions = defaultDefinitions.filter((definition, index) => !mergedByTermIndices.has(index));
for (const groupedDefinition of dictTermsGroup(strayDefinitions, dictionaries)) {
- groupedDefinition.expressions = [Translator.createExpression(groupedDefinition.expression, groupedDefinition.reading)];
- definitionsMerged.push(groupedDefinition);
+ // from dictTermsMergeBySequence
+ const {reasons, score, expression, reading, source, dictionary} = groupedDefinition;
+ const compatibilityDefinition = {
+ reasons,
+ score,
+ expression: [expression],
+ reading: [reading],
+ expressions: [Translator.createExpression(groupedDefinition.expression, groupedDefinition.reading)],
+ source,
+ dictionary,
+ definitions: groupedDefinition.definitions
+ };
+ definitionsMerged.push(compatibilityDefinition);
}
await this.buildTermMeta(definitionsMerged, dictionaries);