From 309d0b41ff2936a8665f39708c678e3ff9c23742 Mon Sep 17 00:00:00 2001 From: StefanVukovic99 Date: Sun, 28 Jan 2024 16:35:05 +0100 Subject: add translator text transformation tests (#565) * Copy functions from JapaneseUtil * Remove JapaneseUtil * Update usages of JapaneseUtil functions * add tests * Copy functions from JapaneseUtil * Remove JapaneseUtil * Update usages of JapaneseUtil functions --------- Co-authored-by: toasted-nutbread Co-authored-by: Darius Jahandarie --- test/data/anki-note-builder-test-results.json | 309 ++++++++++++++++++++++++++ 1 file changed, 309 insertions(+) (limited to 'test/data/anki-note-builder-test-results.json') diff --git a/test/data/anki-note-builder-test-results.json b/test/data/anki-note-builder-test-results.json index 7129d748..b93b466b 100644 --- a/test/data/anki-note-builder-test-results.json +++ b/test/data/anki-note-builder-test-results.json @@ -2903,5 +2903,314 @@ "url": "url:" } ] + }, + { + "name": "Test text transformations - convertNumericCharacters", + "results": [ + { + "audio": "", + "clipboard-image": "", + "clipboard-text": "", + "cloze-body": "39", + "cloze-prefix": "cloze-prefix", + "cloze-suffix": "cloze-suffix", + "conjugation": "", + "dictionary": "Test Dictionary 2", + "document-title": "title", + "expression": "39", + "frequencies": "", + "furigana": "39さんきゅう", + "furigana-plain": "39[さんきゅう]", + "glossary": "
(Test Dictionary 2) sankyuu definition
", + "glossary-brief": "
sankyuu definition
", + "glossary-no-dictionary": "
sankyuu definition
", + "part-of-speech": "Unknown", + "pitch-accents": "No pitch accent data", + "pitch-accent-graphs": "No pitch accent data", + "pitch-accent-positions": "No pitch accent data", + "phonetic-transcriptions": "", + "reading": "さんきゅう", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefix39cloze-suffix", + "sentence-furigana": "cloze-prefix39cloze-suffix", + "tags": "", + "url": "url:" + } + ] + }, + { + "name": "Test text transformations - convertAlphabeticCharacters", + "results": [ + { + "audio": "", + "clipboard-image": "", + "clipboard-text": "", + "cloze-body": "utsu", + "cloze-prefix": "cloze-prefix", + "cloze-suffix": "cloze-suffix", + "conjugation": "", + "dictionary": "Test Dictionary 2", + "document-title": "title", + "expression": "打つ", + "frequencies": "
  • Test Dictionary 2: 2
  • Test Dictionary 2: 6
  • Test Dictionary 2: 10
  • Test Dictionary 2: sixteen
  • Test Dictionary 2: twenty-two (22)
  • Test Dictionary 2: 28
", + "furigana": "つ", + "furigana-plain": "打[う]つ", + "glossary": "
(vt, Test Dictionary 2)
  • utsu definition 1
  • utsu definition 2
", + "glossary-brief": "
  • utsu definition 1
  • utsu definition 2
", + "glossary-no-dictionary": "
(vt)
  • utsu definition 1
  • utsu definition 2
", + "part-of-speech": "Godan verb", + "pitch-accents": "No pitch accent data", + "pitch-accent-graphs": "No pitch accent data", + "pitch-accent-positions": "No pitch accent data", + "phonetic-transcriptions": "", + "reading": "うつ", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefixutsucloze-suffix", + "sentence-furigana": "cloze-prefixutsucloze-suffix", + "tags": "vt", + "url": "url:" + }, + { + "audio": "", + "clipboard-image": "", + "clipboard-text": "", + "cloze-body": "utsu", + "cloze-prefix": "cloze-prefix", + "cloze-suffix": "cloze-suffix", + "conjugation": "", + "dictionary": "Test Dictionary 2", + "document-title": "title", + "expression": "打つ", + "frequencies": "
  • Test Dictionary 2: 2
  • Test Dictionary 2: 6
  • Test Dictionary 2: 10
  • Test Dictionary 2: sixteen
  • Test Dictionary 2: twenty-two (22)
  • Test Dictionary 2: 28
", + "furigana": "つ", + "furigana-plain": "打[う]つ", + "glossary": "
(vt, Test Dictionary 2)
  • utsu definition 3
  • utsu definition 4
", + "glossary-brief": "
  • utsu definition 3
  • utsu definition 4
", + "glossary-no-dictionary": "
(vt)
  • utsu definition 3
  • utsu definition 4
", + "part-of-speech": "Godan verb", + "pitch-accents": "No pitch accent data", + "pitch-accent-graphs": "No pitch accent data", + "pitch-accent-positions": "No pitch accent data", + "phonetic-transcriptions": "", + "reading": "うつ", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefixutsucloze-suffix", + "sentence-furigana": "cloze-prefixutsucloze-suffix", + "tags": "vt", + "url": "url:" + } + ] + }, + { + "name": "Test text transformations - convertKatakanaToHiragana", + "results": [ + { + "audio": "", + "clipboard-image": "", + "clipboard-text": "", + "cloze-body": "ウツ", + "cloze-prefix": "cloze-prefix", + "cloze-suffix": "cloze-suffix", + "conjugation": "", + "dictionary": "Test Dictionary 2", + "document-title": "title", + "expression": "打つ", + "frequencies": "
  • Test Dictionary 2: 2
  • Test Dictionary 2: 6
  • Test Dictionary 2: 10
  • Test Dictionary 2: sixteen
  • Test Dictionary 2: twenty-two (22)
  • Test Dictionary 2: 28
", + "furigana": "つ", + "furigana-plain": "打[う]つ", + "glossary": "
(vt, Test Dictionary 2)
  • utsu definition 1
  • utsu definition 2
", + "glossary-brief": "
  • utsu definition 1
  • utsu definition 2
", + "glossary-no-dictionary": "
(vt)
  • utsu definition 1
  • utsu definition 2
", + "part-of-speech": "Godan verb", + "pitch-accents": "No pitch accent data", + "pitch-accent-graphs": "No pitch accent data", + "pitch-accent-positions": "No pitch accent data", + "phonetic-transcriptions": "", + "reading": "うつ", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefixウツcloze-suffix", + "sentence-furigana": "cloze-prefixウツcloze-suffix", + "tags": "vt", + "url": "url:" + }, + { + "audio": "", + "clipboard-image": "", + "clipboard-text": "", + "cloze-body": "ウツ", + "cloze-prefix": "cloze-prefix", + "cloze-suffix": "cloze-suffix", + "conjugation": "", + "dictionary": "Test Dictionary 2", + "document-title": "title", + "expression": "打つ", + "frequencies": "
  • Test Dictionary 2: 2
  • Test Dictionary 2: 6
  • Test Dictionary 2: 10
  • Test Dictionary 2: sixteen
  • Test Dictionary 2: twenty-two (22)
  • Test Dictionary 2: 28
", + "furigana": "つ", + "furigana-plain": "打[う]つ", + "glossary": "
(vt, Test Dictionary 2)
  • utsu definition 3
  • utsu definition 4
", + "glossary-brief": "
  • utsu definition 3
  • utsu definition 4
", + "glossary-no-dictionary": "
(vt)
  • utsu definition 3
  • utsu definition 4
", + "part-of-speech": "Godan verb", + "pitch-accents": "No pitch accent data", + "pitch-accent-graphs": "No pitch accent data", + "pitch-accent-positions": "No pitch accent data", + "phonetic-transcriptions": "", + "reading": "うつ", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefixウツcloze-suffix", + "sentence-furigana": "cloze-prefixウツcloze-suffix", + "tags": "vt", + "url": "url:" + } + ] + }, + { + "name": "Test text transformations - convertHiraganaToKatakana", + "results": [ + { + "audio": "", + "clipboard-image": "", + "clipboard-text": "", + "cloze-body": "てきすと", + "cloze-prefix": "cloze-prefix", + "cloze-suffix": "cloze-suffix", + "conjugation": "", + "dictionary": "Test Dictionary 2", + "document-title": "title", + "expression": "テキスト", + "frequencies": "", + "furigana": "テキスト", + "furigana-plain": "テキスト", + "glossary": "
(n, Test Dictionary 2)
  • text definition 1
  • text definition 2
", + "glossary-brief": "
  • text definition 1
  • text definition 2
", + "glossary-no-dictionary": "
(n)
  • text definition 1
  • text definition 2
", + "part-of-speech": "Noun", + "pitch-accents": "No pitch accent data", + "pitch-accent-graphs": "No pitch accent data", + "pitch-accent-positions": "No pitch accent data", + "phonetic-transcriptions": "", + "reading": "テキスト", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefixてきすとcloze-suffix", + "sentence-furigana": "cloze-prefixてきすとcloze-suffix", + "tags": "n", + "url": "url:" + } + ] + }, + { + "name": "Test text transformations - convertHalfWidthCharacters, convertKatakanaToHiragana", + "results": [ + { + "audio": "", + "clipboard-image": "", + "clipboard-text": "", + "cloze-body": "ウツ", + "cloze-prefix": "cloze-prefix", + "cloze-suffix": "cloze-suffix", + "conjugation": "", + "dictionary": "Test Dictionary 2", + "document-title": "title", + "expression": "打つ", + "frequencies": "
  • Test Dictionary 2: 2
  • Test Dictionary 2: 6
  • Test Dictionary 2: 10
  • Test Dictionary 2: sixteen
  • Test Dictionary 2: twenty-two (22)
  • Test Dictionary 2: 28
", + "furigana": "つ", + "furigana-plain": "打[う]つ", + "glossary": "
(vt, Test Dictionary 2)
  • utsu definition 1
  • utsu definition 2
", + "glossary-brief": "
  • utsu definition 1
  • utsu definition 2
", + "glossary-no-dictionary": "
(vt)
  • utsu definition 1
  • utsu definition 2
", + "part-of-speech": "Godan verb", + "pitch-accents": "No pitch accent data", + "pitch-accent-graphs": "No pitch accent data", + "pitch-accent-positions": "No pitch accent data", + "phonetic-transcriptions": "", + "reading": "うつ", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefixウツcloze-suffix", + "sentence-furigana": "cloze-prefixウツcloze-suffix", + "tags": "vt", + "url": "url:" + }, + { + "audio": "", + "clipboard-image": "", + "clipboard-text": "", + "cloze-body": "ウツ", + "cloze-prefix": "cloze-prefix", + "cloze-suffix": "cloze-suffix", + "conjugation": "", + "dictionary": "Test Dictionary 2", + "document-title": "title", + "expression": "打つ", + "frequencies": "
  • Test Dictionary 2: 2
  • Test Dictionary 2: 6
  • Test Dictionary 2: 10
  • Test Dictionary 2: sixteen
  • Test Dictionary 2: twenty-two (22)
  • Test Dictionary 2: 28
", + "furigana": "つ", + "furigana-plain": "打[う]つ", + "glossary": "
(vt, Test Dictionary 2)
  • utsu definition 3
  • utsu definition 4
", + "glossary-brief": "
  • utsu definition 3
  • utsu definition 4
", + "glossary-no-dictionary": "
(vt)
  • utsu definition 3
  • utsu definition 4
", + "part-of-speech": "Godan verb", + "pitch-accents": "No pitch accent data", + "pitch-accent-graphs": "No pitch accent data", + "pitch-accent-positions": "No pitch accent data", + "phonetic-transcriptions": "", + "reading": "うつ", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefixウツcloze-suffix", + "sentence-furigana": "cloze-prefixウツcloze-suffix", + "tags": "vt", + "url": "url:" + } + ] + }, + { + "name": "Test text transformations - collapseEmphaticSequences", + "results": [ + { + "audio": "", + "clipboard-image": "", + "clipboard-text": "", + "cloze-body": "すっっごーーい", + "cloze-prefix": "cloze-prefix", + "cloze-suffix": "cloze-suffix", + "conjugation": "", + "dictionary": "Test Dictionary 2", + "document-title": "title", + "expression": "凄い", + "frequencies": "", + "furigana": "すごい", + "furigana-plain": "凄[すご]い", + "glossary": "
(adj-i, Test Dictionary 2) sugoi definition
", + "glossary-brief": "
sugoi definition
", + "glossary-no-dictionary": "
(adj-i) sugoi definition
", + "part-of-speech": "I-adjective", + "pitch-accents": "No pitch accent data", + "pitch-accent-graphs": "No pitch accent data", + "pitch-accent-positions": "No pitch accent data", + "phonetic-transcriptions": "", + "reading": "すごい", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefixすっっごーーいcloze-suffix", + "sentence-furigana": "cloze-prefixすっっごーーいcloze-suffix", + "tags": "adj-i", + "url": "url:" + } + ] } ] \ No newline at end of file -- cgit v1.2.3