compatibility transform non-primary definitions
This commit is contained in:
parent
314c567a47
commit
9af8f999f4
@ -199,8 +199,19 @@ class Translator {
|
|||||||
|
|
||||||
const strayDefinitions = defaultDefinitions.filter((definition, index) => !mergedByTermIndices.has(index));
|
const strayDefinitions = defaultDefinitions.filter((definition, index) => !mergedByTermIndices.has(index));
|
||||||
for (const groupedDefinition of dictTermsGroup(strayDefinitions, dictionaries)) {
|
for (const groupedDefinition of dictTermsGroup(strayDefinitions, dictionaries)) {
|
||||||
groupedDefinition.expressions = [Translator.createExpression(groupedDefinition.expression, groupedDefinition.reading)];
|
// from dictTermsMergeBySequence
|
||||||
definitionsMerged.push(groupedDefinition);
|
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);
|
await this.buildTermMeta(definitionsMerged, dictionaries);
|
||||||
|
Loading…
Reference in New Issue
Block a user