diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-06-26 11:57:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-26 11:57:09 -0400 |
commit | 6e0a367afcae07ae6f8274c7310950af613b4bf0 (patch) | |
tree | 4cc45dd6b2f3b53aeaf1c9eb95db774aabcad5b2 /ext/js/data/anki-note-data-creator.js | |
parent | 5756885fa9340f087a168d40c8d0d10a3a8fe4d5 (diff) |
Translator data format updates (#1754)
* Add {dictionaryIndex, dictionaryPriority} to definitions
* Add score to definitions
* Add id to definition
* Use definition id instead of ids array
* Remove ids array
* Update docs
* Update test data
Diffstat (limited to 'ext/js/data/anki-note-data-creator.js')
-rw-r--r-- | ext/js/data/anki-note-data-creator.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/js/data/anki-note-data-creator.js b/ext/js/data/anki-note-data-creator.js index c76369c3..6a6bfd36 100644 --- a/ext/js/data/anki-note-data-creator.js +++ b/ext/js/data/anki-note-data-creator.js @@ -274,7 +274,7 @@ class AnkiNoteDataCreator { case 'merge': type = 'termMerged'; break; } - const {ids, inflections, score, dictionaryIndex, dictionaryPriority, sourceTermExactMatchCount} = dictionaryEntry; + const {inflections, score, dictionaryIndex, dictionaryPriority, sourceTermExactMatchCount, definitions} = dictionaryEntry; const { screenshotFileName=null, @@ -301,7 +301,7 @@ class AnkiNoteDataCreator { return { type, - id: (type === 'term' ? ids[0] : void 0), + id: (type === 'term' && definitions.length > 0 ? definitions[0].id : void 0), source: (primarySource !== null ? primarySource.transformedText : null), rawSource: (primarySource !== null ? primarySource.originalText : null), sourceTerm: (type !== 'termMerged' ? (primarySource !== null ? primarySource.deinflectedText : null) : void 0), |