diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-05-17 20:18:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-17 20:18:37 -0400 |
commit | 76276e78dac387df66384a10bc1179c90ebd93fe (patch) | |
tree | ba11d7bf4375aa76ae45646b45953df9e71f1d78 /test | |
parent | 12451eaf61281e588fb8ef5f911d604ba34aca92 (diff) |
Expose search query to anki template renderer (#1686)
* Expose query and fullQuery to Anki context
* Add {search-query} marker
* Update test data
* Update tests
* Wrap search query in multiLine
Diffstat (limited to 'test')
-rw-r--r-- | test/data/anki-note-builder-test-results.json | 81 | ||||
-rw-r--r-- | test/data/translator-test-results-note-data1.json | 162 | ||||
-rw-r--r-- | test/test-anki-note-builder.js | 6 | ||||
-rw-r--r-- | test/test-options-util.js | 8 |
4 files changed, 255 insertions, 2 deletions
diff --git a/test/data/anki-note-builder-test-results.json b/test/data/anki-note-builder-test-results.json index bcf3eb6d..851584c8 100644 --- a/test/data/anki-note-builder-test-results.json +++ b/test/data/anki-note-builder-test-results.json @@ -15,6 +15,7 @@ "kunyomi": "う.つ, う.ち-, ぶ.つ", "onyomi": "ダ, ダアス", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "stroke-count": "Stroke count: Unknown", "tags": "", @@ -38,6 +39,7 @@ "kunyomi": "-こ.む, こ.む, こ.み, -こ.み, こ.める", "onyomi": "", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix込cloze-suffix", "stroke-count": "Stroke count: Unknown", "tags": "", @@ -75,6 +77,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "だ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -102,6 +105,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ダース", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -134,6 +138,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打つcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -161,6 +166,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打つcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -188,6 +194,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打つcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -215,6 +222,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打つcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -242,6 +250,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "だ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -269,6 +278,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ダース", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -301,6 +311,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -328,6 +339,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -355,6 +367,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -382,6 +395,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -409,6 +423,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -436,6 +451,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -463,6 +479,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -490,6 +507,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -517,6 +535,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "だ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -544,6 +563,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ダース", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -576,6 +596,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "がぞう", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix画像cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -608,6 +629,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "だ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixだcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -640,6 +662,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ダース", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixダースcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -672,6 +695,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixうつcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -699,6 +723,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixうつcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -731,6 +756,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixぶつcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -758,6 +784,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixぶつcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -790,6 +817,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixうちこむcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -817,6 +845,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixうちこむcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -844,6 +873,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixうちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -871,6 +901,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixうちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -903,6 +934,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixぶちこむcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -930,6 +962,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixぶちこむcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -957,6 +990,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixぶちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -984,6 +1018,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixぶちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1016,6 +1051,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "がぞう", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixがぞうcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1060,6 +1096,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1087,6 +1124,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1114,6 +1152,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1141,6 +1180,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1168,6 +1208,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "だ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1195,6 +1236,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ダース", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1227,6 +1269,7 @@ "pitch-accent-positions": "<ol><li><em>(うちこむ only) </em><span>[0]</span></li><li><em>(うちこむ only) </em><span>[3]</span></li><li><em>(ぶちこむ only) </em><span>[0]</span></li><li><em>(ぶちこむ only) </em><span>[3]</span></li></ol>", "reading": "うちこむ、ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1254,6 +1297,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ、ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1281,6 +1325,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "だ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1308,6 +1353,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ダース", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1340,6 +1386,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込んでいませんでしたcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1367,6 +1414,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込んでいませんでしたcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1394,6 +1442,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込んでいませんでしたcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1421,6 +1470,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ち込んでいませんでしたcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1448,6 +1498,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1475,6 +1526,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1502,6 +1554,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1529,6 +1582,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1556,6 +1610,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "だ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1583,6 +1638,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ダース", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1615,6 +1671,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打(う)ち込(こ)むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1642,6 +1699,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打(う)ち込(こ)むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1669,6 +1727,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打(う)ち込(こ)むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1696,6 +1755,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打(う)ち込(こ)むcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1723,6 +1783,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打(う)ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1750,6 +1811,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打(う)ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1777,6 +1839,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打(う)ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1804,6 +1867,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打(う)ちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1831,6 +1895,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "だ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1858,6 +1923,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ダース", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix打cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1890,6 +1956,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix(打)(ち)(込)(む)cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1917,6 +1984,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix(打)(ち)(込)(む)cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1944,6 +2012,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "うちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix(打)(ち)(込)(む)cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1971,6 +2040,7 @@ "pitch-accent-positions": "<ol><li><span>[0]</span></li><li><span>[3]</span></li></ol>", "reading": "ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix(打)(ち)(込)(む)cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -1998,6 +2068,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix(打)(ち)cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -2025,6 +2096,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix(打)(ち)cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -2052,6 +2124,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix(打)(ち)cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -2079,6 +2152,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix(打)(ち)cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -2106,6 +2180,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "だ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix(打)cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -2133,6 +2208,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "ダース", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefix(打)cloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -2165,6 +2241,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "よむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixtestcloze-suffix", "tags": "popular", "url": "<a href=\"url:\">url:</a>" @@ -2197,6 +2274,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "つよみ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixつtestcloze-suffix", "tags": "popular", "url": "<a href=\"url:\">url:</a>" @@ -2229,6 +2307,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "よむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixtestましたcloze-suffix", "tags": "popular", "url": "<a href=\"url:\">url:</a>" @@ -2261,6 +2340,7 @@ "pitch-accent-positions": "<ol><li><em>(うちこむ only) </em><span>[0]</span></li><li><em>(うちこむ only) </em><span>[3]</span></li><li><em>(ぶちこむ only) </em><span>[0]</span></li><li><em>(ぶちこむ only) </em><span>[3]</span></li></ol>", "reading": "うちこむ、ぶちこむ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixうちこむcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" @@ -2288,6 +2368,7 @@ "pitch-accent-positions": "No pitch accent data", "reading": "うつ、ぶつ", "screenshot": "<img src=\"\" />", + "search-query": "fullQuery", "sentence": "cloze-prefixうちcloze-suffix", "tags": "tag1, tag2", "url": "<a href=\"url:\">url:</a>" diff --git a/test/data/translator-test-results-note-data1.json b/test/data/translator-test-results-note-data1.json index e9d41526..740e6661 100644 --- a/test/data/translator-test-results-note-data1.json +++ b/test/data/translator-test-results-note-data1.json @@ -138,6 +138,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -283,6 +285,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -510,6 +514,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -728,6 +734,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -961,6 +969,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -1189,6 +1199,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -1417,6 +1429,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -1645,6 +1659,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -1863,6 +1879,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -2081,6 +2099,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -2400,6 +2420,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -2714,6 +2736,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -3028,6 +3052,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -3342,6 +3368,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -3572,6 +3600,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -3802,6 +3832,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -4032,6 +4064,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -4262,6 +4296,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -4480,6 +4516,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -4698,6 +4736,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -4876,6 +4916,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -5099,6 +5141,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -5322,6 +5366,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -5555,6 +5601,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -5783,6 +5831,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -6016,6 +6066,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -6244,6 +6296,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -6563,6 +6617,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -6877,6 +6933,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -7107,6 +7165,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -7337,6 +7397,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -7656,6 +7718,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -7970,6 +8034,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -8200,6 +8266,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -8430,6 +8498,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -8608,6 +8678,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -8989,6 +9061,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -9317,6 +9391,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -9569,6 +9645,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -9821,6 +9899,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -10037,6 +10117,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -10253,6 +10335,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -10830,6 +10914,8 @@ ], "pitchCount": 4, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -11229,6 +11315,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -11420,6 +11508,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -11611,6 +11701,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -11934,6 +12026,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -12252,6 +12346,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -12570,6 +12666,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -12888,6 +12986,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -13118,6 +13218,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -13348,6 +13450,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -13578,6 +13682,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -13808,6 +13914,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -14026,6 +14134,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -14244,6 +14354,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -14563,6 +14675,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -14877,6 +14991,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -15191,6 +15307,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -15505,6 +15623,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -15735,6 +15855,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -15965,6 +16087,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -16195,6 +16319,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -16425,6 +16551,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -16643,6 +16771,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -16861,6 +16991,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -17180,6 +17312,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -17494,6 +17628,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -17808,6 +17944,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -18122,6 +18260,8 @@ ], "pitchCount": 2, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -18352,6 +18492,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -18582,6 +18724,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -18812,6 +18956,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -19042,6 +19188,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -19260,6 +19408,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -19478,6 +19628,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -19613,6 +19765,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -19726,6 +19880,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -19861,6 +20017,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -20438,6 +20596,8 @@ ], "pitchCount": 4, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } @@ -20837,6 +20997,8 @@ "pitches": [], "pitchCount": 0, "context": { + "query": "query", + "fullQuery": "fullQuery", "document": { "title": "title" } diff --git a/test/test-anki-note-builder.js b/test/test-anki-note-builder.js index d8fd558e..2ab79551 100644 --- a/test/test-anki-note-builder.js +++ b/test/test-anki-note-builder.js @@ -110,6 +110,7 @@ function getFieldMarkers(type) { 'pitch-accent-positions', 'reading', 'screenshot', + 'search-query', 'sentence', 'tags', 'url' @@ -128,6 +129,7 @@ function getFieldMarkers(type) { 'kunyomi', 'onyomi', 'screenshot', + 'search-query', 'sentence', 'stroke-count', 'tags', @@ -167,7 +169,9 @@ async function getRenderResults(dictionaryEntries, type, mode, template, AnkiNot text: `${clozePrefix}${source}${clozeSuffix}`, offset: clozePrefix.length }, - documentTitle: 'title' + documentTitle: 'title', + query: 'query', + fullQuery: 'fullQuery' }; const errors = []; const noteFields = (await ankiNoteBuilder.createNote({ diff --git a/test/test-options-util.js b/test/test-options-util.js index 8b65f134..7e11aad1 100644 --- a/test/test-options-util.js +++ b/test/test-options-util.js @@ -641,6 +641,7 @@ async function testFieldTemplatesUpdate(extDir) { const update6 = loadDataFile('data/templates/anki-field-templates-upgrade-v6.handlebars'); const update8 = loadDataFile('data/templates/anki-field-templates-upgrade-v8.handlebars'); const update10 = loadDataFile('data/templates/anki-field-templates-upgrade-v10.handlebars'); + const update12 = loadDataFile('data/templates/anki-field-templates-upgrade-v12.handlebars'); const data = [ // Standard format @@ -662,6 +663,7 @@ ${update4} ${update6} ${update8} ${update10} +${update12} {{~> (lookup . "marker") ~}}`.trimStart() }, // Non-standard marker format @@ -683,7 +685,8 @@ ${update2} ${update4} ${update6} ${update8} -${update10}`.trimStart() +${update10} +${update12}`.trimStart() }, // Empty test { @@ -696,6 +699,7 @@ ${update4} ${update6} ${update8} ${update10} +${update12} {{~> (lookup . "marker") ~}}`.trimStart() }, // Definition tags update @@ -770,6 +774,7 @@ ${update4} ${update6} ${update8} ${update10} +${update12} {{~> (lookup . "marker") ~}} `.trimStart() }, @@ -911,6 +916,7 @@ ${update10} ${update8} ${update10} +${update12} {{~> (lookup . "marker") ~}}`.trimStart() } ]; |