From 40cdb4feb534174b78fb5f2ac612748ce9b5a9a4 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 18 Jul 2021 15:52:40 -0400 Subject: Update valid-dictionary1 data (#1841) * Add example definitions for pronunciation metadata * Update counts * Update tests --- test/data/anki-note-builder-test-results.json | 175 ++++ .../valid-dictionary1/term_bank_1.json | 7 +- test/data/translator-test-inputs.json | 35 + test/data/translator-test-results-note-data1.json | 926 +++++++++++++++++++++ test/data/translator-test-results.json | 502 +++++++++++ test/test-database.js | 4 +- 6 files changed, 1646 insertions(+), 3 deletions(-) diff --git a/test/data/anki-note-builder-test-results.json b/test/data/anki-note-builder-test-results.json index c10e28a8..00e7965b 100644 --- a/test/data/anki-note-builder-test-results.json +++ b/test/data/anki-note-builder-test-results.json @@ -2536,5 +2536,180 @@ "url": "url:" } ] + }, + { + "name": "Test pronunciations 1", + "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) otemae definition
", + "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]
", + "reading": "おてまえ", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefixお手前cloze-suffix", + "sentence-furigana": "cloze-prefixお手前cloze-suffix", + "tags": "n", + "url": "url:" + } + ] + }, + { + "name": "Test pronunciations 2", + "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) bangou definition
", + "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]", + "reading": "ばんごう", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefix番号cloze-suffix", + "sentence-furigana": "cloze-prefix番号cloze-suffix", + "tags": "n", + "url": "url:" + } + ] + }, + { + "name": "Test pronunciations 3", + "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) chuugoshi definition
", + "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]", + "reading": "ちゅうごし", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefix中腰cloze-suffix", + "sentence-furigana": "cloze-prefix中腰cloze-suffix", + "tags": "n", + "url": "url:" + } + ] + }, + { + "name": "Test pronunciations 4", + "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) shogyouu definition
", + "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]", + "reading": "しょぎょう", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefix所業cloze-suffix", + "sentence-furigana": "cloze-prefix所業cloze-suffix", + "tags": "n", + "url": "url:" + } + ] + }, + { + "name": "Test pronunciations 5", + "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) dobokukouji definition
", + "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]", + "reading": "どぼくこうじ", + "screenshot": "", + "search-query": "fullQuery", + "selection-text": "", + "sentence": "cloze-prefix土木工事cloze-suffix", + "sentence-furigana": "cloze-prefix土木工事cloze-suffix", + "tags": "n", + "url": "url:" + } + ] } ] \ No newline at end of file diff --git a/test/data/dictionaries/valid-dictionary1/term_bank_1.json b/test/data/dictionaries/valid-dictionary1/term_bank_1.json index c58a17bf..1d75f597 100644 --- a/test/data/dictionaries/valid-dictionary1/term_bank_1.json +++ b/test/data/dictionaries/valid-dictionary1/term_bank_1.json @@ -13,6 +13,11 @@ ["読む", "よむ", "vt", "v5", 100, ["to read"], 6, "P E1"], ["強み", "つよみ", "n", "n", 90, ["strong point"], 7, "P E1"], ["テキスト", "テキスト", "n", "n", 1, ["text definition 1", {"type": "text", "text": "text definition 2"}], 8, "P E1"], + ["お手前", "おてまえ", "n", "n", 1, ["otemae definition"], 9, ""], + ["番号", "ばんごう", "n", "n", 1, ["bangou definition"], 10, ""], + ["中腰", "ちゅうごし", "n", "n", 1, ["chuugoshi definition"], 11, ""], + ["所業", "しょぎょう", "n", "n", 1, ["shogyouu definition"], 12, ""], + ["土木工事", "どぼくこうじ", "n", "n", 1, ["dobokukouji definition"], 13, ""], [ "内容", "ないよう", "n", "n", 35, [ @@ -134,6 +139,6 @@ ]} ]} ], - 9, "P E1" + 100, "P E1" ] ] \ No newline at end of file diff --git a/test/data/translator-test-inputs.json b/test/data/translator-test-inputs.json index 5c47395c..a044d226 100644 --- a/test/data/translator-test-inputs.json +++ b/test/data/translator-test-inputs.json @@ -290,6 +290,41 @@ "mode": "merge", "text": "うちこむ", "options": "default" + }, + { + "name": "Test pronunciations 1", + "func": "findTerms", + "mode": "split", + "text": "お手前", + "options": "default" + }, + { + "name": "Test pronunciations 2", + "func": "findTerms", + "mode": "split", + "text": "番号", + "options": "default" + }, + { + "name": "Test pronunciations 3", + "func": "findTerms", + "mode": "split", + "text": "中腰", + "options": "default" + }, + { + "name": "Test pronunciations 4", + "func": "findTerms", + "mode": "split", + "text": "所業", + "options": "default" + }, + { + "name": "Test pronunciations 5", + "func": "findTerms", + "mode": "split", + "text": "土木工事", + "options": "default" } ] } \ No newline at end of file diff --git a/test/data/translator-test-results-note-data1.json b/test/data/translator-test-results-note-data1.json index 0b54b0ec..d679287b 100644 --- a/test/data/translator-test-results-note-data1.json +++ b/test/data/translator-test-results-note-data1.json @@ -18541,5 +18541,931 @@ "media": {} } ] + }, + { + "name": "Test pronunciations 1", + "noteDataList": [ + { + "marker": "{marker}", + "definition": { + "type": "term", + "id": 15, + "source": "お手前", + "rawSource": "お手前", + "sourceTerm": "お手前", + "reasons": [], + "score": 1, + "isPrimary": true, + "sequence": 9, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "dictionaryNames": [ + "Test Dictionary 2" + ], + "expression": "お手前", + "reading": "おてまえ", + "expressions": [ + { + "sourceTerm": "お手前", + "expression": "お手前", + "reading": "おてまえ", + "termTags": [], + "frequencies": [], + "pitches": [ + { + "index": 0, + "expressionIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "expression": "お手前", + "reading": "おてまえ", + "pitches": [ + { + "position": 2, + "tags": [ + { + "name": "P1", + "category": "default", + "notes": "example pitch tag 1", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ] + }, + { + "position": 2, + "tags": [ + { + "name": "P2", + "category": "default", + "notes": "example pitch tag 2", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ] + }, + { + "position": 0, + "tags": [ + { + "name": "P2", + "category": "default", + "notes": "example pitch tag 2", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ] + } + ] + } + ], + "furiganaSegments": [ + { + "text": "お", + "furigana": "" + }, + { + "text": "手前", + "furigana": "てまえ" + } + ], + "termFrequency": "normal", + "wordClasses": [ + "n" + ] + } + ], + "glossary": [ + "otemae definition" + ], + "definitionTags": [ + { + "name": "n", + "category": "partOfSpeech", + "notes": "noun", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ], + "termTags": [], + "frequencies": [], + "pitches": [ + { + "index": 0, + "expressionIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "expression": "お手前", + "reading": "おてまえ", + "pitches": [ + { + "position": 2, + "tags": [ + { + "name": "P1", + "category": "default", + "notes": "example pitch tag 1", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ] + }, + { + "position": 2, + "tags": [ + { + "name": "P2", + "category": "default", + "notes": "example pitch tag 2", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ] + }, + { + "position": 0, + "tags": [ + { + "name": "P2", + "category": "default", + "notes": "example pitch tag 2", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ] + } + ] + } + ], + "sourceTermExactMatchCount": 1, + "url": "url:", + "cloze": { + "sentence": "", + "prefix": "", + "body": "", + "suffix": "" + }, + "furiganaSegments": [ + { + "text": "お", + "furigana": "" + }, + { + "text": "手前", + "furigana": "てまえ" + } + ] + }, + "glossaryLayoutMode": "default", + "compactTags": false, + "group": false, + "merge": false, + "modeTermKanji": false, + "modeTermKana": false, + "modeKanji": false, + "compactGlossaries": false, + "uniqueExpressions": [ + "お手前" + ], + "uniqueReadings": [ + "おてまえ" + ], + "pitches": [ + { + "dictionary": "Test Dictionary 2", + "pitches": [ + { + "expressions": [ + "お手前" + ], + "reading": "おてまえ", + "position": 2, + "tags": [ + { + "name": "P1", + "category": "default", + "order": 0, + "score": 0, + "content": [ + "example pitch tag 1" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ], + "exclusiveExpressions": [], + "exclusiveReadings": [] + }, + { + "expressions": [ + "お手前" + ], + "reading": "おてまえ", + "position": 2, + "tags": [ + { + "name": "P2", + "category": "default", + "order": 0, + "score": 0, + "content": [ + "example pitch tag 2" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ], + "exclusiveExpressions": [], + "exclusiveReadings": [] + }, + { + "expressions": [ + "お手前" + ], + "reading": "おてまえ", + "position": 0, + "tags": [ + { + "name": "P2", + "category": "default", + "order": 0, + "score": 0, + "content": [ + "example pitch tag 2" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ], + "exclusiveExpressions": [], + "exclusiveReadings": [] + } + ] + } + ], + "pitchCount": 3, + "context": { + "query": "query", + "fullQuery": "fullQuery", + "document": { + "title": "title" + } + }, + "media": {} + } + ] + }, + { + "name": "Test pronunciations 2", + "noteDataList": [ + { + "marker": "{marker}", + "definition": { + "type": "term", + "id": 16, + "source": "番号", + "rawSource": "番号", + "sourceTerm": "番号", + "reasons": [], + "score": 1, + "isPrimary": true, + "sequence": 10, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "dictionaryNames": [ + "Test Dictionary 2" + ], + "expression": "番号", + "reading": "ばんごう", + "expressions": [ + { + "sourceTerm": "番号", + "expression": "番号", + "reading": "ばんごう", + "termTags": [], + "frequencies": [], + "pitches": [ + { + "index": 0, + "expressionIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "expression": "番号", + "reading": "ばんごう", + "pitches": [ + { + "position": 3, + "tags": [] + } + ] + } + ], + "furiganaSegments": [ + { + "text": "番号", + "furigana": "ばんごう" + } + ], + "termFrequency": "normal", + "wordClasses": [ + "n" + ] + } + ], + "glossary": [ + "bangou definition" + ], + "definitionTags": [ + { + "name": "n", + "category": "partOfSpeech", + "notes": "noun", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ], + "termTags": [], + "frequencies": [], + "pitches": [ + { + "index": 0, + "expressionIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "expression": "番号", + "reading": "ばんごう", + "pitches": [ + { + "position": 3, + "tags": [] + } + ] + } + ], + "sourceTermExactMatchCount": 1, + "url": "url:", + "cloze": { + "sentence": "", + "prefix": "", + "body": "", + "suffix": "" + }, + "furiganaSegments": [ + { + "text": "番号", + "furigana": "ばんごう" + } + ] + }, + "glossaryLayoutMode": "default", + "compactTags": false, + "group": false, + "merge": false, + "modeTermKanji": false, + "modeTermKana": false, + "modeKanji": false, + "compactGlossaries": false, + "uniqueExpressions": [ + "番号" + ], + "uniqueReadings": [ + "ばんごう" + ], + "pitches": [ + { + "dictionary": "Test Dictionary 2", + "pitches": [ + { + "expressions": [ + "番号" + ], + "reading": "ばんごう", + "position": 3, + "tags": [], + "exclusiveExpressions": [], + "exclusiveReadings": [] + } + ] + } + ], + "pitchCount": 1, + "context": { + "query": "query", + "fullQuery": "fullQuery", + "document": { + "title": "title" + } + }, + "media": {} + } + ] + }, + { + "name": "Test pronunciations 3", + "noteDataList": [ + { + "marker": "{marker}", + "definition": { + "type": "term", + "id": 17, + "source": "中腰", + "rawSource": "中腰", + "sourceTerm": "中腰", + "reasons": [], + "score": 1, + "isPrimary": true, + "sequence": 11, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "dictionaryNames": [ + "Test Dictionary 2" + ], + "expression": "中腰", + "reading": "ちゅうごし", + "expressions": [ + { + "sourceTerm": "中腰", + "expression": "中腰", + "reading": "ちゅうごし", + "termTags": [], + "frequencies": [], + "pitches": [ + { + "index": 0, + "expressionIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "expression": "中腰", + "reading": "ちゅうごし", + "pitches": [ + { + "position": 0, + "tags": [] + } + ] + } + ], + "furiganaSegments": [ + { + "text": "中腰", + "furigana": "ちゅうごし" + } + ], + "termFrequency": "normal", + "wordClasses": [ + "n" + ] + } + ], + "glossary": [ + "chuugoshi definition" + ], + "definitionTags": [ + { + "name": "n", + "category": "partOfSpeech", + "notes": "noun", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ], + "termTags": [], + "frequencies": [], + "pitches": [ + { + "index": 0, + "expressionIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "expression": "中腰", + "reading": "ちゅうごし", + "pitches": [ + { + "position": 0, + "tags": [] + } + ] + } + ], + "sourceTermExactMatchCount": 1, + "url": "url:", + "cloze": { + "sentence": "", + "prefix": "", + "body": "", + "suffix": "" + }, + "furiganaSegments": [ + { + "text": "中腰", + "furigana": "ちゅうごし" + } + ] + }, + "glossaryLayoutMode": "default", + "compactTags": false, + "group": false, + "merge": false, + "modeTermKanji": false, + "modeTermKana": false, + "modeKanji": false, + "compactGlossaries": false, + "uniqueExpressions": [ + "中腰" + ], + "uniqueReadings": [ + "ちゅうごし" + ], + "pitches": [ + { + "dictionary": "Test Dictionary 2", + "pitches": [ + { + "expressions": [ + "中腰" + ], + "reading": "ちゅうごし", + "position": 0, + "tags": [], + "exclusiveExpressions": [], + "exclusiveReadings": [] + } + ] + } + ], + "pitchCount": 1, + "context": { + "query": "query", + "fullQuery": "fullQuery", + "document": { + "title": "title" + } + }, + "media": {} + } + ] + }, + { + "name": "Test pronunciations 4", + "noteDataList": [ + { + "marker": "{marker}", + "definition": { + "type": "term", + "id": 18, + "source": "所業", + "rawSource": "所業", + "sourceTerm": "所業", + "reasons": [], + "score": 1, + "isPrimary": true, + "sequence": 12, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "dictionaryNames": [ + "Test Dictionary 2" + ], + "expression": "所業", + "reading": "しょぎょう", + "expressions": [ + { + "sourceTerm": "所業", + "expression": "所業", + "reading": "しょぎょう", + "termTags": [], + "frequencies": [], + "pitches": [ + { + "index": 0, + "expressionIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "expression": "所業", + "reading": "しょぎょう", + "pitches": [ + { + "position": 0, + "tags": [] + } + ] + } + ], + "furiganaSegments": [ + { + "text": "所業", + "furigana": "しょぎょう" + } + ], + "termFrequency": "normal", + "wordClasses": [ + "n" + ] + } + ], + "glossary": [ + "shogyouu definition" + ], + "definitionTags": [ + { + "name": "n", + "category": "partOfSpeech", + "notes": "noun", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ], + "termTags": [], + "frequencies": [], + "pitches": [ + { + "index": 0, + "expressionIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "expression": "所業", + "reading": "しょぎょう", + "pitches": [ + { + "position": 0, + "tags": [] + } + ] + } + ], + "sourceTermExactMatchCount": 1, + "url": "url:", + "cloze": { + "sentence": "", + "prefix": "", + "body": "", + "suffix": "" + }, + "furiganaSegments": [ + { + "text": "所業", + "furigana": "しょぎょう" + } + ] + }, + "glossaryLayoutMode": "default", + "compactTags": false, + "group": false, + "merge": false, + "modeTermKanji": false, + "modeTermKana": false, + "modeKanji": false, + "compactGlossaries": false, + "uniqueExpressions": [ + "所業" + ], + "uniqueReadings": [ + "しょぎょう" + ], + "pitches": [ + { + "dictionary": "Test Dictionary 2", + "pitches": [ + { + "expressions": [ + "所業" + ], + "reading": "しょぎょう", + "position": 0, + "tags": [], + "exclusiveExpressions": [], + "exclusiveReadings": [] + } + ] + } + ], + "pitchCount": 1, + "context": { + "query": "query", + "fullQuery": "fullQuery", + "document": { + "title": "title" + } + }, + "media": {} + } + ] + }, + { + "name": "Test pronunciations 5", + "noteDataList": [ + { + "marker": "{marker}", + "definition": { + "type": "term", + "id": 19, + "source": "土木工事", + "rawSource": "土木工事", + "sourceTerm": "土木工事", + "reasons": [], + "score": 1, + "isPrimary": true, + "sequence": 13, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "dictionaryNames": [ + "Test Dictionary 2" + ], + "expression": "土木工事", + "reading": "どぼくこうじ", + "expressions": [ + { + "sourceTerm": "土木工事", + "expression": "土木工事", + "reading": "どぼくこうじ", + "termTags": [], + "frequencies": [], + "pitches": [ + { + "index": 0, + "expressionIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "expression": "土木工事", + "reading": "どぼくこうじ", + "pitches": [ + { + "position": 4, + "tags": [] + } + ] + } + ], + "furiganaSegments": [ + { + "text": "土木工事", + "furigana": "どぼくこうじ" + } + ], + "termFrequency": "normal", + "wordClasses": [ + "n" + ] + } + ], + "glossary": [ + "dobokukouji definition" + ], + "definitionTags": [ + { + "name": "n", + "category": "partOfSpeech", + "notes": "noun", + "order": 0, + "score": 0, + "dictionary": "Test Dictionary 2", + "redundant": false + } + ], + "termTags": [], + "frequencies": [], + "pitches": [ + { + "index": 0, + "expressionIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryOrder": { + "index": 0, + "priority": 0 + }, + "expression": "土木工事", + "reading": "どぼくこうじ", + "pitches": [ + { + "position": 4, + "tags": [] + } + ] + } + ], + "sourceTermExactMatchCount": 1, + "url": "url:", + "cloze": { + "sentence": "", + "prefix": "", + "body": "", + "suffix": "" + }, + "furiganaSegments": [ + { + "text": "土木工事", + "furigana": "どぼくこうじ" + } + ] + }, + "glossaryLayoutMode": "default", + "compactTags": false, + "group": false, + "merge": false, + "modeTermKanji": false, + "modeTermKana": false, + "modeKanji": false, + "compactGlossaries": false, + "uniqueExpressions": [ + "土木工事" + ], + "uniqueReadings": [ + "どぼくこうじ" + ], + "pitches": [ + { + "dictionary": "Test Dictionary 2", + "pitches": [ + { + "expressions": [ + "土木工事" + ], + "reading": "どぼくこうじ", + "position": 4, + "tags": [], + "exclusiveExpressions": [], + "exclusiveReadings": [] + } + ] + } + ], + "pitchCount": 1, + "context": { + "query": "query", + "fullQuery": "fullQuery", + "document": { + "title": "title" + } + }, + "media": {} + } + ] } ] \ No newline at end of file diff --git a/test/data/translator-test-results.json b/test/data/translator-test-results.json index 3ef1999f..0ba82690 100644 --- a/test/data/translator-test-results.json +++ b/test/data/translator-test-results.json @@ -11229,5 +11229,507 @@ ] } ] + }, + { + "name": "Test pronunciations 1", + "originalTextLength": 3, + "dictionaryEntries": [ + { + "type": "term", + "isPrimary": true, + "inflections": [], + "score": 1, + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "sourceTermExactMatchCount": 1, + "maxTransformedTextLength": 3, + "headwords": [ + { + "index": 0, + "term": "お手前", + "reading": "おてまえ", + "sources": [ + { + "originalText": "お手前", + "transformedText": "お手前", + "deinflectedText": "お手前", + "isPrimary": true + } + ], + "tags": [], + "wordClasses": [ + "n" + ] + } + ], + "definitions": [ + { + "index": 0, + "headwordIndices": [ + 0 + ], + "dictionary": "Test Dictionary 2", + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "id": 15, + "score": 1, + "sequences": [ + 9 + ], + "isPrimary": true, + "tags": [ + { + "name": "n", + "category": "partOfSpeech", + "order": 0, + "score": 0, + "content": [ + "noun" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ], + "entries": [ + "otemae definition" + ] + } + ], + "pronunciations": [ + { + "index": 0, + "headwordIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "pitches": [ + { + "position": 2, + "nasalPositions": [], + "devoicePositions": [], + "tags": [ + { + "name": "P1", + "category": "default", + "order": 0, + "score": 0, + "content": [ + "example pitch tag 1" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ] + }, + { + "position": 2, + "nasalPositions": [], + "devoicePositions": [], + "tags": [ + { + "name": "P2", + "category": "default", + "order": 0, + "score": 0, + "content": [ + "example pitch tag 2" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ] + }, + { + "position": 0, + "nasalPositions": [], + "devoicePositions": [], + "tags": [ + { + "name": "P2", + "category": "default", + "order": 0, + "score": 0, + "content": [ + "example pitch tag 2" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ] + } + ] + } + ], + "frequencies": [] + } + ] + }, + { + "name": "Test pronunciations 2", + "originalTextLength": 2, + "dictionaryEntries": [ + { + "type": "term", + "isPrimary": true, + "inflections": [], + "score": 1, + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "sourceTermExactMatchCount": 1, + "maxTransformedTextLength": 2, + "headwords": [ + { + "index": 0, + "term": "番号", + "reading": "ばんごう", + "sources": [ + { + "originalText": "番号", + "transformedText": "番号", + "deinflectedText": "番号", + "isPrimary": true + } + ], + "tags": [], + "wordClasses": [ + "n" + ] + } + ], + "definitions": [ + { + "index": 0, + "headwordIndices": [ + 0 + ], + "dictionary": "Test Dictionary 2", + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "id": 16, + "score": 1, + "sequences": [ + 10 + ], + "isPrimary": true, + "tags": [ + { + "name": "n", + "category": "partOfSpeech", + "order": 0, + "score": 0, + "content": [ + "noun" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ], + "entries": [ + "bangou definition" + ] + } + ], + "pronunciations": [ + { + "index": 0, + "headwordIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "pitches": [ + { + "position": 3, + "nasalPositions": [ + 3 + ], + "devoicePositions": [], + "tags": [] + } + ] + } + ], + "frequencies": [] + } + ] + }, + { + "name": "Test pronunciations 3", + "originalTextLength": 2, + "dictionaryEntries": [ + { + "type": "term", + "isPrimary": true, + "inflections": [], + "score": 1, + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "sourceTermExactMatchCount": 1, + "maxTransformedTextLength": 2, + "headwords": [ + { + "index": 0, + "term": "中腰", + "reading": "ちゅうごし", + "sources": [ + { + "originalText": "中腰", + "transformedText": "中腰", + "deinflectedText": "中腰", + "isPrimary": true + } + ], + "tags": [], + "wordClasses": [ + "n" + ] + } + ], + "definitions": [ + { + "index": 0, + "headwordIndices": [ + 0 + ], + "dictionary": "Test Dictionary 2", + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "id": 17, + "score": 1, + "sequences": [ + 11 + ], + "isPrimary": true, + "tags": [ + { + "name": "n", + "category": "partOfSpeech", + "order": 0, + "score": 0, + "content": [ + "noun" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ], + "entries": [ + "chuugoshi definition" + ] + } + ], + "pronunciations": [ + { + "index": 0, + "headwordIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "pitches": [ + { + "position": 0, + "nasalPositions": [ + 3 + ], + "devoicePositions": [], + "tags": [] + } + ] + } + ], + "frequencies": [] + } + ] + }, + { + "name": "Test pronunciations 4", + "originalTextLength": 2, + "dictionaryEntries": [ + { + "type": "term", + "isPrimary": true, + "inflections": [], + "score": 1, + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "sourceTermExactMatchCount": 1, + "maxTransformedTextLength": 2, + "headwords": [ + { + "index": 0, + "term": "所業", + "reading": "しょぎょう", + "sources": [ + { + "originalText": "所業", + "transformedText": "所業", + "deinflectedText": "所業", + "isPrimary": true + } + ], + "tags": [], + "wordClasses": [ + "n" + ] + } + ], + "definitions": [ + { + "index": 0, + "headwordIndices": [ + 0 + ], + "dictionary": "Test Dictionary 2", + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "id": 18, + "score": 1, + "sequences": [ + 12 + ], + "isPrimary": true, + "tags": [ + { + "name": "n", + "category": "partOfSpeech", + "order": 0, + "score": 0, + "content": [ + "noun" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ], + "entries": [ + "shogyouu definition" + ] + } + ], + "pronunciations": [ + { + "index": 0, + "headwordIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "pitches": [ + { + "position": 0, + "nasalPositions": [ + 2 + ], + "devoicePositions": [], + "tags": [] + } + ] + } + ], + "frequencies": [] + } + ] + }, + { + "name": "Test pronunciations 5", + "originalTextLength": 4, + "dictionaryEntries": [ + { + "type": "term", + "isPrimary": true, + "inflections": [], + "score": 1, + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "sourceTermExactMatchCount": 1, + "maxTransformedTextLength": 4, + "headwords": [ + { + "index": 0, + "term": "土木工事", + "reading": "どぼくこうじ", + "sources": [ + { + "originalText": "土木工事", + "transformedText": "土木工事", + "deinflectedText": "土木工事", + "isPrimary": true + } + ], + "tags": [], + "wordClasses": [ + "n" + ] + } + ], + "definitions": [ + { + "index": 0, + "headwordIndices": [ + 0 + ], + "dictionary": "Test Dictionary 2", + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "id": 19, + "score": 1, + "sequences": [ + 13 + ], + "isPrimary": true, + "tags": [ + { + "name": "n", + "category": "partOfSpeech", + "order": 0, + "score": 0, + "content": [ + "noun" + ], + "dictionaries": [ + "Test Dictionary 2" + ], + "redundant": false + } + ], + "entries": [ + "dobokukouji definition" + ] + } + ], + "pronunciations": [ + { + "index": 0, + "headwordIndex": 0, + "dictionary": "Test Dictionary 2", + "dictionaryIndex": 0, + "dictionaryPriority": 0, + "pitches": [ + { + "position": 4, + "nasalPositions": [], + "devoicePositions": [ + 3 + ], + "tags": [] + } + ] + } + ], + "frequencies": [] + } + ] } ] \ No newline at end of file diff --git a/test/test-database.js b/test/test-database.js index 6a980042..f8b93505 100644 --- a/test/test-database.js +++ b/test/test-database.js @@ -162,8 +162,8 @@ async function testDatabase1() { true ); vm.assert.deepStrictEqual(counts, { - counts: [{kanji: 2, kanjiMeta: 2, terms: 15, termMeta: 16, tagMeta: 15, media: 2}], - total: {kanji: 2, kanjiMeta: 2, terms: 15, termMeta: 16, tagMeta: 15, media: 2} + counts: [{kanji: 2, kanjiMeta: 2, terms: 20, termMeta: 16, tagMeta: 15, media: 2}], + total: {kanji: 2, kanjiMeta: 2, terms: 20, termMeta: 16, tagMeta: 15, media: 2} }); // Test find* functions -- cgit v1.2.3