diff options
Diffstat (limited to 'ext/js/templates')
-rw-r--r-- | ext/js/templates/sandbox/anki-template-renderer.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/js/templates/sandbox/anki-template-renderer.js b/ext/js/templates/sandbox/anki-template-renderer.js index 57725bcb..15810239 100644 --- a/ext/js/templates/sandbox/anki-template-renderer.js +++ b/ext/js/templates/sandbox/anki-template-renderer.js @@ -543,12 +543,13 @@ export class AnkiTemplateRenderer { const [data] = /** @type {[data: import('anki-templates').NoteData]} */ (args); const {dictionaryEntry} = data; if (dictionaryEntry.type !== 'term') { return []; } - const {pronunciations, headwords} = dictionaryEntry; + const {pronunciations: termPronunciations, headwords} = dictionaryEntry; /** @type {Set<string>} */ const categories = new Set(); - for (const {headwordIndex, pitches} of pronunciations) { + for (const {headwordIndex, pronunciations} of termPronunciations) { const {reading, wordClasses} = headwords[headwordIndex]; const isVerbOrAdjective = DictionaryDataUtil.isNonNounVerbOrAdjective(wordClasses); + const pitches = DictionaryDataUtil.getPronunciationsOfType(pronunciations, 'pitch-accent'); for (const {position} of pitches) { const category = this._japaneseUtil.getPitchCategory(reading, position, isVerbOrAdjective); if (category !== null) { |