diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2017-10-13 02:40:20 +0300 |
---|---|---|
committer | siikamiika <siikamiika@users.noreply.github.com> | 2017-10-13 02:40:20 +0300 |
commit | 7ec28bea5422cda4304b660eccdb39d690f74fad (patch) | |
tree | ddd2fa3d0f9aaf8adca9dbfb822d1f511d4860aa /ext/bg/js/dictionary.js | |
parent | c0f56480bb34b8811835b8d545443bd9ea87c997 (diff) |
change db format, rename tags to definitionTags
Diffstat (limited to 'ext/bg/js/dictionary.js')
-rw-r--r-- | ext/bg/js/dictionary.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js index d057ae83..816e96c4 100644 --- a/ext/bg/js/dictionary.js +++ b/ext/bg/js/dictionary.js @@ -115,8 +115,8 @@ function dictTermsCompressTags(definitions) { let lastPos = ''; for (const definition of definitions) { - const dictionary = JSON.stringify(definition.tags.filter(tag => tag.category === 'dictionary').map(tag => tag.name).sort()); - const pos = JSON.stringify(definition.tags.filter(tag => tag.category === 'pos').map(tag => tag.name).sort()); + const dictionary = JSON.stringify(definition.definitionTags.filter(tag => tag.category === 'dictionary').map(tag => tag.name).sort()); + const pos = JSON.stringify(definition.definitionTags.filter(tag => tag.category === 'pos').map(tag => tag.name).sort()); const filterOutCategories = []; @@ -133,7 +133,7 @@ function dictTermsCompressTags(definitions) { lastPos = pos; } - definition.tags = definition.tags.filter(tag => !filterOutCategories.includes(tag.category)); + definition.definitionTags = definition.definitionTags.filter(tag => !filterOutCategories.includes(tag.category)); } } @@ -229,7 +229,7 @@ function dictTermsMergeByGloss(result, definitions, appendTo, mergedIndices) { definitionsByGloss[gloss] = { expression: new Set(), reading: new Set(), - tags: new Set(), + definitionTags: new Set(), glossary: definition.glossary, source: result.source, reasons: [], @@ -253,11 +253,11 @@ function dictTermsMergeByGloss(result, definitions, appendTo, mergedIndices) { result.expressions.get(definition.expression).set(definition.reading, new Set()); } - for (const tag of definition.tags) { + for (const tag of definition.definitionTags) { if (typeof tag === 'string') { - definitionsByGloss[gloss].tags.add(tag); + definitionsByGloss[gloss].definitionTags.add(tag); } else if (tag.category && tag.category !== 'dictionary') { - definitionsByGloss[gloss].tags.add(tag.name); + definitionsByGloss[gloss].definitionTags.add(tag.name); } } |