From 2ee3e3a7a18cc8cb71febe3030c149e0280ed9a7 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 18 Jul 2021 16:01:42 -0400 Subject: Update pronunciation anki templates (#1842) * Update anki pronunciation templates * Expose nasalPositions/devoicePositions * Update templates to support nasal/devoice positions * Update test data --- ext/js/data/options-util.js | 1 + ext/js/data/sandbox/anki-note-data-creator.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'ext/js/data') diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index d131d0c6..42d8a93a 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -857,6 +857,7 @@ class OptionsUtil { // Added {selection-text} field marker. // Added {sentence-furigana} field marker. // Added anki.duplicateScopeCheckAllModels. + // Updated pronunciation templates. await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v13.handlebars'); for (const profile of options.profiles) { profile.options.anki.duplicateScopeCheckAllModels = false; diff --git a/ext/js/data/sandbox/anki-note-data-creator.js b/ext/js/data/sandbox/anki-note-data-creator.js index 3622e837..e09c6d7b 100644 --- a/ext/js/data/sandbox/anki-note-data-creator.js +++ b/ext/js/data/sandbox/anki-note-data-creator.js @@ -159,11 +159,13 @@ class AnkiNoteDataCreator { if (dictionaryEntry.type === 'term') { for (const {dictionary, pitches} of DictionaryDataUtil.getPitchAccentInfos(dictionaryEntry)) { const pitches2 = []; - for (const {terms, reading, position, tags, exclusiveTerms, exclusiveReadings} of pitches) { + for (const {terms, reading, position, nasalPositions, devoicePositions, tags, exclusiveTerms, exclusiveReadings} of pitches) { pitches2.push({ expressions: terms, reading, position, + nasalPositions, + devoicePositions, tags, exclusiveExpressions: exclusiveTerms, exclusiveReadings -- cgit v1.2.3