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 --- .../anki-field-templates-upgrade-v13.handlebars | 83 ++++++++++ .../default-anki-field-templates.handlebars | 67 +------- ext/js/data/options-util.js | 1 + ext/js/data/sandbox/anki-note-data-creator.js | 4 +- test/data/anki-note-builder-test-results.json | 174 ++++++++++----------- test/data/translator-test-results-note-data1.json | 126 +++++++++++++++ test/test-options-util.js | 168 ++++++++++++++++++++ 7 files changed, 470 insertions(+), 153 deletions(-) diff --git a/ext/data/templates/anki-field-templates-upgrade-v13.handlebars b/ext/data/templates/anki-field-templates-upgrade-v13.handlebars index b3e0f1b9..afa5a2c0 100644 --- a/ext/data/templates/anki-field-templates-upgrade-v13.handlebars +++ b/ext/data/templates/anki-field-templates-upgrade-v13.handlebars @@ -63,3 +63,86 @@ {{=======}} {{~#if (hasMedia "clipboardText")}}{{#getMedia "clipboardText"}}{{/getMedia}}{{/if~}} {{>>>>>>>}} + +{{<<<<<<<}} +{{#*inline "pitch-accent-item-downstep-notation"}} + {{~#scope~}} + + {{~#set "style1a"~}}display:inline-block;position:relative;{{~/set~}} + {{~#set "style1b"~}}padding-right:0.1em;margin-right:0.1em;{{~/set~}} + {{~#set "style2a"~}}display:block;user-select:none;pointer-events:none;position:absolute;top:0.1em;left:0;right:0;height:0;border-top:0.1em solid;{{~/set~}} + {{~#set "style2b"~}}right:-0.1em;height:0.4em;border-right:0.1em solid;{{~/set~}} + {{~#each (getKanaMorae reading)~}} + {{~#set "style1"}}{{#get "style1a"}}{{/get}}{{/set~}} + {{~#set "style2"}}{{/set~}} + {{~#if (isMoraPitchHigh @index ../position)}} + {{~#set "style2"}}{{#get "style2a"}}{{/get}}{{/set~}} + {{~#if (op "!" (isMoraPitchHigh (op "+" @index 1) ../position))~}} + {{~#set "style1" (op "+" (get "style1") (get "style1b"))}}{{/set~}} + {{~#set "style2" (op "+" (get "style2") (get "style2b"))}}{{/set~}} + {{~/if~}} + {{~/if~}} + {{{.}}} + {{~/each~}} + + {{~/scope~}} +{{/inline}} + +{{#*inline "pitch-accent-item-graph-position-x"}}{{#op "+" 25 (op "*" index 50)}}{{/op}}{{/inline}} +{{#*inline "pitch-accent-item-graph-position-y"}}{{#op "+" 25 (op "?:" (isMoraPitchHigh index position) 0 50)}}{{/op}}{{/inline}} +{{#*inline "pitch-accent-item-graph-position"}}{{> pitch-accent-item-graph-position-x index=index position=position}} {{> pitch-accent-item-graph-position-y index=index position=position}}{{/inline}} +{{#*inline "pitch-accent-item-graph"}} + {{~#scope~}} + {{~#set "morae" (getKanaMorae reading)}}{{/set~}} + {{~#set "morae-count" (property (get "morae") "length")}}{{/set~}} + + + + + + + pitch-accent-item-graph-position index=@index position=../position~}} + {{~#set "cmd" "L"}}{{/set~}} + {{~/each~}} + "> + pitch-accent-item-graph-position index=(get "morae-count") position=position}}"> + {{#each (get "morae")}} + + {{/each}} + + + {{~/scope~}} +{{/inline}} + +{{#*inline "pitch-accent-item-position"~}} + [{{position}}] +{{~/inline}} + +{{#*inline "pitch-accent-item"}} + {{~#if (op "==" format "downstep-notation")~}} + {{~> pitch-accent-item-downstep-notation~}} + {{~else if (op "==" format "graph")~}} + {{~> pitch-accent-item-graph~}} + {{~else if (op "==" format "position")~}} + {{~> pitch-accent-item-position~}} + {{~/if~}} +{{/inline}} +{{=======}} +{{#*inline "pitch-accent-item"}} + {{~#pronunciation format=format reading=reading downstepPosition=position nasalPositions=nasalPositions devoicePositions=devoicePositions~}}{{~/pronunciation~}} +{{/inline}} +{{>>>>>>>}} + +{{<<<<<<<}} +{{#*inline "pitch-accents"}} + {{~> pitch-accent-list format='downstep-notation'~}} +{{/inline}} +{{=======}} +{{#*inline "pitch-accents"}} + {{~> pitch-accent-list format='text'~}} +{{/inline}} +{{>>>>>>>}} diff --git a/ext/data/templates/default-anki-field-templates.handlebars b/ext/data/templates/default-anki-field-templates.handlebars index 92f9c6b7..31d5d13f 100644 --- a/ext/data/templates/default-anki-field-templates.handlebars +++ b/ext/data/templates/default-anki-field-templates.handlebars @@ -183,71 +183,8 @@ {{/inline}} {{! Pitch Accents }} -{{#*inline "pitch-accent-item-downstep-notation"}} - {{~#scope~}} - - {{~#set "style1a"~}}display:inline-block;position:relative;{{~/set~}} - {{~#set "style1b"~}}padding-right:0.1em;margin-right:0.1em;{{~/set~}} - {{~#set "style2a"~}}display:block;user-select:none;pointer-events:none;position:absolute;top:0.1em;left:0;right:0;height:0;border-top:0.1em solid;{{~/set~}} - {{~#set "style2b"~}}right:-0.1em;height:0.4em;border-right:0.1em solid;{{~/set~}} - {{~#each (getKanaMorae reading)~}} - {{~#set "style1"}}{{#get "style1a"}}{{/get}}{{/set~}} - {{~#set "style2"}}{{/set~}} - {{~#if (isMoraPitchHigh @index ../position)}} - {{~#set "style2"}}{{#get "style2a"}}{{/get}}{{/set~}} - {{~#if (op "!" (isMoraPitchHigh (op "+" @index 1) ../position))~}} - {{~#set "style1" (op "+" (get "style1") (get "style1b"))}}{{/set~}} - {{~#set "style2" (op "+" (get "style2") (get "style2b"))}}{{/set~}} - {{~/if~}} - {{~/if~}} - {{{.}}} - {{~/each~}} - - {{~/scope~}} -{{/inline}} - -{{#*inline "pitch-accent-item-graph-position-x"}}{{#op "+" 25 (op "*" index 50)}}{{/op}}{{/inline}} -{{#*inline "pitch-accent-item-graph-position-y"}}{{#op "+" 25 (op "?:" (isMoraPitchHigh index position) 0 50)}}{{/op}}{{/inline}} -{{#*inline "pitch-accent-item-graph-position"}}{{> pitch-accent-item-graph-position-x index=index position=position}} {{> pitch-accent-item-graph-position-y index=index position=position}}{{/inline}} -{{#*inline "pitch-accent-item-graph"}} - {{~#scope~}} - {{~#set "morae" (getKanaMorae reading)}}{{/set~}} - {{~#set "morae-count" (property (get "morae") "length")}}{{/set~}} - - - - - - - pitch-accent-item-graph-position index=@index position=../position~}} - {{~#set "cmd" "L"}}{{/set~}} - {{~/each~}} - "> - pitch-accent-item-graph-position index=(get "morae-count") position=position}}"> - {{#each (get "morae")}} - - {{/each}} - - - {{~/scope~}} -{{/inline}} - -{{#*inline "pitch-accent-item-position"~}} - [{{position}}] -{{~/inline}} - {{#*inline "pitch-accent-item"}} - {{~#if (op "==" format "downstep-notation")~}} - {{~> pitch-accent-item-downstep-notation~}} - {{~else if (op "==" format "graph")~}} - {{~> pitch-accent-item-graph~}} - {{~else if (op "==" format "position")~}} - {{~> pitch-accent-item-position~}} - {{~/if~}} + {{~#pronunciation format=format reading=reading downstepPosition=position nasalPositions=nasalPositions devoicePositions=devoicePositions~}}{{~/pronunciation~}} {{/inline}} {{#*inline "pitch-accent-item-disambiguation"}} @@ -280,7 +217,7 @@ {{/inline}} {{#*inline "pitch-accents"}} - {{~> pitch-accent-list format='downstep-notation'~}} + {{~> pitch-accent-list format='text'~}} {{/inline}} {{#*inline "pitch-accent-graphs"}} 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 diff --git a/test/data/anki-note-builder-test-results.json b/test/data/anki-note-builder-test-results.json index 00e7965b..39b5da1b 100644 --- a/test/data/anki-note-builder-test-results.json +++ b/test/data/anki-note-builder-test-results.json @@ -326,9 +326,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -356,9 +356,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -386,9 +386,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -416,9 +416,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -866,9 +866,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -896,9 +896,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -991,9 +991,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1021,9 +1021,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1163,9 +1163,9 @@ "glossary-brief": "
    • uchikomu definition 1
    • uchikomu definition 2
    • uchikomu definition 3
    • uchikomu definition 4
", "glossary-no-dictionary": "
  1. (vt)
    • uchikomu definition 1
    • uchikomu definition 2
  2. (vt)
    • uchikomu definition 3
    • uchikomu definition 4
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1193,9 +1193,9 @@ "glossary-brief": "
    • buchikomu definition 1
    • buchikomu definition 2
    • buchikomu definition 3
    • buchikomu definition 4
", "glossary-no-dictionary": "
  1. (vt)
    • buchikomu definition 1
    • buchikomu definition 2
  2. (vt)
    • buchikomu definition 3
    • buchikomu definition 4
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1348,9 +1348,9 @@ "glossary-brief": "
    • uchikomu definition 1
    • uchikomu definition 2
    • buchikomu definition 1
    • buchikomu definition 2
    • uchikomu definition 3
    • uchikomu definition 4
    • buchikomu definition 3
    • buchikomu definition 4
", "glossary-no-dictionary": "
  1. (vt) (うちこむ only)
    • uchikomu definition 1
    • uchikomu definition 2
  2. (vt) (ぶちこむ only)
    • buchikomu definition 1
    • buchikomu definition 2
  3. (vt) (うちこむ only)
    • uchikomu definition 3
    • uchikomu definition 4
  4. (vt) (ぶちこむ only)
    • buchikomu definition 3
    • buchikomu definition 4
", "part-of-speech": "Godan verb", - "pitch-accents": "
  1. (うちこむ only)
  2. (うちこむ only)
  3. (ぶちこむ only)
  4. (ぶちこむ only)
", - "pitch-accent-graphs": "
  1. (うちこむ only) \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. (うちこむ only) \n \n \n \n \n \n \n \n \n \n \n \n \n
  3. (ぶちこむ only) \n \n \n \n \n \n \n \n \n \n \n \n \n
  4. (ぶちこむ only) \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. (うちこむ only) [0]
  2. (うちこむ only) [3]
  3. (ぶちこむ only) [0]
  4. (ぶちこむ only) [3]
", + "pitch-accents": "
  1. (うちこむ only)
  2. (うちこむ only)
  3. (ぶちこむ only)
  4. (ぶちこむ only)
", + "pitch-accent-graphs": "
  1. (うちこむ only)
  2. (うちこむ only)
  3. (ぶちこむ only)
  4. (ぶちこむ only)
", + "pitch-accent-positions": "
  1. (うちこむ only) [0]
  2. (うちこむ only) [3]
  3. (ぶちこむ only) [0]
  4. (ぶちこむ only) [3]
", "reading": "うちこむ、ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1473,9 +1473,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1503,9 +1503,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1533,9 +1533,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1563,9 +1563,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1778,9 +1778,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1808,9 +1808,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1838,9 +1838,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -1868,9 +1868,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -2083,9 +2083,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -2113,9 +2113,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -2143,9 +2143,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "うちこむ", "screenshot": "", "search-query": "fullQuery", @@ -2173,9 +2173,9 @@ "glossary-brief": "
", "glossary-no-dictionary": "
(vt)
", "part-of-speech": "Godan verb", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [0]
  2. [3]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [0]
  2. [3]
", "reading": "ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -2493,9 +2493,9 @@ "glossary-brief": "
    • uchikomu definition 1
    • uchikomu definition 2
    • buchikomu definition 1
    • buchikomu definition 2
    • uchikomu definition 3
    • uchikomu definition 4
    • buchikomu definition 3
    • buchikomu definition 4
", "glossary-no-dictionary": "
  1. (vt) (うちこむ only)
    • uchikomu definition 1
    • uchikomu definition 2
  2. (vt) (ぶちこむ only)
    • buchikomu definition 1
    • buchikomu definition 2
  3. (vt) (うちこむ only)
    • uchikomu definition 3
    • uchikomu definition 4
  4. (vt) (ぶちこむ only)
    • buchikomu definition 3
    • buchikomu definition 4
", "part-of-speech": "Godan verb", - "pitch-accents": "
  1. (うちこむ only)
  2. (うちこむ only)
  3. (ぶちこむ only)
  4. (ぶちこむ only)
", - "pitch-accent-graphs": "
  1. (うちこむ only) \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. (うちこむ only) \n \n \n \n \n \n \n \n \n \n \n \n \n
  3. (ぶちこむ only) \n \n \n \n \n \n \n \n \n \n \n \n \n
  4. (ぶちこむ only) \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. (うちこむ only) [0]
  2. (うちこむ only) [3]
  3. (ぶちこむ only) [0]
  4. (ぶちこむ only) [3]
", + "pitch-accents": "
  1. (うちこむ only)
  2. (うちこむ only)
  3. (ぶちこむ only)
  4. (ぶちこむ only)
", + "pitch-accent-graphs": "
  1. (うちこむ only)
  2. (うちこむ only)
  3. (ぶちこむ only)
  4. (ぶちこむ only)
", + "pitch-accent-positions": "
  1. (うちこむ only) [0]
  2. (うちこむ only) [3]
  3. (ぶちこむ only) [0]
  4. (ぶちこむ only) [3]
", "reading": "うちこむ、ぶちこむ", "screenshot": "", "search-query": "fullQuery", @@ -2558,9 +2558,9 @@ "glossary-brief": "
otemae definition
", "glossary-no-dictionary": "
(n) otemae definition
", "part-of-speech": "Noun", - "pitch-accents": "
", - "pitch-accent-graphs": "
  1. \n \n \n \n \n \n \n \n \n \n \n \n \n
  2. \n \n \n \n \n \n \n \n \n \n \n \n \n
  3. \n \n \n \n \n \n \n \n \n \n \n \n \n
", - "pitch-accent-positions": "
  1. [2]
  2. [2]
  3. [0]
", + "pitch-accents": "
", + "pitch-accent-graphs": "
", + "pitch-accent-positions": "
  1. [2]
  2. [2]
  3. [0]
", "reading": "おてまえ", "screenshot": "", "search-query": "fullQuery", @@ -2593,9 +2593,9 @@ "glossary-brief": "
bangou definition
", "glossary-no-dictionary": "
(n) bangou definition
", "part-of-speech": "Noun", - "pitch-accents": "", - "pitch-accent-graphs": "\n \n \n \n \n \n \n \n \n \n \n \n \n", - "pitch-accent-positions": "[3]", + "pitch-accents": "", + "pitch-accent-graphs": "", + "pitch-accent-positions": "[3]", "reading": "ばんごう", "screenshot": "", "search-query": "fullQuery", @@ -2628,9 +2628,9 @@ "glossary-brief": "
chuugoshi definition
", "glossary-no-dictionary": "
(n) chuugoshi definition
", "part-of-speech": "Noun", - "pitch-accents": "ちゅ", - "pitch-accent-graphs": "\n \n \n \n \n \n \n \n \n \n \n \n \n", - "pitch-accent-positions": "[0]", + "pitch-accents": "", + "pitch-accent-graphs": "", + "pitch-accent-positions": "[0]", "reading": "ちゅうごし", "screenshot": "", "search-query": "fullQuery", @@ -2663,9 +2663,9 @@ "glossary-brief": "
shogyouu definition
", "glossary-no-dictionary": "
(n) shogyouu definition
", "part-of-speech": "Noun", - "pitch-accents": "しょぎょ", - "pitch-accent-graphs": "\n \n \n \n \n \n \n \n \n \n \n \n", - "pitch-accent-positions": "[0]", + "pitch-accents": "", + "pitch-accent-graphs": "", + "pitch-accent-positions": "[0]", "reading": "しょぎょう", "screenshot": "", "search-query": "fullQuery", @@ -2698,9 +2698,9 @@ "glossary-brief": "
dobokukouji definition
", "glossary-no-dictionary": "
(n) dobokukouji definition
", "part-of-speech": "Noun", - "pitch-accents": "", - "pitch-accent-graphs": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", - "pitch-accent-positions": "[4]", + "pitch-accents": "", + "pitch-accent-graphs": "", + "pitch-accent-positions": "[4]", "reading": "どぼくこうじ", "screenshot": "", "search-query": "fullQuery", diff --git a/test/data/translator-test-results-note-data1.json b/test/data/translator-test-results-note-data1.json index d679287b..ee610265 100644 --- a/test/data/translator-test-results-note-data1.json +++ b/test/data/translator-test-results-note-data1.json @@ -2074,6 +2074,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -2084,6 +2086,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -2360,6 +2364,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -2370,6 +2376,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -2646,6 +2654,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -2656,6 +2666,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -2932,6 +2944,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -2942,6 +2956,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -5717,6 +5733,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -5727,6 +5745,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -6003,6 +6023,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -6013,6 +6035,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -6698,6 +6722,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -6708,6 +6734,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -6984,6 +7012,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -6994,6 +7024,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -7866,6 +7898,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -7876,6 +7910,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -8175,6 +8211,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -8185,6 +8223,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -9488,6 +9528,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [ @@ -9500,6 +9542,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [ @@ -9512,6 +9556,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [ @@ -9524,6 +9570,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [ @@ -10512,6 +10560,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -10522,6 +10572,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -10802,6 +10854,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -10812,6 +10866,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -11092,6 +11148,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -11102,6 +11160,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -11382,6 +11442,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -11392,6 +11454,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -12838,6 +12902,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -12848,6 +12914,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -13124,6 +13192,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -13134,6 +13204,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -13410,6 +13482,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -13420,6 +13494,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -13696,6 +13772,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -13706,6 +13784,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -15152,6 +15232,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -15162,6 +15244,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -15438,6 +15522,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -15448,6 +15534,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -15724,6 +15812,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -15734,6 +15824,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -16010,6 +16102,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -16020,6 +16114,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -18123,6 +18219,8 @@ ], "reading": "うちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [ @@ -18135,6 +18233,8 @@ ], "reading": "うちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [ @@ -18147,6 +18247,8 @@ ], "reading": "ぶちこむ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [ @@ -18159,6 +18261,8 @@ ], "reading": "ぶちこむ", "position": 3, + "nasalPositions": [], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [ @@ -18763,6 +18867,8 @@ ], "reading": "おてまえ", "position": 2, + "nasalPositions": [], + "devoicePositions": [], "tags": [ { "name": "P1", @@ -18787,6 +18893,8 @@ ], "reading": "おてまえ", "position": 2, + "nasalPositions": [], + "devoicePositions": [], "tags": [ { "name": "P2", @@ -18811,6 +18919,8 @@ ], "reading": "おてまえ", "position": 0, + "nasalPositions": [], + "devoicePositions": [], "tags": [ { "name": "P2", @@ -18981,6 +19091,10 @@ ], "reading": "ばんごう", "position": 3, + "nasalPositions": [ + 3 + ], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -19137,6 +19251,10 @@ ], "reading": "ちゅうごし", "position": 0, + "nasalPositions": [ + 3 + ], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -19293,6 +19411,10 @@ ], "reading": "しょぎょう", "position": 0, + "nasalPositions": [ + 2 + ], + "devoicePositions": [], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] @@ -19449,6 +19571,10 @@ ], "reading": "どぼくこうじ", "position": 4, + "nasalPositions": [], + "devoicePositions": [ + 3 + ], "tags": [], "exclusiveExpressions": [], "exclusiveReadings": [] diff --git a/test/test-options-util.js b/test/test-options-util.js index 10881af9..255b6a27 100644 --- a/test/test-options-util.js +++ b/test/test-options-util.js @@ -1013,6 +1013,174 @@ async function testFieldTemplatesUpdate(extDir) { {{~#if (hasMedia "clipboardText")}}{{#getMedia "clipboardText"}}{{/getMedia}}{{/if~}} {{/inline}} +<<>> +{{~> (lookup . "marker") ~}}`.trimStart() + }, + // hasMedia/getMedia update + { + oldVersion: 12, + newVersion: 13, + old: ` +{{! Pitch Accents }} +{{#*inline "pitch-accent-item-downstep-notation"}} + {{~#scope~}} + + {{~#set "style1a"~}}display:inline-block;position:relative;{{~/set~}} + {{~#set "style1b"~}}padding-right:0.1em;margin-right:0.1em;{{~/set~}} + {{~#set "style2a"~}}display:block;user-select:none;pointer-events:none;position:absolute;top:0.1em;left:0;right:0;height:0;border-top:0.1em solid;{{~/set~}} + {{~#set "style2b"~}}right:-0.1em;height:0.4em;border-right:0.1em solid;{{~/set~}} + {{~#each (getKanaMorae reading)~}} + {{~#set "style1"}}{{#get "style1a"}}{{/get}}{{/set~}} + {{~#set "style2"}}{{/set~}} + {{~#if (isMoraPitchHigh @index ../position)}} + {{~#set "style2"}}{{#get "style2a"}}{{/get}}{{/set~}} + {{~#if (op "!" (isMoraPitchHigh (op "+" @index 1) ../position))~}} + {{~#set "style1" (op "+" (get "style1") (get "style1b"))}}{{/set~}} + {{~#set "style2" (op "+" (get "style2") (get "style2b"))}}{{/set~}} + {{~/if~}} + {{~/if~}} + {{{.}}} + {{~/each~}} + + {{~/scope~}} +{{/inline}} + +{{#*inline "pitch-accent-item-graph-position-x"}}{{#op "+" 25 (op "*" index 50)}}{{/op}}{{/inline}} +{{#*inline "pitch-accent-item-graph-position-y"}}{{#op "+" 25 (op "?:" (isMoraPitchHigh index position) 0 50)}}{{/op}}{{/inline}} +{{#*inline "pitch-accent-item-graph-position"}}{{> pitch-accent-item-graph-position-x index=index position=position}} {{> pitch-accent-item-graph-position-y index=index position=position}}{{/inline}} +{{#*inline "pitch-accent-item-graph"}} + {{~#scope~}} + {{~#set "morae" (getKanaMorae reading)}}{{/set~}} + {{~#set "morae-count" (property (get "morae") "length")}}{{/set~}} + + + + + + + pitch-accent-item-graph-position index=@index position=../position~}} + {{~#set "cmd" "L"}}{{/set~}} + {{~/each~}} + "> + pitch-accent-item-graph-position index=(get "morae-count") position=position}}"> + {{#each (get "morae")}} + + {{/each}} + + + {{~/scope~}} +{{/inline}} + +{{#*inline "pitch-accent-item-position"~}} + [{{position}}] +{{~/inline}} + +{{#*inline "pitch-accent-item"}} + {{~#if (op "==" format "downstep-notation")~}} + {{~> pitch-accent-item-downstep-notation~}} + {{~else if (op "==" format "graph")~}} + {{~> pitch-accent-item-graph~}} + {{~else if (op "==" format "position")~}} + {{~> pitch-accent-item-position~}} + {{~/if~}} +{{/inline}} + +{{#*inline "pitch-accent-item-disambiguation"}} + {{~#scope~}} + {{~#set "exclusive" (spread exclusiveExpressions exclusiveReadings)}}{{/set~}} + {{~#if (op ">" (property (get "exclusive") "length") 0)~}} + {{~#set "separator" ""~}}{{/set~}} + ({{#each (get "exclusive")~}} + {{~#get "separator"}}{{/get~}}{{{.}}} + {{~/each}} only) + {{~/if~}} + {{~/scope~}} +{{/inline}} + +{{#*inline "pitch-accent-list"}} + {{~#if (op ">" pitchCount 0)~}} + {{~#if (op ">" pitchCount 1)~}}
    {{~/if~}} + {{~#each pitches~}} + {{~#each pitches~}} + {{~#if (op ">" ../../pitchCount 1)~}}
  1. {{~/if~}} + {{~> pitch-accent-item-disambiguation~}} + {{~> pitch-accent-item format=../../format~}} + {{~#if (op ">" ../../pitchCount 1)~}}
  2. {{~/if~}} + {{~/each~}} + {{~/each~}} + {{~#if (op ">" pitchCount 1)~}}
{{~/if~}} + {{~else~}} + No pitch accent data + {{~/if~}} +{{/inline}} + +{{#*inline "pitch-accents"}} + {{~> pitch-accent-list format='downstep-notation'~}} +{{/inline}} + +{{#*inline "pitch-accent-graphs"}} + {{~> pitch-accent-list format='graph'~}} +{{/inline}} + +{{#*inline "pitch-accent-positions"}} + {{~> pitch-accent-list format='position'~}} +{{/inline}} +{{! End Pitch Accents }} + +{{~> (lookup . "marker") ~}}`.trimStart(), + + expected: ` +{{! Pitch Accents }} +{{#*inline "pitch-accent-item"}} + {{~#pronunciation format=format reading=reading downstepPosition=position nasalPositions=nasalPositions devoicePositions=devoicePositions~}}{{~/pronunciation~}} +{{/inline}} + +{{#*inline "pitch-accent-item-disambiguation"}} + {{~#scope~}} + {{~#set "exclusive" (spread exclusiveExpressions exclusiveReadings)}}{{/set~}} + {{~#if (op ">" (property (get "exclusive") "length") 0)~}} + {{~#set "separator" ""~}}{{/set~}} + ({{#each (get "exclusive")~}} + {{~#get "separator"}}{{/get~}}{{{.}}} + {{~/each}} only) + {{~/if~}} + {{~/scope~}} +{{/inline}} + +{{#*inline "pitch-accent-list"}} + {{~#if (op ">" pitchCount 0)~}} + {{~#if (op ">" pitchCount 1)~}}
    {{~/if~}} + {{~#each pitches~}} + {{~#each pitches~}} + {{~#if (op ">" ../../pitchCount 1)~}}
  1. {{~/if~}} + {{~> pitch-accent-item-disambiguation~}} + {{~> pitch-accent-item format=../../format~}} + {{~#if (op ">" ../../pitchCount 1)~}}
  2. {{~/if~}} + {{~/each~}} + {{~/each~}} + {{~#if (op ">" pitchCount 1)~}}
{{~/if~}} + {{~else~}} + No pitch accent data + {{~/if~}} +{{/inline}} + +{{#*inline "pitch-accents"}} + {{~> pitch-accent-list format='text'~}} +{{/inline}} + +{{#*inline "pitch-accent-graphs"}} + {{~> pitch-accent-list format='graph'~}} +{{/inline}} + +{{#*inline "pitch-accent-positions"}} + {{~> pitch-accent-list format='position'~}} +{{/inline}} +{{! End Pitch Accents }} + <<>> {{~> (lookup . "marker") ~}}`.trimStart() } -- cgit v1.2.3