diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-12-12 10:17:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-12 10:17:25 -0500 |
commit | ddb71af6bd8092cfed9f91401d5ecded6ef4c4b6 (patch) | |
tree | bee324abb2ad3afbed21ec76800c249dbf640e80 /ext/bg | |
parent | 83ab864b98a579969d815225f03bc1627b88b80d (diff) |
Add zuru deinflections (#1091)
* Update deinflector rule types
* Add deinflection rules for zuru verbs
* Add tests
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/js/deinflector.js | 13 | ||||
-rw-r--r-- | ext/bg/lang/deinflect.json | 30 |
2 files changed, 35 insertions, 8 deletions
diff --git a/ext/bg/js/deinflector.js b/ext/bg/js/deinflector.js index b13079ef..341ff3e4 100644 --- a/ext/bg/js/deinflector.js +++ b/ext/bg/js/deinflector.js @@ -86,10 +86,11 @@ class Deinflector { } Deinflector.ruleTypes = new Map([ - ['v1', 0b0000001], // Verb ichidan - ['v5', 0b0000010], // Verb godan - ['vs', 0b0000100], // Verb suru - ['vk', 0b0001000], // Verb kuru - ['adj-i', 0b0010000], // Adjective i - ['iru', 0b0100000] // Intermediate -iru endings for progressive or perfect tense + ['v1', 0b00000001], // Verb ichidan + ['v5', 0b00000010], // Verb godan + ['vs', 0b00000100], // Verb suru + ['vk', 0b00001000], // Verb kuru + ['vz', 0b00010000], // Verb zuru + ['adj-i', 0b00100000], // Adjective i + ['iru', 0b01000000] // Intermediate -iru endings for progressive or perfect tense ]); diff --git a/ext/bg/lang/deinflect.json b/ext/bg/lang/deinflect.json index f51cd86f..9aab795e 100644 --- a/ext/bg/lang/deinflect.json +++ b/ext/bg/lang/deinflect.json @@ -9,7 +9,7 @@ {"kanaIn": "ねば", "kanaOut": "ぬ", "rulesIn": [], "rulesOut": ["v5"]}, {"kanaIn": "べば", "kanaOut": "ぶ", "rulesIn": [], "rulesOut": ["v5"]}, {"kanaIn": "めば", "kanaOut": "む", "rulesIn": [], "rulesOut": ["v5"]}, - {"kanaIn": "れば", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v1", "v5", "vk", "vs"]} + {"kanaIn": "れば", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v1", "v5", "vk", "vs", "vz"]} ], "-chau": [ {"kanaIn": "ちゃう", "kanaOut": "る", "rulesIn": ["v5"], "rulesOut": ["v1"]}, @@ -23,6 +23,7 @@ {"kanaIn": "んじゃう", "kanaOut": "ぬ", "rulesIn": ["v5"], "rulesOut": ["v5"]}, {"kanaIn": "んじゃう", "kanaOut": "ぶ", "rulesIn": ["v5"], "rulesOut": ["v5"]}, {"kanaIn": "んじゃう", "kanaOut": "む", "rulesIn": ["v5"], "rulesOut": ["v5"]}, + {"kanaIn": "じちゃう", "kanaOut": "ずる", "rulesIn": ["v5"], "rulesOut": ["vz"]}, {"kanaIn": "しちゃう", "kanaOut": "する", "rulesIn": ["v5"], "rulesOut": ["vs"]}, {"kanaIn": "為ちゃう", "kanaOut": "為る", "rulesIn": ["v5"], "rulesOut": ["vs"]}, {"kanaIn": "きちゃう", "kanaOut": "くる", "rulesIn": ["v5"], "rulesOut": ["vk"]}, @@ -40,6 +41,7 @@ {"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"]}, @@ -58,6 +60,7 @@ {"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"]}, @@ -76,6 +79,7 @@ {"kanaIn": "びすぎる", "kanaOut": "ぶ", "rulesIn": ["v1"], "rulesOut": ["v5"]}, {"kanaIn": "みすぎる", "kanaOut": "む", "rulesIn": ["v1"], "rulesOut": ["v5"]}, {"kanaIn": "りすぎる", "kanaOut": "る", "rulesIn": ["v1"], "rulesOut": ["v5"]}, + {"kanaIn": "じすぎる", "kanaOut": "ずる", "rulesIn": ["v1"], "rulesOut": ["vz"]}, {"kanaIn": "しすぎる", "kanaOut": "する", "rulesIn": ["v1"], "rulesOut": ["vs"]}, {"kanaIn": "為すぎる", "kanaOut": "為る", "rulesIn": ["v1"], "rulesOut": ["vs"]}, {"kanaIn": "きすぎる", "kanaOut": "くる", "rulesIn": ["v1"], "rulesOut": ["vk"]}, @@ -93,6 +97,7 @@ {"kanaIn": "びたい", "kanaOut": "ぶ", "rulesIn": ["adj-i"], "rulesOut": ["v5"]}, {"kanaIn": "みたい", "kanaOut": "む", "rulesIn": ["adj-i"], "rulesOut": ["v5"]}, {"kanaIn": "りたい", "kanaOut": "る", "rulesIn": ["adj-i"], "rulesOut": ["v5"]}, + {"kanaIn": "じたい", "kanaOut": "ずる", "rulesIn": ["adj-i"], "rulesOut": ["vz"]}, {"kanaIn": "したい", "kanaOut": "する", "rulesIn": ["adj-i"], "rulesOut": ["vs"]}, {"kanaIn": "為たい", "kanaOut": "為る", "rulesIn": ["adj-i"], "rulesOut": ["vs"]}, {"kanaIn": "きたい", "kanaOut": "くる", "rulesIn": ["adj-i"], "rulesOut": ["vk"]}, @@ -111,6 +116,7 @@ {"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"]}, @@ -147,6 +153,7 @@ {"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"]}, @@ -183,6 +190,7 @@ {"kanaIn": "んで", "kanaOut": "ぬ", "rulesIn": ["iru"], "rulesOut": ["v5"]}, {"kanaIn": "んで", "kanaOut": "ぶ", "rulesIn": ["iru"], "rulesOut": ["v5"]}, {"kanaIn": "んで", "kanaOut": "む", "rulesIn": ["iru"], "rulesOut": ["v5"]}, + {"kanaIn": "じて", "kanaOut": "ずる", "rulesIn": ["iru"], "rulesOut": ["vz"]}, {"kanaIn": "して", "kanaOut": "する", "rulesIn": ["iru"], "rulesOut": ["vs"]}, {"kanaIn": "為て", "kanaOut": "為る", "rulesIn": ["iru"], "rulesOut": ["vs"]}, {"kanaIn": "きて", "kanaOut": "くる", "rulesIn": ["iru"], "rulesOut": ["vk"]}, @@ -218,6 +226,7 @@ {"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"]}, @@ -235,6 +244,7 @@ {"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"]}, @@ -255,6 +265,8 @@ {"kanaIn": "ませる", "kanaOut": "む", "rulesIn": ["v1"], "rulesOut": ["v5"]}, {"kanaIn": "らせる", "kanaOut": "る", "rulesIn": ["v1"], "rulesOut": ["v5"]}, {"kanaIn": "わせる", "kanaOut": "う", "rulesIn": ["v1"], "rulesOut": ["v5"]}, + {"kanaIn": "じさせる", "kanaOut": "ずる", "rulesIn": ["v1"], "rulesOut": ["vz"]}, + {"kanaIn": "ぜさせる", "kanaOut": "ずる", "rulesIn": ["v1"], "rulesOut": ["vz"]}, {"kanaIn": "させる", "kanaOut": "する", "rulesIn": ["v1"], "rulesOut": ["vs"]}, {"kanaIn": "為せる", "kanaOut": "為る", "rulesIn": ["v1"], "rulesOut": ["vs"]}, {"kanaIn": "せさせる", "kanaOut": "する", "rulesIn": ["v1"], "rulesOut": ["vs"]}, @@ -275,6 +287,8 @@ {"kanaIn": "べ", "kanaOut": "ぶ", "rulesIn": [], "rulesOut": ["v5"]}, {"kanaIn": "め", "kanaOut": "む", "rulesIn": [], "rulesOut": ["v5"]}, {"kanaIn": "れ", "kanaOut": "る", "rulesIn": [], "rulesOut": ["v5"]}, + {"kanaIn": "じろ", "kanaOut": "ずる", "rulesIn": [], "rulesOut": ["vz"]}, + {"kanaIn": "ぜよ", "kanaOut": "ずる", "rulesIn": [], "rulesOut": ["vz"]}, {"kanaIn": "しろ", "kanaOut": "する", "rulesIn": [], "rulesOut": ["vs"]}, {"kanaIn": "せよ", "kanaOut": "する", "rulesIn": [], "rulesOut": ["vs"]}, {"kanaIn": "為ろ", "kanaOut": "為る", "rulesIn": [], "rulesOut": ["vs"]}, @@ -284,7 +298,7 @@ {"kanaIn": "來い", "kanaOut": "來る", "rulesIn": [], "rulesOut": ["vk"]} ], "imperative negative": [ - {"kanaIn": "な", "kanaOut": "", "rulesIn": [], "rulesOut": ["v1", "v5", "vk", "vs"]} + {"kanaIn": "な", "kanaOut": "", "rulesIn": [], "rulesOut": ["v1", "v5", "vk", "vs", "vz"]} ], "masu stem": [ {"kanaIn": "い", "kanaOut": "いる", "rulesIn": [], "rulesOut": ["v1"]}, @@ -334,6 +348,7 @@ {"kanaIn": "まない", "kanaOut": "む", "rulesIn": ["adj-i"], "rulesOut": ["v5"]}, {"kanaIn": "らない", "kanaOut": "る", "rulesIn": ["adj-i"], "rulesOut": ["v5"]}, {"kanaIn": "わない", "kanaOut": "う", "rulesIn": ["adj-i"], "rulesOut": ["v5"]}, + {"kanaIn": "じない", "kanaOut": "ずる", "rulesIn": ["adj-i"], "rulesOut": ["vz"]}, {"kanaIn": "しない", "kanaOut": "する", "rulesIn": ["adj-i"], "rulesOut": ["vs"]}, {"kanaIn": "為ない", "kanaOut": "為る", "rulesIn": ["adj-i"], "rulesOut": ["vs"]}, {"kanaIn": "こない", "kanaOut": "くる", "rulesIn": ["adj-i"], "rulesOut": ["vk"]}, @@ -353,6 +368,8 @@ {"kanaIn": "まれる", "kanaOut": "む", "rulesIn": ["v1"], "rulesOut": ["v5"]}, {"kanaIn": "われる", "kanaOut": "う", "rulesIn": ["v1"], "rulesOut": ["v5"]}, {"kanaIn": "られる", "kanaOut": "る", "rulesIn": ["v1"], "rulesOut": ["v5"]}, + {"kanaIn": "じされる", "kanaOut": "ずる", "rulesIn": ["v1"], "rulesOut": ["vz"]}, + {"kanaIn": "ぜされる", "kanaOut": "ずる", "rulesIn": ["v1"], "rulesOut": ["vz"]}, {"kanaIn": "される", "kanaOut": "する", "rulesIn": ["v1"], "rulesOut": ["vs"]}, {"kanaIn": "為れる", "kanaOut": "為る", "rulesIn": ["v1"], "rulesOut": ["vs"]}, {"kanaIn": "こられる", "kanaOut": "くる", "rulesIn": ["v1"], "rulesOut": ["vk"]}, @@ -371,6 +388,7 @@ {"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"]}, @@ -406,6 +424,7 @@ {"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"]}, @@ -424,6 +443,7 @@ {"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"]}, @@ -441,6 +461,7 @@ {"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"]}, @@ -459,6 +480,7 @@ {"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"]}, @@ -476,6 +498,7 @@ {"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"]}, @@ -498,6 +521,7 @@ ], "potential or passive": [ {"kanaIn": "られる", "kanaOut": "る", "rulesIn": ["v1"], "rulesOut": ["v1"]}, + {"kanaIn": "ぜられる", "kanaOut": "ずる", "rulesIn": ["v1"], "rulesOut": ["vz"]}, {"kanaIn": "せられる", "kanaOut": "する", "rulesIn": ["v1"], "rulesOut": ["vs"]}, {"kanaIn": "為られる", "kanaOut": "為る", "rulesIn": ["v1"], "rulesOut": ["vs"]}, {"kanaIn": "こられる", "kanaOut": "くる", "rulesIn": ["v1"], "rulesOut": ["vk"]}, @@ -515,6 +539,7 @@ {"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"]}, @@ -542,6 +567,7 @@ {"kanaIn": "んどく", "kanaOut": "ぬ", "rulesIn": ["v5"], "rulesOut": ["v5"]}, {"kanaIn": "んどく", "kanaOut": "ぶ", "rulesIn": ["v5"], "rulesOut": ["v5"]}, {"kanaIn": "んどく", "kanaOut": "む", "rulesIn": ["v5"], "rulesOut": ["v5"]}, + {"kanaIn": "じとく", "kanaOut": "ずる", "rulesIn": ["v5"], "rulesOut": ["vz"]}, {"kanaIn": "しとく", "kanaOut": "する", "rulesIn": ["v5"], "rulesOut": ["vs"]}, {"kanaIn": "為とく", "kanaOut": "為る", "rulesIn": ["v5"], "rulesOut": ["vs"]}, {"kanaIn": "きとく", "kanaOut": "くる", "rulesIn": ["v5"], "rulesOut": ["vk"]}, |