From 0c43e10320acada4c62cc96c912f294eff565fd2 Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Sat, 20 Jan 2024 17:05:47 +0100 Subject: [PATCH 01/12] fix deinflection bug --- ext/data/deinflect.json | 48 +++++++++++++++++----------------- ext/js/language/deinflector.js | 16 +++++++----- test/deinflector.test.js | 2 +- types/ext/deinflector.d.ts | 2 +- 4 files changed, 35 insertions(+), 33 deletions(-) diff --git a/ext/data/deinflect.json b/ext/data/deinflect.json index 49ad4b72f4..884dbcc12c 100644 --- a/ext/data/deinflect.json +++ b/ext/data/deinflect.json @@ -324,28 +324,28 @@ {"kanaIn": "な", "kanaOut": "", "rulesIn": [], "rulesOut": ["v1", "v5", "vk", "vs", "vz"]} ], "masu stem": [ - {"kanaIn": "い", "kanaOut": "いる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "え", "kanaOut": "える", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "き", "kanaOut": "きる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "ぎ", "kanaOut": "ぎる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "け", "kanaOut": "ける", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "げ", "kanaOut": "げる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "じ", "kanaOut": "じる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "せ", "kanaOut": "せる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "ぜ", "kanaOut": "ぜる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "ち", "kanaOut": "ちる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "て", "kanaOut": "てる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "で", "kanaOut": "でる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "に", "kanaOut": "にる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "ね", "kanaOut": "ねる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "ひ", "kanaOut": "ひる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "び", "kanaOut": "びる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "へ", "kanaOut": "へる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "べ", "kanaOut": "べる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "み", "kanaOut": "みる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "め", "kanaOut": "める", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "り", "kanaOut": "りる", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "れ", "kanaOut": "れる", "rulesIn": [], "rulesOut": ["v1"]}, + {"kanaIn": "い", "kanaOut": "いる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "え", "kanaOut": "える", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "き", "kanaOut": "きる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "ぎ", "kanaOut": "ぎる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "け", "kanaOut": "ける", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "げ", "kanaOut": "げる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "じ", "kanaOut": "じる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "せ", "kanaOut": "せる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "ぜ", "kanaOut": "ぜる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "ち", "kanaOut": "ちる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "て", "kanaOut": "てる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "で", "kanaOut": "でる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "に", "kanaOut": "にる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "ね", "kanaOut": "ねる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "ひ", "kanaOut": "ひる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "び", "kanaOut": "びる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "へ", "kanaOut": "へる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "べ", "kanaOut": "べる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "み", "kanaOut": "みる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "め", "kanaOut": "める", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "り", "kanaOut": "りる", "rulesIn": [], "rulesOut": ["v1d"]}, + {"kanaIn": "れ", "kanaOut": "れる", "rulesIn": [], "rulesOut": ["v1d"]}, {"kanaIn": "い", "kanaOut": "う", "rulesIn": [], "rulesOut": ["v5"]}, {"kanaIn": "き", "kanaOut": "く", "rulesIn": [], "rulesOut": ["v5"]}, {"kanaIn": "ぎ", "kanaOut": "ぐ", "rulesIn": [], "rulesOut": ["v5"]}, @@ -603,10 +603,10 @@ "progressive or perfect": [ {"kanaIn": "ている", "kanaOut": "て", "rulesIn": ["v1"], "rulesOut": ["iru"]}, {"kanaIn": "ておる", "kanaOut": "て", "rulesIn": ["v5"], "rulesOut": ["iru"]}, - {"kanaIn": "てる", "kanaOut": "て", "rulesIn": ["v1"], "rulesOut": ["iru"]}, + {"kanaIn": "てる", "kanaOut": "て", "rulesIn": ["v1p"], "rulesOut": ["iru"]}, {"kanaIn": "でいる", "kanaOut": "で", "rulesIn": ["v1"], "rulesOut": ["iru"]}, {"kanaIn": "でおる", "kanaOut": "で", "rulesIn": ["v5"], "rulesOut": ["iru"]}, - {"kanaIn": "でる", "kanaOut": "で", "rulesIn": ["v1"], "rulesOut": ["iru"]}, + {"kanaIn": "でる", "kanaOut": "で", "rulesIn": ["v1p"], "rulesOut": ["iru"]}, {"kanaIn": "とる", "kanaOut": "て", "rulesIn": ["v5"], "rulesOut": ["iru"]}, {"kanaIn": "ないでいる", "kanaOut": "ない", "rulesIn": ["v1"], "rulesOut": ["adj-i"]} ], diff --git a/ext/js/language/deinflector.js b/ext/js/language/deinflector.js index 7d75576d23..b52b7f5b98 100644 --- a/ext/js/language/deinflector.js +++ b/ext/js/language/deinflector.js @@ -20,13 +20,15 @@ export class Deinflector { /* eslint-disable no-multi-spaces */ /** @type {Map} @readonly */ static _ruleTypes = new Map([ - ['v1', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b00000001)], // Verb ichidan - ['v5', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b00000010)], // Verb godan - ['vs', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b00000100)], // Verb suru - ['vk', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b00001000)], // Verb kuru - ['vz', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b00010000)], // Verb zuru - ['adj-i', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b00100000)], // Adjective i - ['iru', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b01000000)] // Intermediate -iru endings for progressive or perfect tense + ['v1', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000011)], // Verb ichidan + ['v1d', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000010)], // Verb ichidan dictionary form + ['v1p', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000001)], // Verb ichidan progressive or perfect + ['v5', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000100)], // Verb godan + ['vs', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000001000)], // Verb suru + ['vk', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000010000)], // Verb kuru + ['vz', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000100000)], // Verb zuru + ['adj-i', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b001000000)], // Adjective i + ['iru', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b010000000)] // Intermediate -iru endings for progressive or perfect tense ]); /* eslint-enable no-multi-spaces */ diff --git a/test/deinflector.test.js b/test/deinflector.test.js index b00625cfa2..e8b1aa4e94 100644 --- a/test/deinflector.test.js +++ b/test/deinflector.test.js @@ -115,7 +115,7 @@ function testDeinflections() { {term: '食べる', source: '食べたり', rule: 'v1', reasons: ['-tari']}, {term: '食べる', source: '食べず', rule: 'v1', reasons: ['-zu']}, {term: '食べる', source: '食べぬ', rule: 'v1', reasons: ['-nu']}, - {term: '食べる', source: '食べ', rule: 'v1', reasons: ['masu stem']}, + {term: '食べる', source: '食べ', rule: 'v1d', reasons: ['masu stem']}, {term: '食べる', source: '食べましょう', rule: 'v1', reasons: ['polite volitional']}, {term: '食べる', source: '食べよう', rule: 'v1', reasons: ['volitional']}, // ['causative passive'] diff --git a/types/ext/deinflector.d.ts b/types/ext/deinflector.d.ts index 4e5f007b5e..5defbf7959 100644 --- a/types/ext/deinflector.d.ts +++ b/types/ext/deinflector.d.ts @@ -17,7 +17,7 @@ import type * as TranslationInternal from './translation-internal'; -export type ReasonTypeRaw = 'v1' | 'v5' | 'vs' | 'vk' | 'vz' | 'adj-i' | 'iru'; +export type ReasonTypeRaw = 'v1' | 'v1d' | 'v1p' | 'v5' | 'vs' | 'vk' | 'vz' | 'adj-i' | 'iru'; export type ReasonsRaw = { [reason: string]: { From 7e8f6f5f982889faf0b24cf8e485df120ec3d8c1 Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Sat, 20 Jan 2024 20:59:43 +0100 Subject: [PATCH 02/12] add test --- test/deinflector.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/deinflector.test.js b/test/deinflector.test.js index e8b1aa4e94..e90704f10e 100644 --- a/test/deinflector.test.js +++ b/test/deinflector.test.js @@ -31,7 +31,7 @@ const dirname = path.dirname(fileURLToPath(import.meta.url)); * @param {Deinflector} deinflector * @param {string} source * @param {string} expectedTerm - * @param {string} expectedRule + * @param {string|undefined} expectedRule * @param {string[]|undefined} expectedReasons * @returns {{has: false, reasons: null, rules: null}|{has: true, reasons: string[], rules: number}} */ @@ -895,7 +895,9 @@ function testDeinflections() { {term: 'くる', source: 'くさせられない', rule: 'vk'}, {term: 'かわいい', source: 'かわいげ', rule: 'adj-i', reasons: ['-ge']}, - {term: '可愛い', source: 'かわいげ', rule: 'adj-i', reasons: ['-ge']} + {term: '可愛い', source: 'かわいげ', rule: 'adj-i', reasons: ['-ge']}, + + {term: '食べる', source: '食べて', reasons: ['-te', 'progressive or perfect', 'masu stem']} ] }, { From d936ccedfc3faf1a441702e182eac16b1e0a21fa Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Thu, 25 Jan 2024 14:44:33 +0100 Subject: [PATCH 03/12] fix polite te and past --- ext/data/deinflect.json | 50 ++++++------------- ext/js/language/deinflector.js | 1 + test/data/anki-note-builder-test-results.json | 2 +- .../translator-test-results-note-data1.json | 3 +- test/data/translator-test-results.json | 3 +- test/deinflector.test.js | 33 ++++++------ types/ext/deinflector.d.ts | 2 +- 7 files changed, 40 insertions(+), 54 deletions(-) diff --git a/ext/data/deinflect.json b/ext/data/deinflect.json index 884dbcc12c..c8205f4781 100644 --- a/ext/data/deinflect.json +++ b/ext/data/deinflect.json @@ -437,22 +437,22 @@ {"kanaIn": "のたもうた", "kanaOut": "のたまう", "rulesIn": [], "rulesOut": ["v5"]} ], "polite": [ - {"kanaIn": "ます", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "います", "kanaOut": "う", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "きます", "kanaOut": "く", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ぎます", "kanaOut": "ぐ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "します", "kanaOut": "す", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ちます", "kanaOut": "つ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "にます", "kanaOut": "ぬ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "びます", "kanaOut": "ぶ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "みます", "kanaOut": "む", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ります", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "じます", "kanaOut": "ずる", "rulesIn": [], "rulesOut": ["vz"]}, - {"kanaIn": "します", "kanaOut": "する", "rulesIn": [], "rulesOut": ["vs"]}, - {"kanaIn": "為ます", "kanaOut": "為る", "rulesIn": [], "rulesOut": ["vs"]}, - {"kanaIn": "きます", "kanaOut": "くる", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "来ます", "kanaOut": "来る", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "來ます", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]} + {"kanaIn": "ます", "kanaOut": "る", "rulesIn": ["v"], "rulesOut": ["v1"]}, + {"kanaIn": "います", "kanaOut": "う", "rulesIn": ["v"], "rulesOut": ["v5"]}, + {"kanaIn": "きます", "kanaOut": "く", "rulesIn": ["v"], "rulesOut": ["v5"]}, + {"kanaIn": "ぎます", "kanaOut": "ぐ", "rulesIn": ["v"], "rulesOut": ["v5"]}, + {"kanaIn": "します", "kanaOut": "す", "rulesIn": ["v"], "rulesOut": ["v5"]}, + {"kanaIn": "ちます", "kanaOut": "つ", "rulesIn": ["v"], "rulesOut": ["v5"]}, + {"kanaIn": "にます", "kanaOut": "ぬ", "rulesIn": ["v"], "rulesOut": ["v5"]}, + {"kanaIn": "びます", "kanaOut": "ぶ", "rulesIn": ["v"], "rulesOut": ["v5"]}, + {"kanaIn": "みます", "kanaOut": "む", "rulesIn": ["v"], "rulesOut": ["v5"]}, + {"kanaIn": "ります", "kanaOut": "る", "rulesIn": ["v"], "rulesOut": ["v5"]}, + {"kanaIn": "じます", "kanaOut": "ずる", "rulesIn": ["v"], "rulesOut": ["vz"]}, + {"kanaIn": "します", "kanaOut": "する", "rulesIn": ["v"], "rulesOut": ["vs"]}, + {"kanaIn": "為ます", "kanaOut": "為る", "rulesIn": ["v"], "rulesOut": ["vs"]}, + {"kanaIn": "きます", "kanaOut": "くる", "rulesIn": ["v"], "rulesOut": ["vk"]}, + {"kanaIn": "来ます", "kanaOut": "来る", "rulesIn": ["v"], "rulesOut": ["vk"]}, + {"kanaIn": "來ます", "kanaOut": "來る", "rulesIn": ["v"], "rulesOut": ["vk"]} ], "polite negative": [ {"kanaIn": "くありません", "kanaOut": "い", "rulesIn": [], "rulesOut": ["adj-i"]}, @@ -473,24 +473,6 @@ {"kanaIn": "来ません", "kanaOut": "来る", "rulesIn": [], "rulesOut": ["vk"]}, {"kanaIn": "來ません", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]} ], - "polite past": [ - {"kanaIn": "ました", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "いました", "kanaOut": "う", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "きました", "kanaOut": "く", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ぎました", "kanaOut": "ぐ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "しました", "kanaOut": "す", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ちました", "kanaOut": "つ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "にました", "kanaOut": "ぬ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "びました", "kanaOut": "ぶ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "みました", "kanaOut": "む", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "りました", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "じました", "kanaOut": "ずる", "rulesIn": [], "rulesOut": ["vz"]}, - {"kanaIn": "しました", "kanaOut": "する", "rulesIn": [], "rulesOut": ["vs"]}, - {"kanaIn": "為ました", "kanaOut": "為る", "rulesIn": [], "rulesOut": ["vs"]}, - {"kanaIn": "きました", "kanaOut": "くる", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "来ました", "kanaOut": "来る", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "來ました", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]} - ], "polite past negative": [ {"kanaIn": "くありませんでした", "kanaOut": "い", "rulesIn": [], "rulesOut": ["adj-i"]}, {"kanaIn": "ませんでした", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v1"]}, diff --git a/ext/js/language/deinflector.js b/ext/js/language/deinflector.js index b52b7f5b98..0773ff712f 100644 --- a/ext/js/language/deinflector.js +++ b/ext/js/language/deinflector.js @@ -20,6 +20,7 @@ export class Deinflector { /* eslint-disable no-multi-spaces */ /** @type {Map} @readonly */ static _ruleTypes = new Map([ + ['v', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000111)], // Verb ['v1', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000011)], // Verb ichidan ['v1d', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000010)], // Verb ichidan dictionary form ['v1p', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000001)], // Verb ichidan progressive or perfect diff --git a/test/data/anki-note-builder-test-results.json b/test/data/anki-note-builder-test-results.json index 7129d74803..a48012453f 100644 --- a/test/data/anki-note-builder-test-results.json +++ b/test/data/anki-note-builder-test-results.json @@ -2523,7 +2523,7 @@ "cloze-body": "testました", "cloze-prefix": "cloze-prefix", "cloze-suffix": "cloze-suffix", - "conjugation": "polite past", + "conjugation": "polite « past", "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "読む", diff --git a/test/data/translator-test-results-note-data1.json b/test/data/translator-test-results-note-data1.json index c34842da82..edbb5fd6de 100644 --- a/test/data/translator-test-results-note-data1.json +++ b/test/data/translator-test-results-note-data1.json @@ -26781,7 +26781,8 @@ { "source": "algorithm", "inflectionRules": [ - "polite past" + "polite", + "past" ] } ], diff --git a/test/data/translator-test-results.json b/test/data/translator-test-results.json index 4a81c552bc..9af21430af 100644 --- a/test/data/translator-test-results.json +++ b/test/data/translator-test-results.json @@ -15113,7 +15113,8 @@ { "source": "algorithm", "inflectionRules": [ - "polite past" + "polite", + "past" ] } ], diff --git a/test/deinflector.test.js b/test/deinflector.test.js index e90704f10e..95e65c5b0b 100644 --- a/test/deinflector.test.js +++ b/test/deinflector.test.js @@ -86,7 +86,7 @@ function testDeinflections() { {term: '食べる', source: '食べる', rule: 'v1', reasons: []}, {term: '食べる', source: '食べます', rule: 'v1', reasons: ['polite']}, {term: '食べる', source: '食べた', rule: 'v1', reasons: ['past']}, - {term: '食べる', source: '食べました', rule: 'v1', reasons: ['polite past']}, + {term: '食べる', source: '食べました', rule: 'v1', reasons: ['polite', 'past']}, {term: '食べる', source: '食べて', rule: 'v1', reasons: ['-te']}, {term: '食べる', source: '食べられる', rule: 'v1', reasons: ['potential or passive']}, {term: '食べる', source: '食べられる', rule: 'v1', reasons: ['potential or passive']}, @@ -103,6 +103,7 @@ function testDeinflections() { {term: '食べる', source: '食べさせない', rule: 'v1', reasons: ['causative', 'negative']}, {term: '食べる', source: '食べさせられない', rule: 'v1', reasons: ['causative', 'potential or passive', 'negative']}, {term: '食べる', source: '食べるな', rule: 'v1', reasons: ['imperative negative']}, + {term: '食べる', source: '食べまして', reasons: ['polite', '-te']}, {term: '食べる', source: '食べれば', rule: 'v1', reasons: ['-ba']}, {term: '食べる', source: '食べちゃう', rule: 'v1', reasons: ['-chau']}, @@ -129,7 +130,7 @@ function testDeinflections() { {term: '買う', source: '買う', rule: 'v5', reasons: []}, {term: '買う', source: '買います', rule: 'v5', reasons: ['polite']}, {term: '買う', source: '買った', rule: 'v5', reasons: ['past']}, - {term: '買う', source: '買いました', rule: 'v5', reasons: ['polite past']}, + {term: '買う', source: '買いました', rule: 'v5', reasons: ['polite', 'past']}, {term: '買う', source: '買って', rule: 'v5', reasons: ['-te']}, {term: '買う', source: '買える', rule: 'v5', reasons: ['potential']}, {term: '買う', source: '買われる', rule: 'v5', reasons: ['passive']}, @@ -172,7 +173,7 @@ function testDeinflections() { {term: '行く', source: '行く', rule: 'v5', reasons: []}, {term: '行く', source: '行きます', rule: 'v5', reasons: ['polite']}, {term: '行く', source: '行った', rule: 'v5', reasons: ['past']}, - {term: '行く', source: '行きました', rule: 'v5', reasons: ['polite past']}, + {term: '行く', source: '行きました', rule: 'v5', reasons: ['polite', 'past']}, {term: '行く', source: '行って', rule: 'v5', reasons: ['-te']}, {term: '行く', source: '行ける', rule: 'v5', reasons: ['potential']}, {term: '行く', source: '行かれる', rule: 'v5', reasons: ['passive']}, @@ -215,7 +216,7 @@ function testDeinflections() { {term: '泳ぐ', source: '泳ぐ', rule: 'v5', reasons: []}, {term: '泳ぐ', source: '泳ぎます', rule: 'v5', reasons: ['polite']}, {term: '泳ぐ', source: '泳いだ', rule: 'v5', reasons: ['past']}, - {term: '泳ぐ', source: '泳ぎました', rule: 'v5', reasons: ['polite past']}, + {term: '泳ぐ', source: '泳ぎました', rule: 'v5', reasons: ['polite', 'past']}, {term: '泳ぐ', source: '泳いで', rule: 'v5', reasons: ['-te']}, {term: '泳ぐ', source: '泳げる', rule: 'v5', reasons: ['potential']}, {term: '泳ぐ', source: '泳がれる', rule: 'v5', reasons: ['passive']}, @@ -257,7 +258,7 @@ function testDeinflections() { {term: '話す', source: '話す', rule: 'v5', reasons: []}, {term: '話す', source: '話します', rule: 'v5', reasons: ['polite']}, {term: '話す', source: '話した', rule: 'v5', reasons: ['past']}, - {term: '話す', source: '話しました', rule: 'v5', reasons: ['polite past']}, + {term: '話す', source: '話しました', rule: 'v5', reasons: ['polite', 'past']}, {term: '話す', source: '話して', rule: 'v5', reasons: ['-te']}, {term: '話す', source: '話せる', rule: 'v5', reasons: ['potential']}, {term: '話す', source: '話される', rule: 'v5', reasons: ['passive']}, @@ -300,7 +301,7 @@ function testDeinflections() { {term: '待つ', source: '待つ', rule: 'v5', reasons: []}, {term: '待つ', source: '待ちます', rule: 'v5', reasons: ['polite']}, {term: '待つ', source: '待った', rule: 'v5', reasons: ['past']}, - {term: '待つ', source: '待ちました', rule: 'v5', reasons: ['polite past']}, + {term: '待つ', source: '待ちました', rule: 'v5', reasons: ['polite', 'past']}, {term: '待つ', source: '待って', rule: 'v5', reasons: ['-te']}, {term: '待つ', source: '待てる', rule: 'v5', reasons: ['potential']}, {term: '待つ', source: '待たれる', rule: 'v5', reasons: ['passive']}, @@ -343,7 +344,7 @@ function testDeinflections() { {term: '死ぬ', source: '死ぬ', rule: 'v5', reasons: []}, {term: '死ぬ', source: '死にます', rule: 'v5', reasons: ['polite']}, {term: '死ぬ', source: '死んだ', rule: 'v5', reasons: ['past']}, - {term: '死ぬ', source: '死にました', rule: 'v5', reasons: ['polite past']}, + {term: '死ぬ', source: '死にました', rule: 'v5', reasons: ['polite', 'past']}, {term: '死ぬ', source: '死んで', rule: 'v5', reasons: ['-te']}, {term: '死ぬ', source: '死ねる', rule: 'v5', reasons: ['potential']}, {term: '死ぬ', source: '死なれる', rule: 'v5', reasons: ['passive']}, @@ -385,7 +386,7 @@ function testDeinflections() { {term: '遊ぶ', source: '遊ぶ', rule: 'v5', reasons: []}, {term: '遊ぶ', source: '遊びます', rule: 'v5', reasons: ['polite']}, {term: '遊ぶ', source: '遊んだ', rule: 'v5', reasons: ['past']}, - {term: '遊ぶ', source: '遊びました', rule: 'v5', reasons: ['polite past']}, + {term: '遊ぶ', source: '遊びました', rule: 'v5', reasons: ['polite', 'past']}, {term: '遊ぶ', source: '遊んで', rule: 'v5', reasons: ['-te']}, {term: '遊ぶ', source: '遊べる', rule: 'v5', reasons: ['potential']}, {term: '遊ぶ', source: '遊ばれる', rule: 'v5', reasons: ['passive']}, @@ -427,7 +428,7 @@ function testDeinflections() { {term: '飲む', source: '飲む', rule: 'v5', reasons: []}, {term: '飲む', source: '飲みます', rule: 'v5', reasons: ['polite']}, {term: '飲む', source: '飲んだ', rule: 'v5', reasons: ['past']}, - {term: '飲む', source: '飲みました', rule: 'v5', reasons: ['polite past']}, + {term: '飲む', source: '飲みました', rule: 'v5', reasons: ['polite', 'past']}, {term: '飲む', source: '飲んで', rule: 'v5', reasons: ['-te']}, {term: '飲む', source: '飲める', rule: 'v5', reasons: ['potential']}, {term: '飲む', source: '飲まれる', rule: 'v5', reasons: ['passive']}, @@ -469,7 +470,7 @@ function testDeinflections() { {term: '作る', source: '作る', rule: 'v5', reasons: []}, {term: '作る', source: '作ります', rule: 'v5', reasons: ['polite']}, {term: '作る', source: '作った', rule: 'v5', reasons: ['past']}, - {term: '作る', source: '作りました', rule: 'v5', reasons: ['polite past']}, + {term: '作る', source: '作りました', rule: 'v5', reasons: ['polite', 'past']}, {term: '作る', source: '作って', rule: 'v5', reasons: ['-te']}, {term: '作る', source: '作れる', rule: 'v5', reasons: ['potential']}, {term: '作る', source: '作られる', rule: 'v5', reasons: ['passive']}, @@ -513,7 +514,7 @@ function testDeinflections() { {term: '為る', source: '為る', rule: 'vs', reasons: []}, {term: '為る', source: '為ます', rule: 'vs', reasons: ['polite']}, {term: '為る', source: '為た', rule: 'vs', reasons: ['past']}, - {term: '為る', source: '為ました', rule: 'vs', reasons: ['polite past']}, + {term: '為る', source: '為ました', rule: 'vs', reasons: ['polite', 'past']}, {term: '為る', source: '為て', rule: 'vs', reasons: ['-te']}, {term: '為る', source: '為られる', rule: 'vs', reasons: ['potential or passive']}, {term: '為る', source: '為れる', rule: 'vs', reasons: ['passive']}, @@ -560,7 +561,7 @@ function testDeinflections() { {term: 'する', source: 'する', rule: 'vs', reasons: []}, {term: 'する', source: 'します', rule: 'vs', reasons: ['polite']}, {term: 'する', source: 'した', rule: 'vs', reasons: ['past']}, - {term: 'する', source: 'しました', rule: 'vs', reasons: ['polite past']}, + {term: 'する', source: 'しました', rule: 'vs', reasons: ['polite', 'past']}, {term: 'する', source: 'して', rule: 'vs', reasons: ['-te']}, {term: 'する', source: 'できる', rule: 'vs', reasons: ['potential']}, {term: 'する', source: '出来る', rule: 'vs', reasons: ['potential']}, @@ -609,7 +610,7 @@ function testDeinflections() { {term: '来る', source: '来る', rule: 'vk', reasons: []}, {term: '来る', source: '来ます', rule: 'vk', reasons: ['polite']}, {term: '来る', source: '来た', rule: 'vk', reasons: ['past']}, - {term: '来る', source: '来ました', rule: 'vk', reasons: ['polite past']}, + {term: '来る', source: '来ました', rule: 'vk', reasons: ['polite', 'past']}, {term: '来る', source: '来て', rule: 'vk', reasons: ['-te']}, {term: '来る', source: '来られる', rule: 'vk', reasons: ['potential or passive']}, {term: '来る', source: '来られる', rule: 'vk', reasons: ['potential or passive']}, @@ -652,7 +653,7 @@ function testDeinflections() { {term: '來る', source: '來る', rule: 'vk', reasons: []}, {term: '來る', source: '來ます', rule: 'vk', reasons: ['polite']}, {term: '來る', source: '來た', rule: 'vk', reasons: ['past']}, - {term: '來る', source: '來ました', rule: 'vk', reasons: ['polite past']}, + {term: '來る', source: '來ました', rule: 'vk', reasons: ['polite', 'past']}, {term: '來る', source: '來て', rule: 'vk', reasons: ['-te']}, {term: '來る', source: '來られる', rule: 'vk', reasons: ['potential or passive']}, {term: '來る', source: '來られる', rule: 'vk', reasons: ['potential or passive']}, @@ -695,7 +696,7 @@ function testDeinflections() { {term: 'くる', source: 'くる', rule: 'vk', reasons: []}, {term: 'くる', source: 'きます', rule: 'vk', reasons: ['polite']}, {term: 'くる', source: 'きた', rule: 'vk', reasons: ['past']}, - {term: 'くる', source: 'きました', rule: 'vk', reasons: ['polite past']}, + {term: 'くる', source: 'きました', rule: 'vk', reasons: ['polite', 'past']}, {term: 'くる', source: 'きて', rule: 'vk', reasons: ['-te']}, {term: 'くる', source: 'こられる', rule: 'vk', reasons: ['potential or passive']}, {term: 'くる', source: 'こられる', rule: 'vk', reasons: ['potential or passive']}, @@ -739,7 +740,7 @@ function testDeinflections() { {term: '論ずる', source: '論ずる', rule: 'vz', reasons: []}, {term: '論ずる', source: '論じます', rule: 'vz', reasons: ['polite']}, {term: '論ずる', source: '論じた', rule: 'vz', reasons: ['past']}, - {term: '論ずる', source: '論じました', rule: 'vz', reasons: ['polite past']}, + {term: '論ずる', source: '論じました', rule: 'vz', reasons: ['polite', 'past']}, {term: '論ずる', source: '論じて', rule: 'vz', reasons: ['-te']}, {term: '論ずる', source: '論ぜられる', rule: 'vz', reasons: ['potential or passive']}, {term: '論ずる', source: '論ざれる', rule: 'vz', reasons: ['potential or passive']}, diff --git a/types/ext/deinflector.d.ts b/types/ext/deinflector.d.ts index 5defbf7959..e33d5542fb 100644 --- a/types/ext/deinflector.d.ts +++ b/types/ext/deinflector.d.ts @@ -17,7 +17,7 @@ import type * as TranslationInternal from './translation-internal'; -export type ReasonTypeRaw = 'v1' | 'v1d' | 'v1p' | 'v5' | 'vs' | 'vk' | 'vz' | 'adj-i' | 'iru'; +export type ReasonTypeRaw = 'v' | 'v1' | 'v1d' | 'v1p' | 'v5' | 'vs' | 'vk' | 'vz' | 'adj-i' | 'iru'; export type ReasonsRaw = { [reason: string]: { From 2bc4297db452305e33b79f1a4c5762ecdcbcb840 Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Thu, 25 Jan 2024 15:02:26 +0100 Subject: [PATCH 04/12] expand verb flag --- ext/data/deinflect.json | 2 +- ext/js/language/deinflector.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/data/deinflect.json b/ext/data/deinflect.json index c8205f4781..40aa3fbf68 100644 --- a/ext/data/deinflect.json +++ b/ext/data/deinflect.json @@ -321,7 +321,7 @@ {"kanaIn": "來い", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]} ], "imperative negative": [ - {"kanaIn": "な", "kanaOut": "", "rulesIn": [], "rulesOut": ["v1", "v5", "vk", "vs", "vz"]} + {"kanaIn": "な", "kanaOut": "", "rulesIn": [], "rulesOut": ["v"]} ], "masu stem": [ {"kanaIn": "い", "kanaOut": "いる", "rulesIn": [], "rulesOut": ["v1d"]}, diff --git a/ext/js/language/deinflector.js b/ext/js/language/deinflector.js index 0773ff712f..9a7b5694a3 100644 --- a/ext/js/language/deinflector.js +++ b/ext/js/language/deinflector.js @@ -20,7 +20,7 @@ export class Deinflector { /* eslint-disable no-multi-spaces */ /** @type {Map} @readonly */ static _ruleTypes = new Map([ - ['v', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000111)], // Verb + ['v', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000111111)], // Verb ['v1', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000011)], // Verb ichidan ['v1d', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000010)], // Verb ichidan dictionary form ['v1p', /** @type {import('translation-internal').DeinflectionRuleFlags} */ (0b000000001)], // Verb ichidan progressive or perfect From 6ab75d15f567f9d422491bdb7340d93624f9c390 Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Thu, 25 Jan 2024 15:39:26 +0100 Subject: [PATCH 05/12] fix polite negative --- ext/data/deinflect.json | 25 ++++--------------------- test/deinflector.test.js | 34 +++++++++++++++++----------------- 2 files changed, 21 insertions(+), 38 deletions(-) diff --git a/ext/data/deinflect.json b/ext/data/deinflect.json index 40aa3fbf68..3b59003730 100644 --- a/ext/data/deinflect.json +++ b/ext/data/deinflect.json @@ -376,7 +376,8 @@ {"kanaIn": "為ない", "kanaOut": "為る", "rulesIn": ["adj-i"], "rulesOut": ["vs"]}, {"kanaIn": "こない", "kanaOut": "くる", "rulesIn": ["adj-i"], "rulesOut": ["vk"]}, {"kanaIn": "来ない", "kanaOut": "来る", "rulesIn": ["adj-i"], "rulesOut": ["vk"]}, - {"kanaIn": "來ない", "kanaOut": "來る", "rulesIn": ["adj-i"], "rulesOut": ["vk"]} + {"kanaIn": "來ない", "kanaOut": "來る", "rulesIn": ["adj-i"], "rulesOut": ["vk"]}, + {"kanaIn": "ません", "kanaOut": "ます", "rulesIn": ["v"], "rulesOut": ["v"]} ], "noun": [ {"kanaIn": "さ", "kanaOut": "い", "rulesIn": [], "rulesOut": ["adj-i"]} @@ -452,26 +453,8 @@ {"kanaIn": "為ます", "kanaOut": "為る", "rulesIn": ["v"], "rulesOut": ["vs"]}, {"kanaIn": "きます", "kanaOut": "くる", "rulesIn": ["v"], "rulesOut": ["vk"]}, {"kanaIn": "来ます", "kanaOut": "来る", "rulesIn": ["v"], "rulesOut": ["vk"]}, - {"kanaIn": "來ます", "kanaOut": "來る", "rulesIn": ["v"], "rulesOut": ["vk"]} - ], - "polite negative": [ - {"kanaIn": "くありません", "kanaOut": "い", "rulesIn": [], "rulesOut": ["adj-i"]}, - {"kanaIn": "ません", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "いません", "kanaOut": "う", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "きません", "kanaOut": "く", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ぎません", "kanaOut": "ぐ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "しません", "kanaOut": "す", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ちません", "kanaOut": "つ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "にません", "kanaOut": "ぬ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "びません", "kanaOut": "ぶ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "みません", "kanaOut": "む", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "りません", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "じません", "kanaOut": "ずる", "rulesIn": [], "rulesOut": ["vz"]}, - {"kanaIn": "しません", "kanaOut": "する", "rulesIn": [], "rulesOut": ["vs"]}, - {"kanaIn": "為ません", "kanaOut": "為る", "rulesIn": [], "rulesOut": ["vs"]}, - {"kanaIn": "きません", "kanaOut": "くる", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "来ません", "kanaOut": "来る", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "來ません", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]} + {"kanaIn": "來ます", "kanaOut": "來る", "rulesIn": ["v"], "rulesOut": ["vk"]}, + {"kanaIn": "くあります", "kanaOut": "い", "rulesIn": ["v"], "rulesOut": ["adj-i"]} ], "polite past negative": [ {"kanaIn": "くありませんでした", "kanaOut": "い", "rulesIn": [], "rulesOut": ["adj-i"]}, diff --git a/test/deinflector.test.js b/test/deinflector.test.js index 95e65c5b0b..d06bbdaa52 100644 --- a/test/deinflector.test.js +++ b/test/deinflector.test.js @@ -77,7 +77,7 @@ function testDeinflections() { {term: '愛しい', source: '愛しくない', rule: 'adj-i', reasons: ['negative']}, {term: '愛しい', source: '愛しさ', rule: 'adj-i', reasons: ['noun']}, {term: '愛しい', source: '愛しかった', rule: 'adj-i', reasons: ['past']}, - {term: '愛しい', source: '愛しくありません', rule: 'adj-i', reasons: ['polite negative']}, + {term: '愛しい', source: '愛しくありません', rule: 'adj-i', reasons: ['polite', 'negative']}, {term: '愛しい', source: '愛しくありませんでした', rule: 'adj-i', reasons: ['polite past negative']}, {term: '愛しい', source: '愛しき', rule: 'adj-i', reasons: ['-ki']}, {term: '愛しい', source: '愛しげ', rule: 'adj-i', reasons: ['-ge']}, @@ -94,7 +94,7 @@ function testDeinflections() { {term: '食べる', source: '食べさせられる', rule: 'v1', reasons: ['causative', 'potential or passive']}, {term: '食べる', source: '食べろ', rule: 'v1', reasons: ['imperative']}, {term: '食べる', source: '食べない', rule: 'v1', reasons: ['negative']}, - {term: '食べる', source: '食べません', rule: 'v1', reasons: ['polite negative']}, + {term: '食べる', source: '食べません', rule: 'v1', reasons: ['polite', 'negative']}, {term: '食べる', source: '食べなかった', rule: 'v1', reasons: ['negative', 'past']}, {term: '食べる', source: '食べませんでした', rule: 'v1', reasons: ['polite past negative']}, {term: '食べる', source: '食べなくて', rule: 'v1', reasons: ['negative', '-te']}, @@ -138,7 +138,7 @@ function testDeinflections() { {term: '買う', source: '買わせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '買う', source: '買え', rule: 'v5', reasons: ['imperative']}, {term: '買う', source: '買わない', rule: 'v5', reasons: ['negative']}, - {term: '買う', source: '買いません', rule: 'v5', reasons: ['polite negative']}, + {term: '買う', source: '買いません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '買う', source: '買わなかった', rule: 'v5', reasons: ['negative', 'past']}, {term: '買う', source: '買いませんでした', rule: 'v5', reasons: ['polite past negative']}, {term: '買う', source: '買わなくて', rule: 'v5', reasons: ['negative', '-te']}, @@ -181,7 +181,7 @@ function testDeinflections() { {term: '行く', source: '行かせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '行く', source: '行け', rule: 'v5', reasons: ['imperative']}, {term: '行く', source: '行かない', rule: 'v5', reasons: ['negative']}, - {term: '行く', source: '行きません', rule: 'v5', reasons: ['polite negative']}, + {term: '行く', source: '行きません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '行く', source: '行かなかった', rule: 'v5', reasons: ['negative', 'past']}, {term: '行く', source: '行きませんでした', rule: 'v5', reasons: ['polite past negative']}, {term: '行く', source: '行かなくて', rule: 'v5', reasons: ['negative', '-te']}, @@ -224,7 +224,7 @@ function testDeinflections() { {term: '泳ぐ', source: '泳がせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '泳ぐ', source: '泳げ', rule: 'v5', reasons: ['imperative']}, {term: '泳ぐ', source: '泳がない', rule: 'v5', reasons: ['negative']}, - {term: '泳ぐ', source: '泳ぎません', rule: 'v5', reasons: ['polite negative']}, + {term: '泳ぐ', source: '泳ぎません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '泳ぐ', source: '泳がなかった', rule: 'v5', reasons: ['negative', 'past']}, {term: '泳ぐ', source: '泳ぎませんでした', rule: 'v5', reasons: ['polite past negative']}, {term: '泳ぐ', source: '泳がなくて', rule: 'v5', reasons: ['negative', '-te']}, @@ -266,7 +266,7 @@ function testDeinflections() { {term: '話す', source: '話させられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '話す', source: '話せ', rule: 'v5', reasons: ['imperative']}, {term: '話す', source: '話さない', rule: 'v5', reasons: ['negative']}, - {term: '話す', source: '話しません', rule: 'v5', reasons: ['polite negative']}, + {term: '話す', source: '話しません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '話す', source: '話さなかった', rule: 'v5', reasons: ['negative', 'past']}, {term: '話す', source: '話しませんでした', rule: 'v5', reasons: ['polite past negative']}, {term: '話す', source: '話さなくて', rule: 'v5', reasons: ['negative', '-te']}, @@ -309,7 +309,7 @@ function testDeinflections() { {term: '待つ', source: '待たせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '待つ', source: '待て', rule: 'v5', reasons: ['imperative']}, {term: '待つ', source: '待たない', rule: 'v5', reasons: ['negative']}, - {term: '待つ', source: '待ちません', rule: 'v5', reasons: ['polite negative']}, + {term: '待つ', source: '待ちません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '待つ', source: '待たなかった', rule: 'v5', reasons: ['negative', 'past']}, {term: '待つ', source: '待ちませんでした', rule: 'v5', reasons: ['polite past negative']}, {term: '待つ', source: '待たなくて', rule: 'v5', reasons: ['negative', '-te']}, @@ -352,7 +352,7 @@ function testDeinflections() { {term: '死ぬ', source: '死なせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '死ぬ', source: '死ね', rule: 'v5', reasons: ['imperative']}, {term: '死ぬ', source: '死なない', rule: 'v5', reasons: ['negative']}, - {term: '死ぬ', source: '死にません', rule: 'v5', reasons: ['polite negative']}, + {term: '死ぬ', source: '死にません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '死ぬ', source: '死ななかった', rule: 'v5', reasons: ['negative', 'past']}, {term: '死ぬ', source: '死にませんでした', rule: 'v5', reasons: ['polite past negative']}, {term: '死ぬ', source: '死ななくて', rule: 'v5', reasons: ['negative', '-te']}, @@ -394,7 +394,7 @@ function testDeinflections() { {term: '遊ぶ', source: '遊ばせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '遊ぶ', source: '遊べ', rule: 'v5', reasons: ['imperative']}, {term: '遊ぶ', source: '遊ばない', rule: 'v5', reasons: ['negative']}, - {term: '遊ぶ', source: '遊びません', rule: 'v5', reasons: ['polite negative']}, + {term: '遊ぶ', source: '遊びません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '遊ぶ', source: '遊ばなかった', rule: 'v5', reasons: ['negative', 'past']}, {term: '遊ぶ', source: '遊びませんでした', rule: 'v5', reasons: ['polite past negative']}, {term: '遊ぶ', source: '遊ばなくて', rule: 'v5', reasons: ['negative', '-te']}, @@ -436,7 +436,7 @@ function testDeinflections() { {term: '飲む', source: '飲ませられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '飲む', source: '飲め', rule: 'v5', reasons: ['imperative']}, {term: '飲む', source: '飲まない', rule: 'v5', reasons: ['negative']}, - {term: '飲む', source: '飲みません', rule: 'v5', reasons: ['polite negative']}, + {term: '飲む', source: '飲みません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '飲む', source: '飲まなかった', rule: 'v5', reasons: ['negative', 'past']}, {term: '飲む', source: '飲みませんでした', rule: 'v5', reasons: ['polite past negative']}, {term: '飲む', source: '飲まなくて', rule: 'v5', reasons: ['negative', '-te']}, @@ -478,7 +478,7 @@ function testDeinflections() { {term: '作る', source: '作らせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '作る', source: '作れ', rule: 'v5', reasons: ['imperative']}, {term: '作る', source: '作らない', rule: 'v5', reasons: ['negative']}, - {term: '作る', source: '作りません', rule: 'v5', reasons: ['polite negative']}, + {term: '作る', source: '作りません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '作る', source: '作らなかった', rule: 'v5', reasons: ['negative', 'past']}, {term: '作る', source: '作りませんでした', rule: 'v5', reasons: ['polite past negative']}, {term: '作る', source: '作らなくて', rule: 'v5', reasons: ['negative', '-te']}, @@ -524,7 +524,7 @@ function testDeinflections() { {term: '為る', source: '為させられる', rule: 'vs', reasons: ['causative', 'potential or passive']}, {term: '為る', source: '為ろ', rule: 'vs', reasons: ['imperative']}, {term: '為る', source: '為ない', rule: 'vs', reasons: ['negative']}, - {term: '為る', source: '為ません', rule: 'vs', reasons: ['polite negative']}, + {term: '為る', source: '為ません', rule: 'vs', reasons: ['polite', 'negative']}, {term: '為る', source: '為なかった', rule: 'vs', reasons: ['negative', 'past']}, {term: '為る', source: '為ませんでした', rule: 'vs', reasons: ['polite past negative']}, {term: '為る', source: '為なくて', rule: 'vs', reasons: ['negative', '-te']}, @@ -573,7 +573,7 @@ function testDeinflections() { {term: 'する', source: 'せさせられる', rule: 'vs', reasons: ['causative', 'potential or passive']}, {term: 'する', source: 'しろ', rule: 'vs', reasons: ['imperative']}, {term: 'する', source: 'しない', rule: 'vs', reasons: ['negative']}, - {term: 'する', source: 'しません', rule: 'vs', reasons: ['polite negative']}, + {term: 'する', source: 'しません', rule: 'vs', reasons: ['polite', 'negative']}, {term: 'する', source: 'しなかった', rule: 'vs', reasons: ['negative', 'past']}, {term: 'する', source: 'しませんでした', rule: 'vs', reasons: ['polite past negative']}, {term: 'する', source: 'しなくて', rule: 'vs', reasons: ['negative', '-te']}, @@ -618,7 +618,7 @@ function testDeinflections() { {term: '来る', source: '来させられる', rule: 'vk', reasons: ['causative', 'potential or passive']}, {term: '来る', source: '来い', rule: 'vk', reasons: ['imperative']}, {term: '来る', source: '来ない', rule: 'vk', reasons: ['negative']}, - {term: '来る', source: '来ません', rule: 'vk', reasons: ['polite negative']}, + {term: '来る', source: '来ません', rule: 'vk', reasons: ['polite', 'negative']}, {term: '来る', source: '来なかった', rule: 'vk', reasons: ['negative', 'past']}, {term: '来る', source: '来ませんでした', rule: 'vk', reasons: ['polite past negative']}, {term: '来る', source: '来なくて', rule: 'vk', reasons: ['negative', '-te']}, @@ -661,7 +661,7 @@ function testDeinflections() { {term: '來る', source: '來させられる', rule: 'vk', reasons: ['causative', 'potential or passive']}, {term: '來る', source: '來い', rule: 'vk', reasons: ['imperative']}, {term: '來る', source: '來ない', rule: 'vk', reasons: ['negative']}, - {term: '來る', source: '來ません', rule: 'vk', reasons: ['polite negative']}, + {term: '來る', source: '來ません', rule: 'vk', reasons: ['polite', 'negative']}, {term: '來る', source: '來なかった', rule: 'vk', reasons: ['negative', 'past']}, {term: '來る', source: '來ませんでした', rule: 'vk', reasons: ['polite past negative']}, {term: '來る', source: '來なくて', rule: 'vk', reasons: ['negative', '-te']}, @@ -704,7 +704,7 @@ function testDeinflections() { {term: 'くる', source: 'こさせられる', rule: 'vk', reasons: ['causative', 'potential or passive']}, {term: 'くる', source: 'こい', rule: 'vk', reasons: ['imperative']}, {term: 'くる', source: 'こない', rule: 'vk', reasons: ['negative']}, - {term: 'くる', source: 'きません', rule: 'vk', reasons: ['polite negative']}, + {term: 'くる', source: 'きません', rule: 'vk', reasons: ['polite', 'negative']}, {term: 'くる', source: 'こなかった', rule: 'vk', reasons: ['negative', 'past']}, {term: 'くる', source: 'きませんでした', rule: 'vk', reasons: ['polite past negative']}, {term: 'くる', source: 'こなくて', rule: 'vk', reasons: ['negative', '-te']}, @@ -752,7 +752,7 @@ function testDeinflections() { {term: '論ずる', source: '論ぜさせられる', rule: 'vz', reasons: ['causative', 'potential or passive']}, {term: '論ずる', source: '論じろ', rule: 'vz', reasons: ['imperative']}, {term: '論ずる', source: '論じない', rule: 'vz', reasons: ['negative']}, - {term: '論ずる', source: '論じません', rule: 'vz', reasons: ['polite negative']}, + {term: '論ずる', source: '論じません', rule: 'vz', reasons: ['polite', 'negative']}, {term: '論ずる', source: '論じなかった', rule: 'vz', reasons: ['negative', 'past']}, {term: '論ずる', source: '論じませんでした', rule: 'vz', reasons: ['polite past negative']}, {term: '論ずる', source: '論じなくて', rule: 'vz', reasons: ['negative', '-te']}, From d5f96330581f4d9346cabb45025032e312d57592 Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Thu, 25 Jan 2024 15:48:07 +0100 Subject: [PATCH 06/12] fix polite volitional --- ext/data/deinflect.json | 21 ++------------------- test/deinflector.test.js | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/ext/data/deinflect.json b/ext/data/deinflect.json index 3b59003730..7c74336bf8 100644 --- a/ext/data/deinflect.json +++ b/ext/data/deinflect.json @@ -475,24 +475,6 @@ {"kanaIn": "来ませんでした", "kanaOut": "来る", "rulesIn": [], "rulesOut": ["vk"]}, {"kanaIn": "來ませんでした", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]} ], - "polite volitional": [ - {"kanaIn": "ましょう", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "いましょう", "kanaOut": "う", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "きましょう", "kanaOut": "く", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ぎましょう", "kanaOut": "ぐ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "しましょう", "kanaOut": "す", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ちましょう", "kanaOut": "つ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "にましょう", "kanaOut": "ぬ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "びましょう", "kanaOut": "ぶ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "みましょう", "kanaOut": "む", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "りましょう", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "じましょう", "kanaOut": "ずる", "rulesIn": [], "rulesOut": ["vz"]}, - {"kanaIn": "しましょう", "kanaOut": "する", "rulesIn": [], "rulesOut": ["vs"]}, - {"kanaIn": "為ましょう", "kanaOut": "為る", "rulesIn": [], "rulesOut": ["vs"]}, - {"kanaIn": "きましょう", "kanaOut": "くる", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "来ましょう", "kanaOut": "来る", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "來ましょう", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]} - ], "potential": [ {"kanaIn": "れる", "kanaOut": "る", "rulesIn": ["v1"], "rulesOut": ["v1", "v5"]}, {"kanaIn": "える", "kanaOut": "う", "rulesIn": ["v1"], "rulesOut": ["v5"]}, @@ -535,7 +517,8 @@ {"kanaIn": "為よう", "kanaOut": "為る", "rulesIn": [], "rulesOut": ["vs"]}, {"kanaIn": "こよう", "kanaOut": "くる", "rulesIn": [], "rulesOut": ["vk"]}, {"kanaIn": "来よう", "kanaOut": "来る", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "來よう", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]} + {"kanaIn": "來よう", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]}, + {"kanaIn": "ましょう", "kanaOut": "ます", "rulesIn": [], "rulesOut": ["v"]} ], "causative passive": [ {"kanaIn": "かされる", "kanaOut": "く", "rulesIn": ["v1"], "rulesOut": ["v5"]}, diff --git a/test/deinflector.test.js b/test/deinflector.test.js index d06bbdaa52..697244cbe6 100644 --- a/test/deinflector.test.js +++ b/test/deinflector.test.js @@ -117,7 +117,7 @@ function testDeinflections() { {term: '食べる', source: '食べず', rule: 'v1', reasons: ['-zu']}, {term: '食べる', source: '食べぬ', rule: 'v1', reasons: ['-nu']}, {term: '食べる', source: '食べ', rule: 'v1d', reasons: ['masu stem']}, - {term: '食べる', source: '食べましょう', rule: 'v1', reasons: ['polite volitional']}, + {term: '食べる', source: '食べましょう', rule: 'v1', reasons: ['polite', 'volitional']}, {term: '食べる', source: '食べよう', rule: 'v1', reasons: ['volitional']}, // ['causative passive'] {term: '食べる', source: '食べとく', rule: 'v1', reasons: ['-toku']}, @@ -160,7 +160,7 @@ function testDeinflections() { {term: '買う', source: '買わず', rule: 'v5', reasons: ['-zu']}, {term: '買う', source: '買わぬ', rule: 'v5', reasons: ['-nu']}, {term: '買う', source: '買い', rule: 'v5', reasons: ['masu stem']}, - {term: '買う', source: '買いましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '買う', source: '買いましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '買う', source: '買おう', rule: 'v5', reasons: ['volitional']}, {term: '買う', source: '買わされる', rule: 'v5', reasons: ['causative passive']}, {term: '買う', source: '買っとく', rule: 'v5', reasons: ['-toku']}, @@ -203,7 +203,7 @@ function testDeinflections() { {term: '行く', source: '行かず', rule: 'v5', reasons: ['-zu']}, {term: '行く', source: '行かぬ', rule: 'v5', reasons: ['-nu']}, {term: '行く', source: '行き', rule: 'v5', reasons: ['masu stem']}, - {term: '行く', source: '行きましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '行く', source: '行きましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '行く', source: '行こう', rule: 'v5', reasons: ['volitional']}, {term: '行く', source: '行かされる', rule: 'v5', reasons: ['causative passive']}, {term: '行く', source: '行いとく', rule: 'v5', reasons: ['-toku']}, @@ -246,7 +246,7 @@ function testDeinflections() { {term: '泳ぐ', source: '泳がず', rule: 'v5', reasons: ['-zu']}, {term: '泳ぐ', source: '泳がぬ', rule: 'v5', reasons: ['-nu']}, {term: '泳ぐ', source: '泳ぎ', rule: 'v5', reasons: ['masu stem']}, - {term: '泳ぐ', source: '泳ぎましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '泳ぐ', source: '泳ぎましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '泳ぐ', source: '泳ごう', rule: 'v5', reasons: ['volitional']}, {term: '泳ぐ', source: '泳がされる', rule: 'v5', reasons: ['causative passive']}, {term: '泳ぐ', source: '泳いどく', rule: 'v5', reasons: ['-toku']}, @@ -288,7 +288,7 @@ function testDeinflections() { {term: '話す', source: '話さず', rule: 'v5', reasons: ['-zu']}, {term: '話す', source: '話さぬ', rule: 'v5', reasons: ['-nu']}, {term: '話す', source: '話し', rule: 'v5', reasons: ['masu stem']}, - {term: '話す', source: '話しましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '話す', source: '話しましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '話す', source: '話そう', rule: 'v5', reasons: ['volitional']}, // ['causative passive'] {term: '話す', source: '話しとく', rule: 'v5', reasons: ['-toku']}, @@ -331,7 +331,7 @@ function testDeinflections() { {term: '待つ', source: '待たず', rule: 'v5', reasons: ['-zu']}, {term: '待つ', source: '待たぬ', rule: 'v5', reasons: ['-nu']}, {term: '待つ', source: '待ち', rule: 'v5', reasons: ['masu stem']}, - {term: '待つ', source: '待ちましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '待つ', source: '待ちましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '待つ', source: '待とう', rule: 'v5', reasons: ['volitional']}, {term: '待つ', source: '待たされる', rule: 'v5', reasons: ['causative passive']}, {term: '待つ', source: '待っとく', rule: 'v5', reasons: ['-toku']}, @@ -374,7 +374,7 @@ function testDeinflections() { {term: '死ぬ', source: '死なず', rule: 'v5', reasons: ['-zu']}, {term: '死ぬ', source: '死なぬ', rule: 'v5', reasons: ['-nu']}, {term: '死ぬ', source: '死に', rule: 'v5', reasons: ['masu stem']}, - {term: '死ぬ', source: '死にましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '死ぬ', source: '死にましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '死ぬ', source: '死のう', rule: 'v5', reasons: ['volitional']}, {term: '死ぬ', source: '死なされる', rule: 'v5', reasons: ['causative passive']}, {term: '死ぬ', source: '死んどく', rule: 'v5', reasons: ['-toku']}, @@ -416,7 +416,7 @@ function testDeinflections() { {term: '遊ぶ', source: '遊ばず', rule: 'v5', reasons: ['-zu']}, {term: '遊ぶ', source: '遊ばぬ', rule: 'v5', reasons: ['-nu']}, {term: '遊ぶ', source: '遊び', rule: 'v5', reasons: ['masu stem']}, - {term: '遊ぶ', source: '遊びましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '遊ぶ', source: '遊びましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '遊ぶ', source: '遊ぼう', rule: 'v5', reasons: ['volitional']}, {term: '遊ぶ', source: '遊ばされる', rule: 'v5', reasons: ['causative passive']}, {term: '遊ぶ', source: '遊んどく', rule: 'v5', reasons: ['-toku']}, @@ -458,7 +458,7 @@ function testDeinflections() { {term: '飲む', source: '飲まず', rule: 'v5', reasons: ['-zu']}, {term: '飲む', source: '飲まぬ', rule: 'v5', reasons: ['-nu']}, {term: '飲む', source: '飲み', rule: 'v5', reasons: ['masu stem']}, - {term: '飲む', source: '飲みましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '飲む', source: '飲みましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '飲む', source: '飲もう', rule: 'v5', reasons: ['volitional']}, {term: '飲む', source: '飲まされる', rule: 'v5', reasons: ['causative passive']}, {term: '飲む', source: '飲んどく', rule: 'v5', reasons: ['-toku']}, @@ -500,7 +500,7 @@ function testDeinflections() { {term: '作る', source: '作らず', rule: 'v5', reasons: ['-zu']}, {term: '作る', source: '作らぬ', rule: 'v5', reasons: ['-nu']}, {term: '作る', source: '作り', rule: 'v5', reasons: ['masu stem']}, - {term: '作る', source: '作りましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '作る', source: '作りましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '作る', source: '作ろう', rule: 'v5', reasons: ['volitional']}, {term: '作る', source: '作らされる', rule: 'v5', reasons: ['causative passive']}, {term: '作る', source: '作っとく', rule: 'v5', reasons: ['-toku']}, @@ -548,7 +548,7 @@ function testDeinflections() { {term: '為る', source: '為ず', rule: 'vs', reasons: ['-zu']}, {term: '為る', source: '為ぬ', rule: 'vs', reasons: ['-nu']}, // ['masu stem'] - {term: '為る', source: '為ましょう', rule: 'vs', reasons: ['polite volitional']}, + {term: '為る', source: '為ましょう', rule: 'vs', reasons: ['polite', 'volitional']}, {term: '為る', source: '為よう', rule: 'vs', reasons: ['volitional']}, // ['causative passive'] {term: '為る', source: '為とく', rule: 'vs', reasons: ['-toku']}, @@ -597,7 +597,7 @@ function testDeinflections() { {term: 'する', source: 'せず', rule: 'vs', reasons: ['-zu']}, {term: 'する', source: 'せぬ', rule: 'vs', reasons: ['-nu']}, // ['masu stem'] - {term: 'する', source: 'しましょう', rule: 'vs', reasons: ['polite volitional']}, + {term: 'する', source: 'しましょう', rule: 'vs', reasons: ['polite', 'volitional']}, {term: 'する', source: 'しよう', rule: 'vs', reasons: ['volitional']}, // ['causative passive'] {term: 'する', source: 'しとく', rule: 'vs', reasons: ['-toku']}, @@ -640,7 +640,7 @@ function testDeinflections() { {term: '来る', source: '来ず', rule: 'vk', reasons: ['-zu']}, {term: '来る', source: '来ぬ', rule: 'vk', reasons: ['-nu']}, {term: '来る', source: '来', rule: 'vk', reasons: ['masu stem']}, - {term: '来る', source: '来ましょう', rule: 'vk', reasons: ['polite volitional']}, + {term: '来る', source: '来ましょう', rule: 'vk', reasons: ['polite', 'volitional']}, {term: '来る', source: '来よう', rule: 'vk', reasons: ['volitional']}, // ['causative passive'] {term: '来る', source: '来とく', rule: 'vk', reasons: ['-toku']}, @@ -683,7 +683,7 @@ function testDeinflections() { {term: '來る', source: '來ず', rule: 'vk', reasons: ['-zu']}, {term: '來る', source: '來ぬ', rule: 'vk', reasons: ['-nu']}, {term: '來る', source: '來', rule: 'vk', reasons: ['masu stem']}, - {term: '來る', source: '來ましょう', rule: 'vk', reasons: ['polite volitional']}, + {term: '來る', source: '來ましょう', rule: 'vk', reasons: ['polite', 'volitional']}, {term: '來る', source: '來よう', rule: 'vk', reasons: ['volitional']}, // ['causative passive'] {term: '來る', source: '來とく', rule: 'vk', reasons: ['-toku']}, @@ -726,7 +726,7 @@ function testDeinflections() { {term: 'くる', source: 'こず', rule: 'vk', reasons: ['-zu']}, {term: 'くる', source: 'こぬ', rule: 'vk', reasons: ['-nu']}, {term: 'くる', source: 'き', rule: 'vk', reasons: ['masu stem']}, - {term: 'くる', source: 'きましょう', rule: 'vk', reasons: ['polite volitional']}, + {term: 'くる', source: 'きましょう', rule: 'vk', reasons: ['polite', 'volitional']}, {term: 'くる', source: 'こよう', rule: 'vk', reasons: ['volitional']}, // ['causative passive'] {term: 'くる', source: 'きとく', rule: 'vk', reasons: ['-toku']}, @@ -777,7 +777,7 @@ function testDeinflections() { {term: '論ずる', source: '論ぜず', rule: 'vz', reasons: ['-zu']}, {term: '論ずる', source: '論ぜぬ', rule: 'vz', reasons: ['-nu']}, // ['masu stem'] - {term: '論ずる', source: '論じましょう', rule: 'vz', reasons: ['polite volitional']}, + {term: '論ずる', source: '論じましょう', rule: 'vz', reasons: ['polite', 'volitional']}, {term: '論ずる', source: '論じよう', rule: 'vz', reasons: ['volitional']}, // ['causative passive'] {term: '論ずる', source: '論じとく', rule: 'vz', reasons: ['-toku']}, From 7d5b7cec0e7dca1776dc6ce89a56287ca389396a Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Thu, 25 Jan 2024 15:54:53 +0100 Subject: [PATCH 07/12] fix polite past negative --- ext/data/deinflect.json | 22 ++---------- test/data/anki-note-builder-test-results.json | 8 ++--- .../translator-test-results-note-data1.json | 16 ++++++--- test/data/translator-test-results.json | 16 ++++++--- test/deinflector.test.js | 36 +++++++++---------- 5 files changed, 48 insertions(+), 50 deletions(-) diff --git a/ext/data/deinflect.json b/ext/data/deinflect.json index 7c74336bf8..075900b105 100644 --- a/ext/data/deinflect.json +++ b/ext/data/deinflect.json @@ -435,7 +435,8 @@ {"kanaIn": "添うた", "kanaOut": "添う", "rulesIn": [], "rulesOut": ["v5"]}, {"kanaIn": "副うた", "kanaOut": "副う", "rulesIn": [], "rulesOut": ["v5"]}, {"kanaIn": "厭うた", "kanaOut": "厭う", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "のたもうた", "kanaOut": "のたまう", "rulesIn": [], "rulesOut": ["v5"]} + {"kanaIn": "のたもうた", "kanaOut": "のたまう", "rulesIn": [], "rulesOut": ["v5"]}, + {"kanaIn": "ませんでした", "kanaOut": "ません", "rulesIn": ["v"], "rulesOut": ["v"]} ], "polite": [ {"kanaIn": "ます", "kanaOut": "る", "rulesIn": ["v"], "rulesOut": ["v1"]}, @@ -456,25 +457,6 @@ {"kanaIn": "來ます", "kanaOut": "來る", "rulesIn": ["v"], "rulesOut": ["vk"]}, {"kanaIn": "くあります", "kanaOut": "い", "rulesIn": ["v"], "rulesOut": ["adj-i"]} ], - "polite past negative": [ - {"kanaIn": "くありませんでした", "kanaOut": "い", "rulesIn": [], "rulesOut": ["adj-i"]}, - {"kanaIn": "ませんでした", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v1"]}, - {"kanaIn": "いませんでした", "kanaOut": "う", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "きませんでした", "kanaOut": "く", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ぎませんでした", "kanaOut": "ぐ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "しませんでした", "kanaOut": "す", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ちませんでした", "kanaOut": "つ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "にませんでした", "kanaOut": "ぬ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "びませんでした", "kanaOut": "ぶ", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "みませんでした", "kanaOut": "む", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "りませんでした", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "じませんでした", "kanaOut": "ずる", "rulesIn": [], "rulesOut": ["vz"]}, - {"kanaIn": "しませんでした", "kanaOut": "する", "rulesIn": [], "rulesOut": ["vs"]}, - {"kanaIn": "為ませんでした", "kanaOut": "為る", "rulesIn": [], "rulesOut": ["vs"]}, - {"kanaIn": "きませんでした", "kanaOut": "くる", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "来ませんでした", "kanaOut": "来る", "rulesIn": [], "rulesOut": ["vk"]}, - {"kanaIn": "來ませんでした", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]} - ], "potential": [ {"kanaIn": "れる", "kanaOut": "る", "rulesIn": ["v1"], "rulesOut": ["v1", "v5"]}, {"kanaIn": "える", "kanaOut": "う", "rulesIn": ["v1"], "rulesOut": ["v5"]}, diff --git a/test/data/anki-note-builder-test-results.json b/test/data/anki-note-builder-test-results.json index a48012453f..e2afc4f7b9 100644 --- a/test/data/anki-note-builder-test-results.json +++ b/test/data/anki-note-builder-test-results.json @@ -1506,7 +1506,7 @@ "cloze-body": "打ち込んでいませんでした", "cloze-prefix": "cloze-prefix", "cloze-suffix": "cloze-suffix", - "conjugation": "-te « progressive or perfect « polite past negative", + "conjugation": "-te « progressive or perfect « polite « negative « past", "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", @@ -1537,7 +1537,7 @@ "cloze-body": "打ち込んでいませんでした", "cloze-prefix": "cloze-prefix", "cloze-suffix": "cloze-suffix", - "conjugation": "-te « progressive or perfect « polite past negative", + "conjugation": "-te « progressive or perfect « polite « negative « past", "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", @@ -1568,7 +1568,7 @@ "cloze-body": "打ち込んでいませんでした", "cloze-prefix": "cloze-prefix", "cloze-suffix": "cloze-suffix", - "conjugation": "-te « progressive or perfect « polite past negative", + "conjugation": "-te « progressive or perfect « polite « negative « past", "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", @@ -1599,7 +1599,7 @@ "cloze-body": "打ち込んでいませんでした", "cloze-prefix": "cloze-prefix", "cloze-suffix": "cloze-suffix", - "conjugation": "-te « progressive or perfect « polite past negative", + "conjugation": "-te « progressive or perfect « polite « negative « past", "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", diff --git a/test/data/translator-test-results-note-data1.json b/test/data/translator-test-results-note-data1.json index edbb5fd6de..db72bfbb32 100644 --- a/test/data/translator-test-results-note-data1.json +++ b/test/data/translator-test-results-note-data1.json @@ -15759,7 +15759,9 @@ "inflectionRules": [ "-te", "progressive or perfect", - "polite past negative" + "polite", + "negative", + "past" ] } ], @@ -16182,7 +16184,9 @@ "inflectionRules": [ "-te", "progressive or perfect", - "polite past negative" + "polite", + "negative", + "past" ] } ], @@ -16605,7 +16609,9 @@ "inflectionRules": [ "-te", "progressive or perfect", - "polite past negative" + "polite", + "negative", + "past" ] } ], @@ -17028,7 +17034,9 @@ "inflectionRules": [ "-te", "progressive or perfect", - "polite past negative" + "polite", + "negative", + "past" ] } ], diff --git a/test/data/translator-test-results.json b/test/data/translator-test-results.json index 9af21430af..ec03e44ca6 100644 --- a/test/data/translator-test-results.json +++ b/test/data/translator-test-results.json @@ -9424,7 +9424,9 @@ "inflectionRules": [ "-te", "progressive or perfect", - "polite past negative" + "polite", + "negative", + "past" ] } ], @@ -9622,7 +9624,9 @@ "inflectionRules": [ "-te", "progressive or perfect", - "polite past negative" + "polite", + "negative", + "past" ] } ], @@ -9820,7 +9824,9 @@ "inflectionRules": [ "-te", "progressive or perfect", - "polite past negative" + "polite", + "negative", + "past" ] } ], @@ -10018,7 +10024,9 @@ "inflectionRules": [ "-te", "progressive or perfect", - "polite past negative" + "polite", + "negative", + "past" ] } ], diff --git a/test/deinflector.test.js b/test/deinflector.test.js index 697244cbe6..61161923ff 100644 --- a/test/deinflector.test.js +++ b/test/deinflector.test.js @@ -78,7 +78,7 @@ function testDeinflections() { {term: '愛しい', source: '愛しさ', rule: 'adj-i', reasons: ['noun']}, {term: '愛しい', source: '愛しかった', rule: 'adj-i', reasons: ['past']}, {term: '愛しい', source: '愛しくありません', rule: 'adj-i', reasons: ['polite', 'negative']}, - {term: '愛しい', source: '愛しくありませんでした', rule: 'adj-i', reasons: ['polite past negative']}, + {term: '愛しい', source: '愛しくありませんでした', rule: 'adj-i', reasons: ['polite', 'negative', 'past']}, {term: '愛しい', source: '愛しき', rule: 'adj-i', reasons: ['-ki']}, {term: '愛しい', source: '愛しげ', rule: 'adj-i', reasons: ['-ge']}, @@ -96,7 +96,7 @@ function testDeinflections() { {term: '食べる', source: '食べない', rule: 'v1', reasons: ['negative']}, {term: '食べる', source: '食べません', rule: 'v1', reasons: ['polite', 'negative']}, {term: '食べる', source: '食べなかった', rule: 'v1', reasons: ['negative', 'past']}, - {term: '食べる', source: '食べませんでした', rule: 'v1', reasons: ['polite past negative']}, + {term: '食べる', source: '食べませんでした', rule: 'v1', reasons: ['polite', 'negative', 'past']}, {term: '食べる', source: '食べなくて', rule: 'v1', reasons: ['negative', '-te']}, {term: '食べる', source: '食べられない', rule: 'v1', reasons: ['potential or passive', 'negative']}, {term: '食べる', source: '食べられない', rule: 'v1', reasons: ['potential or passive', 'negative']}, @@ -140,7 +140,7 @@ function testDeinflections() { {term: '買う', source: '買わない', rule: 'v5', reasons: ['negative']}, {term: '買う', source: '買いません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '買う', source: '買わなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '買う', source: '買いませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '買う', source: '買いませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '買う', source: '買わなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '買う', source: '買えない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '買う', source: '買われない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -183,7 +183,7 @@ function testDeinflections() { {term: '行く', source: '行かない', rule: 'v5', reasons: ['negative']}, {term: '行く', source: '行きません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '行く', source: '行かなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '行く', source: '行きませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '行く', source: '行きませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '行く', source: '行かなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '行く', source: '行けない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '行く', source: '行かれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -226,7 +226,7 @@ function testDeinflections() { {term: '泳ぐ', source: '泳がない', rule: 'v5', reasons: ['negative']}, {term: '泳ぐ', source: '泳ぎません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '泳ぐ', source: '泳がなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '泳ぐ', source: '泳ぎませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '泳ぐ', source: '泳ぎませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '泳ぐ', source: '泳がなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '泳ぐ', source: '泳げない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '泳ぐ', source: '泳がれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -268,7 +268,7 @@ function testDeinflections() { {term: '話す', source: '話さない', rule: 'v5', reasons: ['negative']}, {term: '話す', source: '話しません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '話す', source: '話さなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '話す', source: '話しませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '話す', source: '話しませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '話す', source: '話さなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '話す', source: '話せない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '話す', source: '話されない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -311,7 +311,7 @@ function testDeinflections() { {term: '待つ', source: '待たない', rule: 'v5', reasons: ['negative']}, {term: '待つ', source: '待ちません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '待つ', source: '待たなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '待つ', source: '待ちませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '待つ', source: '待ちませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '待つ', source: '待たなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '待つ', source: '待てない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '待つ', source: '待たれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -354,7 +354,7 @@ function testDeinflections() { {term: '死ぬ', source: '死なない', rule: 'v5', reasons: ['negative']}, {term: '死ぬ', source: '死にません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '死ぬ', source: '死ななかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '死ぬ', source: '死にませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '死ぬ', source: '死にませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '死ぬ', source: '死ななくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '死ぬ', source: '死ねない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '死ぬ', source: '死なれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -396,7 +396,7 @@ function testDeinflections() { {term: '遊ぶ', source: '遊ばない', rule: 'v5', reasons: ['negative']}, {term: '遊ぶ', source: '遊びません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '遊ぶ', source: '遊ばなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '遊ぶ', source: '遊びませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '遊ぶ', source: '遊びませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '遊ぶ', source: '遊ばなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '遊ぶ', source: '遊べない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '遊ぶ', source: '遊ばれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -438,7 +438,7 @@ function testDeinflections() { {term: '飲む', source: '飲まない', rule: 'v5', reasons: ['negative']}, {term: '飲む', source: '飲みません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '飲む', source: '飲まなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '飲む', source: '飲みませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '飲む', source: '飲みませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '飲む', source: '飲まなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '飲む', source: '飲めない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '飲む', source: '飲まれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -480,7 +480,7 @@ function testDeinflections() { {term: '作る', source: '作らない', rule: 'v5', reasons: ['negative']}, {term: '作る', source: '作りません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '作る', source: '作らなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '作る', source: '作りませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '作る', source: '作りませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '作る', source: '作らなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '作る', source: '作れない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '作る', source: '作られない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -526,7 +526,7 @@ function testDeinflections() { {term: '為る', source: '為ない', rule: 'vs', reasons: ['negative']}, {term: '為る', source: '為ません', rule: 'vs', reasons: ['polite', 'negative']}, {term: '為る', source: '為なかった', rule: 'vs', reasons: ['negative', 'past']}, - {term: '為る', source: '為ませんでした', rule: 'vs', reasons: ['polite past negative']}, + {term: '為る', source: '為ませんでした', rule: 'vs', reasons: ['polite', 'negative', 'past']}, {term: '為る', source: '為なくて', rule: 'vs', reasons: ['negative', '-te']}, {term: '為る', source: '為られない', rule: 'vs', reasons: ['potential or passive', 'negative']}, {term: '為る', source: '為れない', rule: 'vs', reasons: ['passive', 'negative']}, @@ -575,7 +575,7 @@ function testDeinflections() { {term: 'する', source: 'しない', rule: 'vs', reasons: ['negative']}, {term: 'する', source: 'しません', rule: 'vs', reasons: ['polite', 'negative']}, {term: 'する', source: 'しなかった', rule: 'vs', reasons: ['negative', 'past']}, - {term: 'する', source: 'しませんでした', rule: 'vs', reasons: ['polite past negative']}, + {term: 'する', source: 'しませんでした', rule: 'vs', reasons: ['polite', 'negative', 'past']}, {term: 'する', source: 'しなくて', rule: 'vs', reasons: ['negative', '-te']}, {term: 'する', source: 'せられない', rule: 'vs', reasons: ['potential or passive', 'negative']}, {term: 'する', source: 'されない', rule: 'vs', reasons: ['passive', 'negative']}, @@ -620,7 +620,7 @@ function testDeinflections() { {term: '来る', source: '来ない', rule: 'vk', reasons: ['negative']}, {term: '来る', source: '来ません', rule: 'vk', reasons: ['polite', 'negative']}, {term: '来る', source: '来なかった', rule: 'vk', reasons: ['negative', 'past']}, - {term: '来る', source: '来ませんでした', rule: 'vk', reasons: ['polite past negative']}, + {term: '来る', source: '来ませんでした', rule: 'vk', reasons: ['polite', 'negative', 'past']}, {term: '来る', source: '来なくて', rule: 'vk', reasons: ['negative', '-te']}, {term: '来る', source: '来られない', rule: 'vk', reasons: ['potential or passive', 'negative']}, {term: '来る', source: '来られない', rule: 'vk', reasons: ['potential or passive', 'negative']}, @@ -663,7 +663,7 @@ function testDeinflections() { {term: '來る', source: '來ない', rule: 'vk', reasons: ['negative']}, {term: '來る', source: '來ません', rule: 'vk', reasons: ['polite', 'negative']}, {term: '來る', source: '來なかった', rule: 'vk', reasons: ['negative', 'past']}, - {term: '來る', source: '來ませんでした', rule: 'vk', reasons: ['polite past negative']}, + {term: '來る', source: '來ませんでした', rule: 'vk', reasons: ['polite', 'negative', 'past']}, {term: '來る', source: '來なくて', rule: 'vk', reasons: ['negative', '-te']}, {term: '來る', source: '來られない', rule: 'vk', reasons: ['potential or passive', 'negative']}, {term: '來る', source: '來られない', rule: 'vk', reasons: ['potential or passive', 'negative']}, @@ -706,7 +706,7 @@ function testDeinflections() { {term: 'くる', source: 'こない', rule: 'vk', reasons: ['negative']}, {term: 'くる', source: 'きません', rule: 'vk', reasons: ['polite', 'negative']}, {term: 'くる', source: 'こなかった', rule: 'vk', reasons: ['negative', 'past']}, - {term: 'くる', source: 'きませんでした', rule: 'vk', reasons: ['polite past negative']}, + {term: 'くる', source: 'きませんでした', rule: 'vk', reasons: ['polite', 'negative', 'past']}, {term: 'くる', source: 'こなくて', rule: 'vk', reasons: ['negative', '-te']}, {term: 'くる', source: 'こられない', rule: 'vk', reasons: ['potential or passive', 'negative']}, {term: 'くる', source: 'こられない', rule: 'vk', reasons: ['potential or passive', 'negative']}, @@ -754,7 +754,7 @@ function testDeinflections() { {term: '論ずる', source: '論じない', rule: 'vz', reasons: ['negative']}, {term: '論ずる', source: '論じません', rule: 'vz', reasons: ['polite', 'negative']}, {term: '論ずる', source: '論じなかった', rule: 'vz', reasons: ['negative', 'past']}, - {term: '論ずる', source: '論じませんでした', rule: 'vz', reasons: ['polite past negative']}, + {term: '論ずる', source: '論じませんでした', rule: 'vz', reasons: ['polite', 'negative', 'past']}, {term: '論ずる', source: '論じなくて', rule: 'vz', reasons: ['negative', '-te']}, {term: '論ずる', source: '論ぜられない', rule: 'vz', reasons: ['potential or passive', 'negative']}, {term: '論ずる', source: '論じされない', rule: 'vz', reasons: ['passive', 'negative']}, @@ -852,7 +852,7 @@ function testDeinflections() { // Combinations {term: '抱き抱える', source: '抱き抱えていなければ', rule: 'v1', reasons: ['-te', 'progressive or perfect', 'negative', '-ba']}, {term: '抱きかかえる', source: '抱きかかえていなければ', rule: 'v1', reasons: ['-te', 'progressive or perfect', 'negative', '-ba']}, - {term: '打ち込む', source: '打ち込んでいませんでした', rule: 'v5', reasons: ['-te', 'progressive or perfect', 'polite past negative']}, + {term: '打ち込む', source: '打ち込んでいませんでした', rule: 'v5', reasons: ['-te', 'progressive or perfect', 'polite', 'negative', 'past']}, {term: '食べる', source: '食べさせられたくなかった', rule: 'v1', reasons: ['causative', 'potential or passive', '-tai', 'negative', 'past']} ] }, From c66bed0802dfdc8bc6d6f7b8245f20d299575af6 Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Thu, 25 Jan 2024 16:04:15 +0100 Subject: [PATCH 08/12] remove unneeded rules in --- ext/data/deinflect.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/data/deinflect.json b/ext/data/deinflect.json index 075900b105..fef30c627b 100644 --- a/ext/data/deinflect.json +++ b/ext/data/deinflect.json @@ -436,7 +436,7 @@ {"kanaIn": "副うた", "kanaOut": "副う", "rulesIn": [], "rulesOut": ["v5"]}, {"kanaIn": "厭うた", "kanaOut": "厭う", "rulesIn": [], "rulesOut": ["v5"]}, {"kanaIn": "のたもうた", "kanaOut": "のたまう", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "ませんでした", "kanaOut": "ません", "rulesIn": ["v"], "rulesOut": ["v"]} + {"kanaIn": "ませんでした", "kanaOut": "ません", "rulesIn": [], "rulesOut": ["v"]} ], "polite": [ {"kanaIn": "ます", "kanaOut": "る", "rulesIn": ["v"], "rulesOut": ["v1"]}, From 9c11e62b4a78654e7ff1797efb9dcc85ea350b12 Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Sat, 3 Feb 2024 13:32:55 +0100 Subject: [PATCH 09/12] new deinflector format --- ext/data/language/japanese-transforms.json | 109 +++-------------- test/language-transformer.test.js | 134 ++++++++++----------- 2 files changed, 86 insertions(+), 157 deletions(-) diff --git a/ext/data/language/japanese-transforms.json b/ext/data/language/japanese-transforms.json index 007b140422..42c26b5a3f 100644 --- a/ext/data/language/japanese-transforms.json +++ b/ext/data/language/japanese-transforms.json @@ -1,6 +1,17 @@ { "language": "ja", "conditions": { + "v": { + "name": "Verb", + "partsOfSpeech": ["v1", "v5", "vk", "vs", "vz"], + "i18n": [ + { + "language": "ja", + "name": "動詞" + } + ], + "subConditions": ["v1", "v5", "vk", "vs", "vz"] + }, "v1": { "name": "Ichidan verb", "partsOfSpeech": ["v1"], @@ -468,7 +479,7 @@ { "name": "imperative negative", "rules": [ - {"suffixIn": "な", "suffixOut": "", "conditionsIn": [], "conditionsOut": ["v1", "v5", "vk", "vs", "vz"]} + {"suffixIn": "な", "suffixOut": "", "conditionsIn": [], "conditionsOut": ["v"]} ] }, { @@ -529,7 +540,8 @@ {"suffixIn": "為ない", "suffixOut": "為る", "conditionsIn": ["adj-i"], "conditionsOut": ["vs"]}, {"suffixIn": "こない", "suffixOut": "くる", "conditionsIn": ["adj-i"], "conditionsOut": ["vk"]}, {"suffixIn": "来ない", "suffixOut": "来る", "conditionsIn": ["adj-i"], "conditionsOut": ["vk"]}, - {"suffixIn": "來ない", "suffixOut": "來る", "conditionsIn": ["adj-i"], "conditionsOut": ["vk"]} + {"suffixIn": "來ない", "suffixOut": "來る", "conditionsIn": ["adj-i"], "conditionsOut": ["vk"]}, + {"suffixIn": "ません", "suffixOut": "ます", "conditionsIn": ["v"], "conditionsOut": ["v"]} ] }, { @@ -596,7 +608,8 @@ {"suffixIn": "添うた", "suffixOut": "添う", "conditionsIn": [], "conditionsOut": ["v5"]}, {"suffixIn": "副うた", "suffixOut": "副う", "conditionsIn": [], "conditionsOut": ["v5"]}, {"suffixIn": "厭うた", "suffixOut": "厭う", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "のたもうた", "suffixOut": "のたまう", "conditionsIn": [], "conditionsOut": ["v5"]} + {"suffixIn": "のたもうた", "suffixOut": "のたまう", "conditionsIn": [], "conditionsOut": ["v5"]}, + {"suffixIn": "ませんでした", "suffixOut": "ません", "conditionsIn": [], "conditionsOut": ["v"]} ] }, { @@ -620,92 +633,7 @@ {"suffixIn": "來ます", "suffixOut": "來る", "conditionsIn": [], "conditionsOut": ["vk"]} ] }, - { - "name": "polite negative", - "rules": [ - {"suffixIn": "くありません", "suffixOut": "い", "conditionsIn": [], "conditionsOut": ["adj-i"]}, - {"suffixIn": "ません", "suffixOut": "る", "conditionsIn": [], "conditionsOut": ["v1"]}, - {"suffixIn": "いません", "suffixOut": "う", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "きません", "suffixOut": "く", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ぎません", "suffixOut": "ぐ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "しません", "suffixOut": "す", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ちません", "suffixOut": "つ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "にません", "suffixOut": "ぬ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "びません", "suffixOut": "ぶ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "みません", "suffixOut": "む", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "りません", "suffixOut": "る", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "じません", "suffixOut": "ずる", "conditionsIn": [], "conditionsOut": ["vz"]}, - {"suffixIn": "しません", "suffixOut": "する", "conditionsIn": [], "conditionsOut": ["vs"]}, - {"suffixIn": "為ません", "suffixOut": "為る", "conditionsIn": [], "conditionsOut": ["vs"]}, - {"suffixIn": "きません", "suffixOut": "くる", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "来ません", "suffixOut": "来る", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "來ません", "suffixOut": "來る", "conditionsIn": [], "conditionsOut": ["vk"]} - ] - }, - { - "name": "polite past", - "rules": [ - {"suffixIn": "ました", "suffixOut": "る", "conditionsIn": [], "conditionsOut": ["v1"]}, - {"suffixIn": "いました", "suffixOut": "う", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "きました", "suffixOut": "く", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ぎました", "suffixOut": "ぐ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "しました", "suffixOut": "す", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ちました", "suffixOut": "つ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "にました", "suffixOut": "ぬ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "びました", "suffixOut": "ぶ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "みました", "suffixOut": "む", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "りました", "suffixOut": "る", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "じました", "suffixOut": "ずる", "conditionsIn": [], "conditionsOut": ["vz"]}, - {"suffixIn": "しました", "suffixOut": "する", "conditionsIn": [], "conditionsOut": ["vs"]}, - {"suffixIn": "為ました", "suffixOut": "為る", "conditionsIn": [], "conditionsOut": ["vs"]}, - {"suffixIn": "きました", "suffixOut": "くる", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "来ました", "suffixOut": "来る", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "來ました", "suffixOut": "來る", "conditionsIn": [], "conditionsOut": ["vk"]} - ] - }, - { - "name": "polite past negative", - "rules": [ - {"suffixIn": "くありませんでした", "suffixOut": "い", "conditionsIn": [], "conditionsOut": ["adj-i"]}, - {"suffixIn": "ませんでした", "suffixOut": "る", "conditionsIn": [], "conditionsOut": ["v1"]}, - {"suffixIn": "いませんでした", "suffixOut": "う", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "きませんでした", "suffixOut": "く", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ぎませんでした", "suffixOut": "ぐ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "しませんでした", "suffixOut": "す", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ちませんでした", "suffixOut": "つ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "にませんでした", "suffixOut": "ぬ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "びませんでした", "suffixOut": "ぶ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "みませんでした", "suffixOut": "む", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "りませんでした", "suffixOut": "る", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "じませんでした", "suffixOut": "ずる", "conditionsIn": [], "conditionsOut": ["vz"]}, - {"suffixIn": "しませんでした", "suffixOut": "する", "conditionsIn": [], "conditionsOut": ["vs"]}, - {"suffixIn": "為ませんでした", "suffixOut": "為る", "conditionsIn": [], "conditionsOut": ["vs"]}, - {"suffixIn": "きませんでした", "suffixOut": "くる", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "来ませんでした", "suffixOut": "来る", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "來ませんでした", "suffixOut": "來る", "conditionsIn": [], "conditionsOut": ["vk"]} - ] - }, - { - "name": "polite volitional", - "rules": [ - {"suffixIn": "ましょう", "suffixOut": "る", "conditionsIn": [], "conditionsOut": ["v1"]}, - {"suffixIn": "いましょう", "suffixOut": "う", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "きましょう", "suffixOut": "く", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ぎましょう", "suffixOut": "ぐ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "しましょう", "suffixOut": "す", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ちましょう", "suffixOut": "つ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "にましょう", "suffixOut": "ぬ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "びましょう", "suffixOut": "ぶ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "みましょう", "suffixOut": "む", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "りましょう", "suffixOut": "る", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "じましょう", "suffixOut": "ずる", "conditionsIn": [], "conditionsOut": ["vz"]}, - {"suffixIn": "しましょう", "suffixOut": "する", "conditionsIn": [], "conditionsOut": ["vs"]}, - {"suffixIn": "為ましょう", "suffixOut": "為る", "conditionsIn": [], "conditionsOut": ["vs"]}, - {"suffixIn": "きましょう", "suffixOut": "くる", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "来ましょう", "suffixOut": "来る", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "來ましょう", "suffixOut": "來る", "conditionsIn": [], "conditionsOut": ["vk"]} - ] - }, + { "name": "potential", "rules": [ @@ -756,7 +684,8 @@ {"suffixIn": "為よう", "suffixOut": "為る", "conditionsIn": [], "conditionsOut": ["vs"]}, {"suffixIn": "こよう", "suffixOut": "くる", "conditionsIn": [], "conditionsOut": ["vk"]}, {"suffixIn": "来よう", "suffixOut": "来る", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "來よう", "suffixOut": "來る", "conditionsIn": [], "conditionsOut": ["vk"]} + {"suffixIn": "來よう", "suffixOut": "來る", "conditionsIn": [], "conditionsOut": ["vk"]}, + {"suffixIn": "ましょう", "suffixOut": "ます", "conditionsIn": [], "conditionsOut": ["v"]} ] }, { diff --git a/test/language-transformer.test.js b/test/language-transformer.test.js index b99c1befcd..66b282586b 100644 --- a/test/language-transformer.test.js +++ b/test/language-transformer.test.js @@ -80,8 +80,8 @@ function testDeinflections() { {term: '愛しい', source: '愛しくない', rule: 'adj-i', reasons: ['negative']}, {term: '愛しい', source: '愛しさ', rule: 'adj-i', reasons: ['noun']}, {term: '愛しい', source: '愛しかった', rule: 'adj-i', reasons: ['past']}, - {term: '愛しい', source: '愛しくありません', rule: 'adj-i', reasons: ['polite negative']}, - {term: '愛しい', source: '愛しくありませんでした', rule: 'adj-i', reasons: ['polite past negative']}, + {term: '愛しい', source: '愛しくありません', rule: 'adj-i', reasons: ['polite', 'negative']}, + {term: '愛しい', source: '愛しくありませんでした', rule: 'adj-i', reasons: ['polite', 'negative', 'past']}, {term: '愛しい', source: '愛しき', rule: 'adj-i', reasons: ['-ki']}, {term: '愛しい', source: '愛しげ', rule: 'adj-i', reasons: ['-ge']} ] @@ -93,7 +93,7 @@ function testDeinflections() { {term: '食べる', source: '食べる', rule: 'v1', reasons: []}, {term: '食べる', source: '食べます', rule: 'v1', reasons: ['polite']}, {term: '食べる', source: '食べた', rule: 'v1', reasons: ['past']}, - {term: '食べる', source: '食べました', rule: 'v1', reasons: ['polite past']}, + {term: '食べる', source: '食べました', rule: 'v1', reasons: ['polite', 'past']}, {term: '食べる', source: '食べて', rule: 'v1', reasons: ['-te']}, {term: '食べる', source: '食べられる', rule: 'v1', reasons: ['potential or passive']}, {term: '食べる', source: '食べられる', rule: 'v1', reasons: ['potential or passive']}, @@ -101,9 +101,9 @@ function testDeinflections() { {term: '食べる', source: '食べさせられる', rule: 'v1', reasons: ['causative', 'potential or passive']}, {term: '食べる', source: '食べろ', rule: 'v1', reasons: ['imperative']}, {term: '食べる', source: '食べない', rule: 'v1', reasons: ['negative']}, - {term: '食べる', source: '食べません', rule: 'v1', reasons: ['polite negative']}, + {term: '食べる', source: '食べません', rule: 'v1', reasons: ['polite', 'negative']}, {term: '食べる', source: '食べなかった', rule: 'v1', reasons: ['negative', 'past']}, - {term: '食べる', source: '食べませんでした', rule: 'v1', reasons: ['polite past negative']}, + {term: '食べる', source: '食べませんでした', rule: 'v1', reasons: ['polite', 'negative', 'past']}, {term: '食べる', source: '食べなくて', rule: 'v1', reasons: ['negative', '-te']}, {term: '食べる', source: '食べられない', rule: 'v1', reasons: ['potential or passive', 'negative']}, {term: '食べる', source: '食べられない', rule: 'v1', reasons: ['potential or passive', 'negative']}, @@ -123,7 +123,7 @@ function testDeinflections() { {term: '食べる', source: '食べず', rule: 'v1', reasons: ['-zu']}, {term: '食べる', source: '食べぬ', rule: 'v1', reasons: ['-nu']}, {term: '食べる', source: '食べ', rule: 'v1d', reasons: ['masu stem']}, - {term: '食べる', source: '食べましょう', rule: 'v1', reasons: ['polite volitional']}, + {term: '食べる', source: '食べましょう', rule: 'v1', reasons: ['polite', 'volitional']}, {term: '食べる', source: '食べよう', rule: 'v1', reasons: ['volitional']}, // ['causative passive'] {term: '食べる', source: '食べとく', rule: 'v1', reasons: ['-toku']}, @@ -141,7 +141,7 @@ function testDeinflections() { {term: '買う', source: '買う', rule: 'v5', reasons: []}, {term: '買う', source: '買います', rule: 'v5', reasons: ['polite']}, {term: '買う', source: '買った', rule: 'v5', reasons: ['past']}, - {term: '買う', source: '買いました', rule: 'v5', reasons: ['polite past']}, + {term: '買う', source: '買いました', rule: 'v5', reasons: ['polite', 'past']}, {term: '買う', source: '買って', rule: 'v5', reasons: ['-te']}, {term: '買う', source: '買える', rule: 'v5', reasons: ['potential']}, {term: '買う', source: '買われる', rule: 'v5', reasons: ['passive']}, @@ -149,9 +149,9 @@ function testDeinflections() { {term: '買う', source: '買わせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '買う', source: '買え', rule: 'v5', reasons: ['imperative']}, {term: '買う', source: '買わない', rule: 'v5', reasons: ['negative']}, - {term: '買う', source: '買いません', rule: 'v5', reasons: ['polite negative']}, + {term: '買う', source: '買いません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '買う', source: '買わなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '買う', source: '買いませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '買う', source: '買いませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '買う', source: '買わなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '買う', source: '買えない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '買う', source: '買われない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -171,7 +171,7 @@ function testDeinflections() { {term: '買う', source: '買わず', rule: 'v5', reasons: ['-zu']}, {term: '買う', source: '買わぬ', rule: 'v5', reasons: ['-nu']}, {term: '買う', source: '買い', rule: 'v5', reasons: ['masu stem']}, - {term: '買う', source: '買いましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '買う', source: '買いましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '買う', source: '買おう', rule: 'v5', reasons: ['volitional']}, {term: '買う', source: '買わされる', rule: 'v5', reasons: ['causative passive']}, {term: '買う', source: '買っとく', rule: 'v5', reasons: ['-toku']}, @@ -189,7 +189,7 @@ function testDeinflections() { {term: '行く', source: '行く', rule: 'v5', reasons: []}, {term: '行く', source: '行きます', rule: 'v5', reasons: ['polite']}, {term: '行く', source: '行った', rule: 'v5', reasons: ['past']}, - {term: '行く', source: '行きました', rule: 'v5', reasons: ['polite past']}, + {term: '行く', source: '行きました', rule: 'v5', reasons: ['polite', 'past']}, {term: '行く', source: '行って', rule: 'v5', reasons: ['-te']}, {term: '行く', source: '行ける', rule: 'v5', reasons: ['potential']}, {term: '行く', source: '行かれる', rule: 'v5', reasons: ['passive']}, @@ -197,9 +197,9 @@ function testDeinflections() { {term: '行く', source: '行かせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '行く', source: '行け', rule: 'v5', reasons: ['imperative']}, {term: '行く', source: '行かない', rule: 'v5', reasons: ['negative']}, - {term: '行く', source: '行きません', rule: 'v5', reasons: ['polite negative']}, + {term: '行く', source: '行きません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '行く', source: '行かなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '行く', source: '行きませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '行く', source: '行きませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '行く', source: '行かなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '行く', source: '行けない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '行く', source: '行かれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -219,7 +219,7 @@ function testDeinflections() { {term: '行く', source: '行かず', rule: 'v5', reasons: ['-zu']}, {term: '行く', source: '行かぬ', rule: 'v5', reasons: ['-nu']}, {term: '行く', source: '行き', rule: 'v5', reasons: ['masu stem']}, - {term: '行く', source: '行きましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '行く', source: '行きましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '行く', source: '行こう', rule: 'v5', reasons: ['volitional']}, {term: '行く', source: '行かされる', rule: 'v5', reasons: ['causative passive']}, {term: '行く', source: '行いとく', rule: 'v5', reasons: ['-toku']}, @@ -237,7 +237,7 @@ function testDeinflections() { {term: '泳ぐ', source: '泳ぐ', rule: 'v5', reasons: []}, {term: '泳ぐ', source: '泳ぎます', rule: 'v5', reasons: ['polite']}, {term: '泳ぐ', source: '泳いだ', rule: 'v5', reasons: ['past']}, - {term: '泳ぐ', source: '泳ぎました', rule: 'v5', reasons: ['polite past']}, + {term: '泳ぐ', source: '泳ぎました', rule: 'v5', reasons: ['polite', 'past']}, {term: '泳ぐ', source: '泳いで', rule: 'v5', reasons: ['-te']}, {term: '泳ぐ', source: '泳げる', rule: 'v5', reasons: ['potential']}, {term: '泳ぐ', source: '泳がれる', rule: 'v5', reasons: ['passive']}, @@ -245,9 +245,9 @@ function testDeinflections() { {term: '泳ぐ', source: '泳がせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '泳ぐ', source: '泳げ', rule: 'v5', reasons: ['imperative']}, {term: '泳ぐ', source: '泳がない', rule: 'v5', reasons: ['negative']}, - {term: '泳ぐ', source: '泳ぎません', rule: 'v5', reasons: ['polite negative']}, + {term: '泳ぐ', source: '泳ぎません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '泳ぐ', source: '泳がなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '泳ぐ', source: '泳ぎませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '泳ぐ', source: '泳ぎませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '泳ぐ', source: '泳がなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '泳ぐ', source: '泳げない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '泳ぐ', source: '泳がれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -267,7 +267,7 @@ function testDeinflections() { {term: '泳ぐ', source: '泳がず', rule: 'v5', reasons: ['-zu']}, {term: '泳ぐ', source: '泳がぬ', rule: 'v5', reasons: ['-nu']}, {term: '泳ぐ', source: '泳ぎ', rule: 'v5', reasons: ['masu stem']}, - {term: '泳ぐ', source: '泳ぎましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '泳ぐ', source: '泳ぎましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '泳ぐ', source: '泳ごう', rule: 'v5', reasons: ['volitional']}, {term: '泳ぐ', source: '泳がされる', rule: 'v5', reasons: ['causative passive']}, {term: '泳ぐ', source: '泳いどく', rule: 'v5', reasons: ['-toku']}, @@ -284,7 +284,7 @@ function testDeinflections() { {term: '話す', source: '話す', rule: 'v5', reasons: []}, {term: '話す', source: '話します', rule: 'v5', reasons: ['polite']}, {term: '話す', source: '話した', rule: 'v5', reasons: ['past']}, - {term: '話す', source: '話しました', rule: 'v5', reasons: ['polite past']}, + {term: '話す', source: '話しました', rule: 'v5', reasons: ['polite', 'past']}, {term: '話す', source: '話して', rule: 'v5', reasons: ['-te']}, {term: '話す', source: '話せる', rule: 'v5', reasons: ['potential']}, {term: '話す', source: '話される', rule: 'v5', reasons: ['passive']}, @@ -292,9 +292,9 @@ function testDeinflections() { {term: '話す', source: '話させられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '話す', source: '話せ', rule: 'v5', reasons: ['imperative']}, {term: '話す', source: '話さない', rule: 'v5', reasons: ['negative']}, - {term: '話す', source: '話しません', rule: 'v5', reasons: ['polite negative']}, + {term: '話す', source: '話しません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '話す', source: '話さなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '話す', source: '話しませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '話す', source: '話しませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '話す', source: '話さなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '話す', source: '話せない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '話す', source: '話されない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -314,7 +314,7 @@ function testDeinflections() { {term: '話す', source: '話さず', rule: 'v5', reasons: ['-zu']}, {term: '話す', source: '話さぬ', rule: 'v5', reasons: ['-nu']}, {term: '話す', source: '話し', rule: 'v5', reasons: ['masu stem']}, - {term: '話す', source: '話しましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '話す', source: '話しましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '話す', source: '話そう', rule: 'v5', reasons: ['volitional']}, // ['causative passive'] {term: '話す', source: '話しとく', rule: 'v5', reasons: ['-toku']}, @@ -332,7 +332,7 @@ function testDeinflections() { {term: '待つ', source: '待つ', rule: 'v5', reasons: []}, {term: '待つ', source: '待ちます', rule: 'v5', reasons: ['polite']}, {term: '待つ', source: '待った', rule: 'v5', reasons: ['past']}, - {term: '待つ', source: '待ちました', rule: 'v5', reasons: ['polite past']}, + {term: '待つ', source: '待ちました', rule: 'v5', reasons: ['polite', 'past']}, {term: '待つ', source: '待って', rule: 'v5', reasons: ['-te']}, {term: '待つ', source: '待てる', rule: 'v5', reasons: ['potential']}, {term: '待つ', source: '待たれる', rule: 'v5', reasons: ['passive']}, @@ -340,9 +340,9 @@ function testDeinflections() { {term: '待つ', source: '待たせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '待つ', source: '待て', rule: 'v5', reasons: ['imperative']}, {term: '待つ', source: '待たない', rule: 'v5', reasons: ['negative']}, - {term: '待つ', source: '待ちません', rule: 'v5', reasons: ['polite negative']}, + {term: '待つ', source: '待ちません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '待つ', source: '待たなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '待つ', source: '待ちませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '待つ', source: '待ちませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '待つ', source: '待たなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '待つ', source: '待てない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '待つ', source: '待たれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -362,7 +362,7 @@ function testDeinflections() { {term: '待つ', source: '待たず', rule: 'v5', reasons: ['-zu']}, {term: '待つ', source: '待たぬ', rule: 'v5', reasons: ['-nu']}, {term: '待つ', source: '待ち', rule: 'v5', reasons: ['masu stem']}, - {term: '待つ', source: '待ちましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '待つ', source: '待ちましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '待つ', source: '待とう', rule: 'v5', reasons: ['volitional']}, {term: '待つ', source: '待たされる', rule: 'v5', reasons: ['causative passive']}, {term: '待つ', source: '待っとく', rule: 'v5', reasons: ['-toku']}, @@ -380,7 +380,7 @@ function testDeinflections() { {term: '死ぬ', source: '死ぬ', rule: 'v5', reasons: []}, {term: '死ぬ', source: '死にます', rule: 'v5', reasons: ['polite']}, {term: '死ぬ', source: '死んだ', rule: 'v5', reasons: ['past']}, - {term: '死ぬ', source: '死にました', rule: 'v5', reasons: ['polite past']}, + {term: '死ぬ', source: '死にました', rule: 'v5', reasons: ['polite', 'past']}, {term: '死ぬ', source: '死んで', rule: 'v5', reasons: ['-te']}, {term: '死ぬ', source: '死ねる', rule: 'v5', reasons: ['potential']}, {term: '死ぬ', source: '死なれる', rule: 'v5', reasons: ['passive']}, @@ -388,9 +388,9 @@ function testDeinflections() { {term: '死ぬ', source: '死なせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '死ぬ', source: '死ね', rule: 'v5', reasons: ['imperative']}, {term: '死ぬ', source: '死なない', rule: 'v5', reasons: ['negative']}, - {term: '死ぬ', source: '死にません', rule: 'v5', reasons: ['polite negative']}, + {term: '死ぬ', source: '死にません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '死ぬ', source: '死ななかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '死ぬ', source: '死にませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '死ぬ', source: '死にませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '死ぬ', source: '死ななくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '死ぬ', source: '死ねない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '死ぬ', source: '死なれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -410,7 +410,7 @@ function testDeinflections() { {term: '死ぬ', source: '死なず', rule: 'v5', reasons: ['-zu']}, {term: '死ぬ', source: '死なぬ', rule: 'v5', reasons: ['-nu']}, {term: '死ぬ', source: '死に', rule: 'v5', reasons: ['masu stem']}, - {term: '死ぬ', source: '死にましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '死ぬ', source: '死にましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '死ぬ', source: '死のう', rule: 'v5', reasons: ['volitional']}, {term: '死ぬ', source: '死なされる', rule: 'v5', reasons: ['causative passive']}, {term: '死ぬ', source: '死んどく', rule: 'v5', reasons: ['-toku']}, @@ -427,7 +427,7 @@ function testDeinflections() { {term: '遊ぶ', source: '遊ぶ', rule: 'v5', reasons: []}, {term: '遊ぶ', source: '遊びます', rule: 'v5', reasons: ['polite']}, {term: '遊ぶ', source: '遊んだ', rule: 'v5', reasons: ['past']}, - {term: '遊ぶ', source: '遊びました', rule: 'v5', reasons: ['polite past']}, + {term: '遊ぶ', source: '遊びました', rule: 'v5', reasons: ['polite', 'past']}, {term: '遊ぶ', source: '遊んで', rule: 'v5', reasons: ['-te']}, {term: '遊ぶ', source: '遊べる', rule: 'v5', reasons: ['potential']}, {term: '遊ぶ', source: '遊ばれる', rule: 'v5', reasons: ['passive']}, @@ -435,9 +435,9 @@ function testDeinflections() { {term: '遊ぶ', source: '遊ばせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '遊ぶ', source: '遊べ', rule: 'v5', reasons: ['imperative']}, {term: '遊ぶ', source: '遊ばない', rule: 'v5', reasons: ['negative']}, - {term: '遊ぶ', source: '遊びません', rule: 'v5', reasons: ['polite negative']}, + {term: '遊ぶ', source: '遊びません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '遊ぶ', source: '遊ばなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '遊ぶ', source: '遊びませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '遊ぶ', source: '遊びませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '遊ぶ', source: '遊ばなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '遊ぶ', source: '遊べない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '遊ぶ', source: '遊ばれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -457,7 +457,7 @@ function testDeinflections() { {term: '遊ぶ', source: '遊ばず', rule: 'v5', reasons: ['-zu']}, {term: '遊ぶ', source: '遊ばぬ', rule: 'v5', reasons: ['-nu']}, {term: '遊ぶ', source: '遊び', rule: 'v5', reasons: ['masu stem']}, - {term: '遊ぶ', source: '遊びましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '遊ぶ', source: '遊びましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '遊ぶ', source: '遊ぼう', rule: 'v5', reasons: ['volitional']}, {term: '遊ぶ', source: '遊ばされる', rule: 'v5', reasons: ['causative passive']}, {term: '遊ぶ', source: '遊んどく', rule: 'v5', reasons: ['-toku']}, @@ -474,7 +474,7 @@ function testDeinflections() { {term: '飲む', source: '飲む', rule: 'v5', reasons: []}, {term: '飲む', source: '飲みます', rule: 'v5', reasons: ['polite']}, {term: '飲む', source: '飲んだ', rule: 'v5', reasons: ['past']}, - {term: '飲む', source: '飲みました', rule: 'v5', reasons: ['polite past']}, + {term: '飲む', source: '飲みました', rule: 'v5', reasons: ['polite', 'past']}, {term: '飲む', source: '飲んで', rule: 'v5', reasons: ['-te']}, {term: '飲む', source: '飲める', rule: 'v5', reasons: ['potential']}, {term: '飲む', source: '飲まれる', rule: 'v5', reasons: ['passive']}, @@ -482,9 +482,9 @@ function testDeinflections() { {term: '飲む', source: '飲ませられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '飲む', source: '飲め', rule: 'v5', reasons: ['imperative']}, {term: '飲む', source: '飲まない', rule: 'v5', reasons: ['negative']}, - {term: '飲む', source: '飲みません', rule: 'v5', reasons: ['polite negative']}, + {term: '飲む', source: '飲みません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '飲む', source: '飲まなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '飲む', source: '飲みませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '飲む', source: '飲みませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '飲む', source: '飲まなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '飲む', source: '飲めない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '飲む', source: '飲まれない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -504,7 +504,7 @@ function testDeinflections() { {term: '飲む', source: '飲まず', rule: 'v5', reasons: ['-zu']}, {term: '飲む', source: '飲まぬ', rule: 'v5', reasons: ['-nu']}, {term: '飲む', source: '飲み', rule: 'v5', reasons: ['masu stem']}, - {term: '飲む', source: '飲みましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '飲む', source: '飲みましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '飲む', source: '飲もう', rule: 'v5', reasons: ['volitional']}, {term: '飲む', source: '飲まされる', rule: 'v5', reasons: ['causative passive']}, {term: '飲む', source: '飲んどく', rule: 'v5', reasons: ['-toku']}, @@ -521,7 +521,7 @@ function testDeinflections() { {term: '作る', source: '作る', rule: 'v5', reasons: []}, {term: '作る', source: '作ります', rule: 'v5', reasons: ['polite']}, {term: '作る', source: '作った', rule: 'v5', reasons: ['past']}, - {term: '作る', source: '作りました', rule: 'v5', reasons: ['polite past']}, + {term: '作る', source: '作りました', rule: 'v5', reasons: ['polite', 'past']}, {term: '作る', source: '作って', rule: 'v5', reasons: ['-te']}, {term: '作る', source: '作れる', rule: 'v5', reasons: ['potential']}, {term: '作る', source: '作られる', rule: 'v5', reasons: ['passive']}, @@ -529,9 +529,9 @@ function testDeinflections() { {term: '作る', source: '作らせられる', rule: 'v5', reasons: ['causative', 'potential or passive']}, {term: '作る', source: '作れ', rule: 'v5', reasons: ['imperative']}, {term: '作る', source: '作らない', rule: 'v5', reasons: ['negative']}, - {term: '作る', source: '作りません', rule: 'v5', reasons: ['polite negative']}, + {term: '作る', source: '作りません', rule: 'v5', reasons: ['polite', 'negative']}, {term: '作る', source: '作らなかった', rule: 'v5', reasons: ['negative', 'past']}, - {term: '作る', source: '作りませんでした', rule: 'v5', reasons: ['polite past negative']}, + {term: '作る', source: '作りませんでした', rule: 'v5', reasons: ['polite', 'negative', 'past']}, {term: '作る', source: '作らなくて', rule: 'v5', reasons: ['negative', '-te']}, {term: '作る', source: '作れない', rule: 'v5', reasons: ['potential', 'negative']}, {term: '作る', source: '作られない', rule: 'v5', reasons: ['passive', 'negative']}, @@ -551,7 +551,7 @@ function testDeinflections() { {term: '作る', source: '作らず', rule: 'v5', reasons: ['-zu']}, {term: '作る', source: '作らぬ', rule: 'v5', reasons: ['-nu']}, {term: '作る', source: '作り', rule: 'v5', reasons: ['masu stem']}, - {term: '作る', source: '作りましょう', rule: 'v5', reasons: ['polite volitional']}, + {term: '作る', source: '作りましょう', rule: 'v5', reasons: ['polite', 'volitional']}, {term: '作る', source: '作ろう', rule: 'v5', reasons: ['volitional']}, {term: '作る', source: '作らされる', rule: 'v5', reasons: ['causative passive']}, {term: '作る', source: '作っとく', rule: 'v5', reasons: ['-toku']}, @@ -569,7 +569,7 @@ function testDeinflections() { {term: '為る', source: '為る', rule: 'vs', reasons: []}, {term: '為る', source: '為ます', rule: 'vs', reasons: ['polite']}, {term: '為る', source: '為た', rule: 'vs', reasons: ['past']}, - {term: '為る', source: '為ました', rule: 'vs', reasons: ['polite past']}, + {term: '為る', source: '為ました', rule: 'vs', reasons: ['polite', 'past']}, {term: '為る', source: '為て', rule: 'vs', reasons: ['-te']}, {term: '為る', source: '為られる', rule: 'vs', reasons: ['potential or passive']}, {term: '為る', source: '為れる', rule: 'vs', reasons: ['passive']}, @@ -579,9 +579,9 @@ function testDeinflections() { {term: '為る', source: '為させられる', rule: 'vs', reasons: ['causative', 'potential or passive']}, {term: '為る', source: '為ろ', rule: 'vs', reasons: ['imperative']}, {term: '為る', source: '為ない', rule: 'vs', reasons: ['negative']}, - {term: '為る', source: '為ません', rule: 'vs', reasons: ['polite negative']}, + {term: '為る', source: '為ません', rule: 'vs', reasons: ['polite', 'negative']}, {term: '為る', source: '為なかった', rule: 'vs', reasons: ['negative', 'past']}, - {term: '為る', source: '為ませんでした', rule: 'vs', reasons: ['polite past negative']}, + {term: '為る', source: '為ませんでした', rule: 'vs', reasons: ['polite', 'negative', 'past']}, {term: '為る', source: '為なくて', rule: 'vs', reasons: ['negative', '-te']}, {term: '為る', source: '為られない', rule: 'vs', reasons: ['potential or passive', 'negative']}, {term: '為る', source: '為れない', rule: 'vs', reasons: ['passive', 'negative']}, @@ -603,7 +603,7 @@ function testDeinflections() { {term: '為る', source: '為ず', rule: 'vs', reasons: ['-zu']}, {term: '為る', source: '為ぬ', rule: 'vs', reasons: ['-nu']}, // ['masu stem'] - {term: '為る', source: '為ましょう', rule: 'vs', reasons: ['polite volitional']}, + {term: '為る', source: '為ましょう', rule: 'vs', reasons: ['polite', 'volitional']}, {term: '為る', source: '為よう', rule: 'vs', reasons: ['volitional']}, // ['causative passive'] {term: '為る', source: '為とく', rule: 'vs', reasons: ['-toku']}, @@ -616,7 +616,7 @@ function testDeinflections() { {term: 'する', source: 'する', rule: 'vs', reasons: []}, {term: 'する', source: 'します', rule: 'vs', reasons: ['polite']}, {term: 'する', source: 'した', rule: 'vs', reasons: ['past']}, - {term: 'する', source: 'しました', rule: 'vs', reasons: ['polite past']}, + {term: 'する', source: 'しました', rule: 'vs', reasons: ['polite', 'past']}, {term: 'する', source: 'して', rule: 'vs', reasons: ['-te']}, {term: 'する', source: 'できる', rule: 'vs', reasons: ['potential']}, {term: 'する', source: '出来る', rule: 'vs', reasons: ['potential']}, @@ -628,9 +628,9 @@ function testDeinflections() { {term: 'する', source: 'せさせられる', rule: 'vs', reasons: ['causative', 'potential or passive']}, {term: 'する', source: 'しろ', rule: 'vs', reasons: ['imperative']}, {term: 'する', source: 'しない', rule: 'vs', reasons: ['negative']}, - {term: 'する', source: 'しません', rule: 'vs', reasons: ['polite negative']}, + {term: 'する', source: 'しません', rule: 'vs', reasons: ['polite', 'negative']}, {term: 'する', source: 'しなかった', rule: 'vs', reasons: ['negative', 'past']}, - {term: 'する', source: 'しませんでした', rule: 'vs', reasons: ['polite past negative']}, + {term: 'する', source: 'しませんでした', rule: 'vs', reasons: ['polite', 'negative', 'past']}, {term: 'する', source: 'しなくて', rule: 'vs', reasons: ['negative', '-te']}, {term: 'する', source: 'せられない', rule: 'vs', reasons: ['potential or passive', 'negative']}, {term: 'する', source: 'されない', rule: 'vs', reasons: ['passive', 'negative']}, @@ -652,7 +652,7 @@ function testDeinflections() { {term: 'する', source: 'せず', rule: 'vs', reasons: ['-zu']}, {term: 'する', source: 'せぬ', rule: 'vs', reasons: ['-nu']}, // ['masu stem'] - {term: 'する', source: 'しましょう', rule: 'vs', reasons: ['polite volitional']}, + {term: 'する', source: 'しましょう', rule: 'vs', reasons: ['polite', 'volitional']}, {term: 'する', source: 'しよう', rule: 'vs', reasons: ['volitional']}, // ['causative passive'] {term: 'する', source: 'しとく', rule: 'vs', reasons: ['-toku']}, @@ -665,7 +665,7 @@ function testDeinflections() { {term: '来る', source: '来る', rule: 'vk', reasons: []}, {term: '来る', source: '来ます', rule: 'vk', reasons: ['polite']}, {term: '来る', source: '来た', rule: 'vk', reasons: ['past']}, - {term: '来る', source: '来ました', rule: 'vk', reasons: ['polite past']}, + {term: '来る', source: '来ました', rule: 'vk', reasons: ['polite', 'past']}, {term: '来る', source: '来て', rule: 'vk', reasons: ['-te']}, {term: '来る', source: '来られる', rule: 'vk', reasons: ['potential or passive']}, {term: '来る', source: '来られる', rule: 'vk', reasons: ['potential or passive']}, @@ -673,9 +673,9 @@ function testDeinflections() { {term: '来る', source: '来させられる', rule: 'vk', reasons: ['causative', 'potential or passive']}, {term: '来る', source: '来い', rule: 'vk', reasons: ['imperative']}, {term: '来る', source: '来ない', rule: 'vk', reasons: ['negative']}, - {term: '来る', source: '来ません', rule: 'vk', reasons: ['polite negative']}, + {term: '来る', source: '来ません', rule: 'vk', reasons: ['polite', 'negative']}, {term: '来る', source: '来なかった', rule: 'vk', reasons: ['negative', 'past']}, - {term: '来る', source: '来ませんでした', rule: 'vk', reasons: ['polite past negative']}, + {term: '来る', source: '来ませんでした', rule: 'vk', reasons: ['polite', 'negative', 'past']}, {term: '来る', source: '来なくて', rule: 'vk', reasons: ['negative', '-te']}, {term: '来る', source: '来られない', rule: 'vk', reasons: ['potential or passive', 'negative']}, {term: '来る', source: '来られない', rule: 'vk', reasons: ['potential or passive', 'negative']}, @@ -695,7 +695,7 @@ function testDeinflections() { {term: '来る', source: '来ず', rule: 'vk', reasons: ['-zu']}, {term: '来る', source: '来ぬ', rule: 'vk', reasons: ['-nu']}, {term: '来る', source: '来', rule: 'vk', reasons: ['masu stem']}, - {term: '来る', source: '来ましょう', rule: 'vk', reasons: ['polite volitional']}, + {term: '来る', source: '来ましょう', rule: 'vk', reasons: ['polite', 'volitional']}, {term: '来る', source: '来よう', rule: 'vk', reasons: ['volitional']}, // ['causative passive'] {term: '来る', source: '来とく', rule: 'vk', reasons: ['-toku']}, @@ -708,7 +708,7 @@ function testDeinflections() { {term: '來る', source: '來る', rule: 'vk', reasons: []}, {term: '來る', source: '來ます', rule: 'vk', reasons: ['polite']}, {term: '來る', source: '來た', rule: 'vk', reasons: ['past']}, - {term: '來る', source: '來ました', rule: 'vk', reasons: ['polite past']}, + {term: '來る', source: '來ました', rule: 'vk', reasons: ['polite', 'past']}, {term: '來る', source: '來て', rule: 'vk', reasons: ['-te']}, {term: '來る', source: '來られる', rule: 'vk', reasons: ['potential or passive']}, {term: '來る', source: '來られる', rule: 'vk', reasons: ['potential or passive']}, @@ -716,9 +716,9 @@ function testDeinflections() { {term: '來る', source: '來させられる', rule: 'vk', reasons: ['causative', 'potential or passive']}, {term: '來る', source: '來い', rule: 'vk', reasons: ['imperative']}, {term: '來る', source: '來ない', rule: 'vk', reasons: ['negative']}, - {term: '來る', source: '來ません', rule: 'vk', reasons: ['polite negative']}, + {term: '來る', source: '來ません', rule: 'vk', reasons: ['polite', 'negative']}, {term: '來る', source: '來なかった', rule: 'vk', reasons: ['negative', 'past']}, - {term: '來る', source: '來ませんでした', rule: 'vk', reasons: ['polite past negative']}, + {term: '來る', source: '來ませんでした', rule: 'vk', reasons: ['polite', 'negative', 'past']}, {term: '來る', source: '來なくて', rule: 'vk', reasons: ['negative', '-te']}, {term: '來る', source: '來られない', rule: 'vk', reasons: ['potential or passive', 'negative']}, {term: '來る', source: '來られない', rule: 'vk', reasons: ['potential or passive', 'negative']}, @@ -738,7 +738,7 @@ function testDeinflections() { {term: '來る', source: '來ず', rule: 'vk', reasons: ['-zu']}, {term: '來る', source: '來ぬ', rule: 'vk', reasons: ['-nu']}, {term: '來る', source: '來', rule: 'vk', reasons: ['masu stem']}, - {term: '來る', source: '來ましょう', rule: 'vk', reasons: ['polite volitional']}, + {term: '來る', source: '來ましょう', rule: 'vk', reasons: ['polite', 'volitional']}, {term: '來る', source: '來よう', rule: 'vk', reasons: ['volitional']}, // ['causative passive'] {term: '來る', source: '來とく', rule: 'vk', reasons: ['-toku']}, @@ -751,7 +751,7 @@ function testDeinflections() { {term: 'くる', source: 'くる', rule: 'vk', reasons: []}, {term: 'くる', source: 'きます', rule: 'vk', reasons: ['polite']}, {term: 'くる', source: 'きた', rule: 'vk', reasons: ['past']}, - {term: 'くる', source: 'きました', rule: 'vk', reasons: ['polite past']}, + {term: 'くる', source: 'きました', rule: 'vk', reasons: ['polite', 'past']}, {term: 'くる', source: 'きて', rule: 'vk', reasons: ['-te']}, {term: 'くる', source: 'こられる', rule: 'vk', reasons: ['potential or passive']}, {term: 'くる', source: 'こられる', rule: 'vk', reasons: ['potential or passive']}, @@ -759,9 +759,9 @@ function testDeinflections() { {term: 'くる', source: 'こさせられる', rule: 'vk', reasons: ['causative', 'potential or passive']}, {term: 'くる', source: 'こい', rule: 'vk', reasons: ['imperative']}, {term: 'くる', source: 'こない', rule: 'vk', reasons: ['negative']}, - {term: 'くる', source: 'きません', rule: 'vk', reasons: ['polite negative']}, + {term: 'くる', source: 'きません', rule: 'vk', reasons: ['polite', 'negative']}, {term: 'くる', source: 'こなかった', rule: 'vk', reasons: ['negative', 'past']}, - {term: 'くる', source: 'きませんでした', rule: 'vk', reasons: ['polite past negative']}, + {term: 'くる', source: 'きませんでした', rule: 'vk', reasons: ['polite', 'negative', 'past']}, {term: 'くる', source: 'こなくて', rule: 'vk', reasons: ['negative', '-te']}, {term: 'くる', source: 'こられない', rule: 'vk', reasons: ['potential or passive', 'negative']}, {term: 'くる', source: 'こられない', rule: 'vk', reasons: ['potential or passive', 'negative']}, @@ -781,7 +781,7 @@ function testDeinflections() { {term: 'くる', source: 'こず', rule: 'vk', reasons: ['-zu']}, {term: 'くる', source: 'こぬ', rule: 'vk', reasons: ['-nu']}, {term: 'くる', source: 'き', rule: 'vk', reasons: ['masu stem']}, - {term: 'くる', source: 'きましょう', rule: 'vk', reasons: ['polite volitional']}, + {term: 'くる', source: 'きましょう', rule: 'vk', reasons: ['polite', 'volitional']}, {term: 'くる', source: 'こよう', rule: 'vk', reasons: ['volitional']}, // ['causative passive'] {term: 'くる', source: 'きとく', rule: 'vk', reasons: ['-toku']}, @@ -799,7 +799,7 @@ function testDeinflections() { {term: '論ずる', source: '論ずる', rule: 'vz', reasons: []}, {term: '論ずる', source: '論じます', rule: 'vz', reasons: ['polite']}, {term: '論ずる', source: '論じた', rule: 'vz', reasons: ['past']}, - {term: '論ずる', source: '論じました', rule: 'vz', reasons: ['polite past']}, + {term: '論ずる', source: '論じました', rule: 'vz', reasons: ['polite', 'past']}, {term: '論ずる', source: '論じて', rule: 'vz', reasons: ['-te']}, {term: '論ずる', source: '論ぜられる', rule: 'vz', reasons: ['potential or passive']}, {term: '論ずる', source: '論ざれる', rule: 'vz', reasons: ['potential or passive']}, @@ -811,9 +811,9 @@ function testDeinflections() { {term: '論ずる', source: '論ぜさせられる', rule: 'vz', reasons: ['causative', 'potential or passive']}, {term: '論ずる', source: '論じろ', rule: 'vz', reasons: ['imperative']}, {term: '論ずる', source: '論じない', rule: 'vz', reasons: ['negative']}, - {term: '論ずる', source: '論じません', rule: 'vz', reasons: ['polite negative']}, + {term: '論ずる', source: '論じません', rule: 'vz', reasons: ['polite', 'negative']}, {term: '論ずる', source: '論じなかった', rule: 'vz', reasons: ['negative', 'past']}, - {term: '論ずる', source: '論じませんでした', rule: 'vz', reasons: ['polite past negative']}, + {term: '論ずる', source: '論じませんでした', rule: 'vz', reasons: ['polite', 'negative', 'past']}, {term: '論ずる', source: '論じなくて', rule: 'vz', reasons: ['negative', '-te']}, {term: '論ずる', source: '論ぜられない', rule: 'vz', reasons: ['potential or passive', 'negative']}, {term: '論ずる', source: '論じされない', rule: 'vz', reasons: ['passive', 'negative']}, @@ -836,7 +836,7 @@ function testDeinflections() { {term: '論ずる', source: '論ぜず', rule: 'vz', reasons: ['-zu']}, {term: '論ずる', source: '論ぜぬ', rule: 'vz', reasons: ['-nu']}, // ['masu stem'] - {term: '論ずる', source: '論じましょう', rule: 'vz', reasons: ['polite volitional']}, + {term: '論ずる', source: '論じましょう', rule: 'vz', reasons: ['polite', 'volitional']}, {term: '論ずる', source: '論じよう', rule: 'vz', reasons: ['volitional']}, // ['causative passive'] {term: '論ずる', source: '論じとく', rule: 'vz', reasons: ['-toku']}, @@ -992,7 +992,7 @@ function testDeinflections() { tests: [ {term: '抱き抱える', source: '抱き抱えていなければ', rule: 'v1', reasons: ['-te', 'progressive or perfect', 'negative', '-ba']}, {term: '抱きかかえる', source: '抱きかかえていなければ', rule: 'v1', reasons: ['-te', 'progressive or perfect', 'negative', '-ba']}, - {term: '打ち込む', source: '打ち込んでいませんでした', rule: 'v5', reasons: ['-te', 'progressive or perfect', 'polite past negative']}, + {term: '打ち込む', source: '打ち込んでいませんでした', rule: 'v5', reasons: ['-te', 'progressive or perfect', 'polite', 'negative', 'past']}, {term: '食べる', source: '食べさせられたくなかった', rule: 'v1', reasons: ['causative', 'potential or passive', '-tai', 'negative', 'past']} ] }, From dbc87e5006928d7f6dba9bef3a8b4bd45e98d11f Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Sat, 3 Feb 2024 14:18:29 +0100 Subject: [PATCH 10/12] make nicer --- ext/data/language/japanese-transforms.json | 37 ++++++++++++---------- test/language-transformer.test.js | 17 ++++++++++ 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/ext/data/language/japanese-transforms.json b/ext/data/language/japanese-transforms.json index 42c26b5a3f..7608afc96b 100644 --- a/ext/data/language/japanese-transforms.json +++ b/ext/data/language/japanese-transforms.json @@ -376,7 +376,8 @@ {"suffixIn": "添うて", "suffixOut": "添う", "conditionsIn": ["iru"], "conditionsOut": ["v5"]}, {"suffixIn": "副うて", "suffixOut": "副う", "conditionsIn": ["iru"], "conditionsOut": ["v5"]}, {"suffixIn": "厭うて", "suffixOut": "厭う", "conditionsIn": ["iru"], "conditionsOut": ["v5"]}, - {"suffixIn": "のたもうて", "suffixOut": "のたまう", "conditionsIn": ["iru"], "conditionsOut": ["v5"]} + {"suffixIn": "のたもうて", "suffixOut": "のたまう", "conditionsIn": ["iru"], "conditionsOut": ["v5"]}, + {"suffixIn": "まして", "suffixOut": "ます", "conditionsIn": [], "conditionsOut": ["v"]} ] }, { @@ -609,28 +610,30 @@ {"suffixIn": "副うた", "suffixOut": "副う", "conditionsIn": [], "conditionsOut": ["v5"]}, {"suffixIn": "厭うた", "suffixOut": "厭う", "conditionsIn": [], "conditionsOut": ["v5"]}, {"suffixIn": "のたもうた", "suffixOut": "のたまう", "conditionsIn": [], "conditionsOut": ["v5"]}, + {"suffixIn": "ました", "suffixOut": "ます", "conditionsIn": [], "conditionsOut": ["v"]}, {"suffixIn": "ませんでした", "suffixOut": "ません", "conditionsIn": [], "conditionsOut": ["v"]} ] }, { "name": "polite", "rules": [ - {"suffixIn": "ます", "suffixOut": "る", "conditionsIn": [], "conditionsOut": ["v1"]}, - {"suffixIn": "います", "suffixOut": "う", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "きます", "suffixOut": "く", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ぎます", "suffixOut": "ぐ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "します", "suffixOut": "す", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ちます", "suffixOut": "つ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "にます", "suffixOut": "ぬ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "びます", "suffixOut": "ぶ", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "みます", "suffixOut": "む", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "ります", "suffixOut": "る", "conditionsIn": [], "conditionsOut": ["v5"]}, - {"suffixIn": "じます", "suffixOut": "ずる", "conditionsIn": [], "conditionsOut": ["vz"]}, - {"suffixIn": "します", "suffixOut": "する", "conditionsIn": [], "conditionsOut": ["vs"]}, - {"suffixIn": "為ます", "suffixOut": "為る", "conditionsIn": [], "conditionsOut": ["vs"]}, - {"suffixIn": "きます", "suffixOut": "くる", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "来ます", "suffixOut": "来る", "conditionsIn": [], "conditionsOut": ["vk"]}, - {"suffixIn": "來ます", "suffixOut": "來る", "conditionsIn": [], "conditionsOut": ["vk"]} + {"suffixIn": "ます", "suffixOut": "る", "conditionsIn": ["v1"], "conditionsOut": ["v1"]}, + {"suffixIn": "います", "suffixOut": "う", "conditionsIn": ["v5"], "conditionsOut": ["v5"]}, + {"suffixIn": "きます", "suffixOut": "く", "conditionsIn": ["v5"], "conditionsOut": ["v5"]}, + {"suffixIn": "ぎます", "suffixOut": "ぐ", "conditionsIn": ["v5"], "conditionsOut": ["v5"]}, + {"suffixIn": "します", "suffixOut": "す", "conditionsIn": ["v5"], "conditionsOut": ["v5"]}, + {"suffixIn": "ちます", "suffixOut": "つ", "conditionsIn": ["v5"], "conditionsOut": ["v5"]}, + {"suffixIn": "にます", "suffixOut": "ぬ", "conditionsIn": ["v5"], "conditionsOut": ["v5"]}, + {"suffixIn": "びます", "suffixOut": "ぶ", "conditionsIn": ["v5"], "conditionsOut": ["v5"]}, + {"suffixIn": "みます", "suffixOut": "む", "conditionsIn": ["v5"], "conditionsOut": ["v5"]}, + {"suffixIn": "ります", "suffixOut": "る", "conditionsIn": ["v5"], "conditionsOut": ["v5"]}, + {"suffixIn": "じます", "suffixOut": "ずる", "conditionsIn": ["vz"], "conditionsOut": ["vz"]}, + {"suffixIn": "します", "suffixOut": "する", "conditionsIn": ["vs"], "conditionsOut": ["vs"]}, + {"suffixIn": "為ます", "suffixOut": "為る", "conditionsIn": ["vs"], "conditionsOut": ["vs"]}, + {"suffixIn": "きます", "suffixOut": "くる", "conditionsIn": ["vk"], "conditionsOut": ["vk"]}, + {"suffixIn": "来ます", "suffixOut": "来る", "conditionsIn": ["vk"], "conditionsOut": ["vk"]}, + {"suffixIn": "來ます", "suffixOut": "來る", "conditionsIn": ["vk"], "conditionsOut": ["vk"]}, + {"suffixIn": "くあります", "suffixOut": "い", "conditionsIn": ["v"], "conditionsOut": ["adj-i"]} ] }, diff --git a/test/language-transformer.test.js b/test/language-transformer.test.js index 66b282586b..92156f6871 100644 --- a/test/language-transformer.test.js +++ b/test/language-transformer.test.js @@ -110,6 +110,8 @@ function testDeinflections() { {term: '食べる', source: '食べさせない', rule: 'v1', reasons: ['causative', 'negative']}, {term: '食べる', source: '食べさせられない', rule: 'v1', reasons: ['causative', 'potential or passive', 'negative']}, {term: '食べる', source: '食べるな', rule: 'v1', reasons: ['imperative negative']}, + {term: '食べる', source: '食べまして', rule: 'v1', reasons: ['polite', '-te']}, + {term: '食べる', source: '食べれば', rule: 'v1', reasons: ['-ba']}, {term: '食べる', source: '食べちゃう', rule: 'v1', reasons: ['-chau']}, @@ -158,6 +160,7 @@ function testDeinflections() { {term: '買う', source: '買わせない', rule: 'v5', reasons: ['causative', 'negative']}, {term: '買う', source: '買わせられない', rule: 'v5', reasons: ['causative', 'potential or passive', 'negative']}, {term: '買う', source: '買うな', rule: 'v5', reasons: ['imperative negative']}, + {term: '買う', source: '買いまして', rule: 'v5', reasons: ['polite', '-te']}, {term: '買う', source: '買えば', rule: 'v5', reasons: ['-ba']}, {term: '買う', source: '買っちゃう', rule: 'v5', reasons: ['-chau']}, @@ -206,6 +209,7 @@ function testDeinflections() { {term: '行く', source: '行かせない', rule: 'v5', reasons: ['causative', 'negative']}, {term: '行く', source: '行かせられない', rule: 'v5', reasons: ['causative', 'potential or passive', 'negative']}, {term: '行く', source: '行くな', rule: 'v5', reasons: ['imperative negative']}, + {term: '行く', source: '行きまして', rule: 'v5', reasons: ['polite', '-te']}, {term: '行く', source: '行けば', rule: 'v5', reasons: ['-ba']}, {term: '行く', source: '行っちゃう', rule: 'v5', reasons: ['-chau']}, @@ -254,6 +258,7 @@ function testDeinflections() { {term: '泳ぐ', source: '泳がせない', rule: 'v5', reasons: ['causative', 'negative']}, {term: '泳ぐ', source: '泳がせられない', rule: 'v5', reasons: ['causative', 'potential or passive', 'negative']}, {term: '泳ぐ', source: '泳ぐな', rule: 'v5', reasons: ['imperative negative']}, + {term: '泳ぐ', source: '泳ぎまして', rule: 'v5', reasons: ['polite', '-te']}, {term: '泳ぐ', source: '泳げば', rule: 'v5', reasons: ['-ba']}, {term: '泳ぐ', source: '泳いじゃう', rule: 'v5', reasons: ['-chau']}, @@ -301,6 +306,7 @@ function testDeinflections() { {term: '話す', source: '話させない', rule: 'v5', reasons: ['causative', 'negative']}, {term: '話す', source: '話させられない', rule: 'v5', reasons: ['causative', 'potential or passive', 'negative']}, {term: '話す', source: '話すな', rule: 'v5', reasons: ['imperative negative']}, + {term: '話す', source: '話しまして', rule: 'v5', reasons: ['polite', '-te']}, {term: '話す', source: '話せば', rule: 'v5', reasons: ['-ba']}, {term: '話す', source: '話しちゃう', rule: 'v5', reasons: ['-chau']}, @@ -349,6 +355,7 @@ function testDeinflections() { {term: '待つ', source: '待たせない', rule: 'v5', reasons: ['causative', 'negative']}, {term: '待つ', source: '待たせられない', rule: 'v5', reasons: ['causative', 'potential or passive', 'negative']}, {term: '待つ', source: '待つな', rule: 'v5', reasons: ['imperative negative']}, + {term: '待つ', source: '待ちまして', rule: 'v5', reasons: ['polite', '-te']}, {term: '待つ', source: '待てば', rule: 'v5', reasons: ['-ba']}, {term: '待つ', source: '待っちゃう', rule: 'v5', reasons: ['-chau']}, @@ -397,6 +404,7 @@ function testDeinflections() { {term: '死ぬ', source: '死なせない', rule: 'v5', reasons: ['causative', 'negative']}, {term: '死ぬ', source: '死なせられない', rule: 'v5', reasons: ['causative', 'potential or passive', 'negative']}, {term: '死ぬ', source: '死ぬな', rule: 'v5', reasons: ['imperative negative']}, + {term: '死ぬ', source: '死にまして', rule: 'v5', reasons: ['polite', '-te']}, {term: '死ぬ', source: '死ねば', rule: 'v5', reasons: ['-ba']}, {term: '死ぬ', source: '死んじゃう', rule: 'v5', reasons: ['-chau']}, @@ -444,6 +452,7 @@ function testDeinflections() { {term: '遊ぶ', source: '遊ばせない', rule: 'v5', reasons: ['causative', 'negative']}, {term: '遊ぶ', source: '遊ばせられない', rule: 'v5', reasons: ['causative', 'potential or passive', 'negative']}, {term: '遊ぶ', source: '遊ぶな', rule: 'v5', reasons: ['imperative negative']}, + {term: '遊ぶ', source: '遊びまして', rule: 'v5', reasons: ['polite', '-te']}, {term: '遊ぶ', source: '遊べば', rule: 'v5', reasons: ['-ba']}, {term: '遊ぶ', source: '遊んじゃう', rule: 'v5', reasons: ['-chau']}, @@ -491,6 +500,7 @@ function testDeinflections() { {term: '飲む', source: '飲ませない', rule: 'v5', reasons: ['causative', 'negative']}, {term: '飲む', source: '飲ませられない', rule: 'v5', reasons: ['causative', 'potential or passive', 'negative']}, {term: '飲む', source: '飲むな', rule: 'v5', reasons: ['imperative negative']}, + {term: '飲む', source: '飲みまして', rule: 'v5', reasons: ['polite', '-te']}, {term: '飲む', source: '飲めば', rule: 'v5', reasons: ['-ba']}, {term: '飲む', source: '飲んじゃう', rule: 'v5', reasons: ['-chau']}, @@ -538,6 +548,7 @@ function testDeinflections() { {term: '作る', source: '作らせない', rule: 'v5', reasons: ['causative', 'negative']}, {term: '作る', source: '作らせられない', rule: 'v5', reasons: ['causative', 'potential or passive', 'negative']}, {term: '作る', source: '作るな', rule: 'v5', reasons: ['imperative negative']}, + {term: '作る', source: '作りまして', rule: 'v5', reasons: ['polite', '-te']}, {term: '作る', source: '作れば', rule: 'v5', reasons: ['-ba']}, {term: '作る', source: '作っちゃう', rule: 'v5', reasons: ['-chau']}, @@ -590,6 +601,7 @@ function testDeinflections() { {term: '為る', source: '為せられない', rule: 'vs', reasons: ['causative', 'potential or passive', 'negative']}, {term: '為る', source: '為させられない', rule: 'vs', reasons: ['causative', 'potential or passive', 'negative']}, {term: '為る', source: '為るな', rule: 'vs', reasons: ['imperative negative']}, + {term: '為る', source: '為まして', rule: 'vs', reasons: ['polite', '-te']}, {term: '為る', source: '為れば', rule: 'vs', reasons: ['-ba']}, {term: '為る', source: '為ちゃう', rule: 'vs', reasons: ['-chau']}, @@ -639,6 +651,7 @@ function testDeinflections() { {term: 'する', source: 'させられない', rule: 'vs', reasons: ['causative', 'potential or passive', 'negative']}, {term: 'する', source: 'せさせられない', rule: 'vs', reasons: ['causative', 'potential or passive', 'negative']}, {term: 'する', source: 'するな', rule: 'vs', reasons: ['imperative negative']}, + {term: 'する', source: 'しまして', rule: 'vs', reasons: ['polite', '-te']}, {term: 'する', source: 'すれば', rule: 'vs', reasons: ['-ba']}, {term: 'する', source: 'しちゃう', rule: 'vs', reasons: ['-chau']}, @@ -682,6 +695,7 @@ function testDeinflections() { {term: '来る', source: '来させない', rule: 'vk', reasons: ['causative', 'negative']}, {term: '来る', source: '来させられない', rule: 'vk', reasons: ['causative', 'potential or passive', 'negative']}, {term: '来る', source: '来るな', rule: 'vk', reasons: ['imperative negative']}, + {term: '来る', source: '来まして', rule: 'vk', reasons: ['polite', '-te']}, {term: '来る', source: '来れば', rule: 'vk', reasons: ['-ba']}, {term: '来る', source: '来ちゃう', rule: 'vk', reasons: ['-chau']}, @@ -725,6 +739,7 @@ function testDeinflections() { {term: '來る', source: '來させない', rule: 'vk', reasons: ['causative', 'negative']}, {term: '來る', source: '來させられない', rule: 'vk', reasons: ['causative', 'potential or passive', 'negative']}, {term: '來る', source: '來るな', rule: 'vk', reasons: ['imperative negative']}, + {term: '來る', source: '來まして', rule: 'vk', reasons: ['polite', '-te']}, {term: '來る', source: '來れば', rule: 'vk', reasons: ['-ba']}, {term: '來る', source: '來ちゃう', rule: 'vk', reasons: ['-chau']}, @@ -768,6 +783,7 @@ function testDeinflections() { {term: 'くる', source: 'こさせない', rule: 'vk', reasons: ['causative', 'negative']}, {term: 'くる', source: 'こさせられない', rule: 'vk', reasons: ['causative', 'potential or passive', 'negative']}, {term: 'くる', source: 'くるな', rule: 'vk', reasons: ['imperative negative']}, + {term: 'くる', source: 'きまして', rule: 'vk', reasons: ['polite', '-te']}, {term: 'くる', source: 'くれば', rule: 'vk', reasons: ['-ba']}, {term: 'くる', source: 'きちゃう', rule: 'vk', reasons: ['-chau']}, @@ -823,6 +839,7 @@ function testDeinflections() { {term: '論ずる', source: '論じさせられない', rule: 'vz', reasons: ['causative', 'potential or passive', 'negative']}, {term: '論ずる', source: '論ぜさせられない', rule: 'vz', reasons: ['causative', 'potential or passive', 'negative']}, {term: '論ずる', source: '論ずるな', rule: 'vz', reasons: ['imperative negative']}, + {term: '論ずる', source: '論じまして', rule: 'vz', reasons: ['polite', '-te']}, {term: '論ずる', source: '論ずれば', rule: 'vz', reasons: ['-ba']}, {term: '論ずる', source: '論じちゃう', rule: 'vz', reasons: ['-chau']}, From 343fc90870955252688395cc32ef090d459b1492 Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Sat, 3 Feb 2024 14:37:16 +0100 Subject: [PATCH 11/12] lint --- ext/data/language/japanese-transforms.json | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/data/language/japanese-transforms.json b/ext/data/language/japanese-transforms.json index 7608afc96b..971619ce24 100644 --- a/ext/data/language/japanese-transforms.json +++ b/ext/data/language/japanese-transforms.json @@ -636,7 +636,6 @@ {"suffixIn": "くあります", "suffixOut": "い", "conditionsIn": ["v"], "conditionsOut": ["adj-i"]} ] }, - { "name": "potential", "rules": [ From 71b8e8b795355a737f9ebab25955cfc1774df5f6 Mon Sep 17 00:00:00 2001 From: Stefan Vukovic Date: Sat, 3 Feb 2024 20:28:59 +0100 Subject: [PATCH 12/12] remove extra line --- test/language-transformer.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/language-transformer.test.js b/test/language-transformer.test.js index 92156f6871..373161ba61 100644 --- a/test/language-transformer.test.js +++ b/test/language-transformer.test.js @@ -112,7 +112,6 @@ function testDeinflections() { {term: '食べる', source: '食べるな', rule: 'v1', reasons: ['imperative negative']}, {term: '食べる', source: '食べまして', rule: 'v1', reasons: ['polite', '-te']}, - {term: '食べる', source: '食べれば', rule: 'v1', reasons: ['-ba']}, {term: '食べる', source: '食べちゃう', rule: 'v1', reasons: ['-chau']}, {term: '食べる', source: '食べちまう', rule: 'v1', reasons: ['-chimau']},