diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-04-03 15:41:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-03 15:41:44 -0400 |
commit | b8bedd5185869edb33a7657fff323f812444eed0 (patch) | |
tree | dd6b4b03062eeb28be3cde6c533e1a9d276f8215 /ext/js/data | |
parent | 8de1e9b3d8828417bebdeb9bad6dc8ea7f391c12 (diff) |
Improve term dictionary entry sequence (#1591)
* Improve sequence for merged entries and add sequenceDictionary
* Update docs
* Expose sequence in definitions
* Expose sequence in root definition
* Update test data
Diffstat (limited to 'ext/js/data')
-rw-r--r-- | ext/js/data/anki-note-data-creator.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/js/data/anki-note-data-creator.js b/ext/js/data/anki-note-data-creator.js index fb9c8b8c..e7abaa21 100644 --- a/ext/js/data/anki-note-data-creator.js +++ b/ext/js/data/anki-note-data-creator.js @@ -265,7 +265,7 @@ class AnkiNoteDataCreator { case 'merge': type = 'termMerged'; break; } - const {id, inflections, score, dictionaryIndex, dictionaryPriority, sourceTermExactMatchCount} = dictionaryEntry; + const {id, inflections, score, dictionaryIndex, dictionaryPriority, sourceTermExactMatchCount, sequence} = dictionaryEntry; const { screenshotFileName=null, @@ -298,7 +298,7 @@ class AnkiNoteDataCreator { reasons: inflections, score, isPrimary: (type === 'term' ? dictionaryEntry.isPrimary : void 0), - sequence: (type === 'term' ? dictionaryEntry.sequence : void 0), + sequence, get dictionary() { return self.getCachedValue(dictionaryNames)[0]; }, dictionaryOrder: { index: dictionaryIndex, @@ -362,7 +362,9 @@ class AnkiNoteDataCreator { } if (!hasDefinitions) { continue; } const only = merged ? DictionaryDataUtil.getDisambiguations(dictionaryEntry.headwords, headwordIndices, allTermsSet, allReadingsSet) : void 0; + const {sequence} = dictionaryEntry; definitions.push({ + sequence, dictionary, glossary: entries, definitionTags: definitionTags2, |