diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-05-08 13:16:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-08 13:16:56 -0400 |
commit | 289bdc162228609e841ae69a2ba1295926401ecd (patch) | |
tree | 8f0e41d4a65b4186269c297ed00b46c04efcff3f /ext/js/data | |
parent | 32f554402172ed53de8fb87ea207e4121c1b1fab (diff) |
Improve term grouping (#1653)
* Rename _addUniqueStrings to _addUniqueSimple
* Update definition merging to not depend the sequence number
* Improve naming
* Update AnkiNoteDataCreator
* Update docs
* Remove fields that no longer exist
* Update test data
Diffstat (limited to 'ext/js/data')
-rw-r--r-- | ext/js/data/anki-note-data-creator.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/js/data/anki-note-data-creator.js b/ext/js/data/anki-note-data-creator.js index 3046a92e..d1bbec18 100644 --- a/ext/js/data/anki-note-data-creator.js +++ b/ext/js/data/anki-note-data-creator.js @@ -362,7 +362,7 @@ class AnkiNoteDataCreator { const definitions = []; const definitionTags = []; - for (const {tags, headwordIndices, entries, dictionary, sequence} of dictionaryEntry.definitions) { + for (const {tags, headwordIndices, entries, dictionary, sequences} of dictionaryEntry.definitions) { const definitionTags2 = []; for (const tag of tags) { definitionTags.push(this._convertTag(tag)); @@ -371,7 +371,7 @@ class AnkiNoteDataCreator { if (!hasDefinitions) { continue; } const only = merged ? DictionaryDataUtil.getDisambiguations(dictionaryEntry.headwords, headwordIndices, allTermsSet, allReadingsSet) : void 0; definitions.push({ - sequence, + sequence: sequences[0], dictionary, glossary: entries, definitionTags: definitionTags2, @@ -613,8 +613,9 @@ class AnkiNoteDataCreator { _getTermDictionaryEntrySequence(dictionaryEntry) { let hasSequence = false; let mainSequence = -1; - for (const {sequence, isPrimary} of dictionaryEntry.definitions) { + for (const {sequences, isPrimary} of dictionaryEntry.definitions) { if (!isPrimary) { continue; } + const sequence = sequences[0]; if (!hasSequence) { mainSequence = sequence; hasSequence = true; |