summaryrefslogtreecommitdiff
path: root/ext/data
diff options
context:
space:
mode:
authorKuuuube <61125188+Kuuuube@users.noreply.github.com>2024-02-12 01:10:52 -0500
committerGitHub <noreply@github.com>2024-02-12 06:10:52 +0000
commitfd48f18f8aa05a362f3168cbddcc03659e7510db (patch)
tree56d0eef7b54c19aae04f3a43bdcdf5a2d4409733 /ext/data
parent92f6652ade62264cbdd600ec44c7581ec8e23b08 (diff)
Add and fix tests with options upgrades (#671)24.2.12.0
* Add and fix tests and options applying * Fix comma * Add test file to json.json * Fix direction of conjugation handlebars update * Add frequency and cloze-body-kana to upgrade * Use Array.isArray() instead of arbitrary length check * Add pitch-accent-categories handlebar * programmatically get upgrade files * add type --------- Co-authored-by: Cashew <tungbinem@gmail.com>
Diffstat (limited to 'ext/data')
-rw-r--r--ext/data/templates/anki-field-templates-upgrade-v24.handlebars56
1 files changed, 48 insertions, 8 deletions
diff --git a/ext/data/templates/anki-field-templates-upgrade-v24.handlebars b/ext/data/templates/anki-field-templates-upgrade-v24.handlebars
index 717cb74b..1459fd49 100644
--- a/ext/data/templates/anki-field-templates-upgrade-v24.handlebars
+++ b/ext/data/templates/anki-field-templates-upgrade-v24.handlebars
@@ -1,3 +1,7 @@
+{{#*inline "cloze-body-kana"}}
+ {{~#if definition.cloze}}{{definition.cloze.bodyKana}}{{/if~}}
+{{/inline}}
+
{{#*inline "phonetic-transcriptions"}}
{{~#if (op ">" definition.phoneticTranscriptions.length 0)~}}
<ul>
@@ -21,6 +25,15 @@
{{<<<<<<<}}
{{#*inline "conjugation"}}
+ {{~#if definition.reasons~}}
+ {{~#each definition.reasons~}}
+ {{~#if (op ">" @index 0)}} « {{/if~}}
+ {{.}}
+ {{~/each~}}
+ {{~/if~}}
+{{/inline}}
+{{=======}}
+{{#*inline "conjugation"}}
{{~#if (op ">" definition.inflectionRuleChainCandidates.length 0)~}}
{{~set "multiple" false~}}
{{~#if (op ">" definition.inflectionRuleChainCandidates.length 1)~}}
@@ -40,13 +53,40 @@
{{~#if (get "multiple")~}}</ul>{{/if~}}
{{~/if~}}
{{/inline}}
-{{=======}}
-{{#*inline "conjugation"}}
- {{~#if definition.reasons~}}
- {{~#each definition.reasons~}}
- {{~#if (op ">" @index 0)}} « {{/if~}}
- {{.}}
- {{~/each~}}
+{{>>>>>>>}}
+
+{{#*inline "frequency-harmonic-rank"}}
+ {{~#if (op "===" definition.frequencyHarmonic -1) ~}}
+ 9999999
+ {{~else ~}}
+ {{definition.frequencyHarmonic}}
{{~/if~}}
{{/inline}}
-{{>>>>>>>}}
+
+{{#*inline "frequency-harmonic-occurrence"}}
+ {{~#if (op "===" definition.frequencyHarmonic -1) ~}}
+ 0
+ {{~else ~}}
+ {{definition.frequencyHarmonic}}
+ {{~/if~}}
+{{/inline}}
+
+{{#*inline "frequency-average-rank"}}
+ {{~#if (op "===" definition.frequencyAverage -1) ~}}
+ 9999999
+ {{~else ~}}
+ {{definition.frequencyAverage}}
+ {{~/if~}}
+{{/inline}}
+
+{{#*inline "frequency-average-occurrence"}}
+ {{~#if (op "===" definition.frequencyAverage -1) ~}}
+ 0
+ {{~else ~}}
+ {{definition.frequencyAverage}}
+ {{~/if~}}
+{{/inline}}
+
+{{~#*inline "pitch-accent-categories"~}}
+ {{~#each (pitchCategories @root)~}}{{~.~}}{{~#unless @last~}},{{~/unless~}}{{~/each~}}
+{{~/inline~}} \ No newline at end of file