From 1b9422d026dce0aedf5d2b94495222cccde4963e Mon Sep 17 00:00:00 2001 From: arbyste <144075975+arbyste@users.noreply.github.com> Date: Sat, 27 Jan 2024 02:29:36 -0700 Subject: Adding a handlebar to return pitch accent categories of a word (#563) * Fixing logic in isNonNounVerbOrAdjective function * Adding handlebar to return pitch accent categories of a word --- ext/data/templates/default-anki-field-templates.handlebars | 4 ++++ ext/js/dictionary/dictionary-data-util.js | 2 +- ext/js/pages/settings/anki-controller.js | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/data/templates/default-anki-field-templates.handlebars b/ext/data/templates/default-anki-field-templates.handlebars index 818677ce..0ea98e5e 100644 --- a/ext/data/templates/default-anki-field-templates.handlebars +++ b/ext/data/templates/default-anki-field-templates.handlebars @@ -227,6 +227,10 @@ {{#*inline "pitch-accent-positions"}} {{~> pitch-accent-list format='position'~}} {{/inline}} + +{{~#*inline "pitch-accent-categories"~}} + {{~#each (pitchCategories @root)~}}{{~.~}}{{~#unless @last~}},{{~/unless~}}{{~/each~}} +{{~/inline~}} {{! End Pitch Accents }} {{#*inline "phonetic-transcriptions"}} diff --git a/ext/js/dictionary/dictionary-data-util.js b/ext/js/dictionary/dictionary-data-util.js index c7c9ecfc..9b49c7af 100644 --- a/ext/js/dictionary/dictionary-data-util.js +++ b/ext/js/dictionary/dictionary-data-util.js @@ -287,7 +287,7 @@ export class DictionaryDataUtil { case 'vs': isVerbOrAdjective = true; isSuruVerb = true; - break; + // falls through case 'n': isNoun = true; break; diff --git a/ext/js/pages/settings/anki-controller.js b/ext/js/pages/settings/anki-controller.js index f6e19e14..d1faf491 100644 --- a/ext/js/pages/settings/anki-controller.js +++ b/ext/js/pages/settings/anki-controller.js @@ -147,6 +147,7 @@ export class AnkiController { 'pitch-accents', 'pitch-accent-graphs', 'pitch-accent-positions', + 'pitch-accent-categories', 'phonetic-transcriptions', 'reading', 'screenshot', -- cgit v1.2.3