diff options
author | StefanVukovic99 <stefanvukovic44@gmail.com> | 2023-12-28 06:39:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-28 05:39:19 +0000 |
commit | fc2123a45b3ceacc2ec887d24e5e752dca59bb4f (patch) | |
tree | 3a5105a6bff7a1755582c0cb9d38996933044b2b /ext/js/templates/sandbox | |
parent | 60cd218663f62f79394e9c0247e0fe40de6589b6 (diff) |
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
Diffstat (limited to 'ext/js/templates/sandbox')
-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) { |