From fc2123a45b3ceacc2ec887d24e5e752dca59bb4f Mon Sep 17 00:00:00 2001 From: StefanVukovic99 Date: Thu, 28 Dec 2023 06:39:19 +0100 Subject: add phonetic transcriptions term meta type (#434) * move dictionary files to dictionary folder * wip * move dictionary files to dictionary folder * add ipa term meta * wip * fixing comments wip * fixing comments wip * fixing comments wip * fixing comments wip * fixing comments wip * fixing comments wip * fix comments * fix comments * update test data * fix gitignore * engines * add tests * update database test * fix test --- ext/js/templates/sandbox/anki-template-renderer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/js/templates/sandbox') 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} */ 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) { -- cgit v1.2.3