Skip to content

Commit

Permalink
Deinflect Json overhaul (#433)
Browse files Browse the repository at this point in the history
* deinflect overhaul template

* remove duplicates with -e rule

* deinflection updates

* add neba deinflections

* kansaiben updates

* remove redundancy

* Revert "remove redundancy"

This reverts commit de71406.

* update deinflect.json

* move deinflect.json to japanese-transforms.json

* remove trailing spaces

* wip add tests

* update deinflect.json, add tests

* run 'npm run test-code-write'

* rename to kansai-ben

* update tests

* run 'npm run test-code-write' again

* add -tara deinflection
  • Loading branch information
Casheeew authored Feb 4, 2024
1 parent ea53ab5 commit 63a3817
Show file tree
Hide file tree
Showing 5 changed files with 360 additions and 5 deletions.
227 changes: 225 additions & 2 deletions ext/data/language/japanese-transforms.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,69 @@
{"suffixIn": "來ぬ", "suffixOut": "來る", "conditionsIn": [], "conditionsOut": ["vk"]}
]
},
{
"name": "-mu",
"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": "-zaru",
"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": "-neba",
"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": "adv",
"rules": [
Expand Down Expand Up @@ -844,8 +907,168 @@
{"suffixIn": "ちぇえ", "suffixOut": "ちゃい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "でえ", "suffixOut": "どい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "れえ", "suffixOut": "れい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "べえ", "suffixOut": "ばい", "conditionsIn": [], "conditionsOut": ["adj-i"]}
{"suffixIn": "べえ", "suffixOut": "ばい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "てえ", "suffixOut": "たい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "ねぇ", "suffixOut": "ない", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "めぇ", "suffixOut": "むい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "みぃ", "suffixOut": "むい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "ちぃ", "suffixOut": "つい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "せぇ", "suffixOut": "すい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "けぇ", "suffixOut": "かい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "げぇ", "suffixOut": "がい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "げぇ", "suffixOut": "ごい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "せぇ", "suffixOut": "さい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "めぇ", "suffixOut": "まい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "ぜぇ", "suffixOut": "ずい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "っぜぇ", "suffixOut": "ずい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "れぇ", "suffixOut": "らい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "でぇ", "suffixOut": "どい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "れぇ", "suffixOut": "れい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "べぇ", "suffixOut": "ばい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "てぇ", "suffixOut": "たい", "conditionsIn": [], "conditionsOut": ["adj-i"]}
]
},
{
"name": "slang",
"rules": [
{"suffixIn": "てぇてぇ", "suffixOut": "とうとい", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "てぇてぇ", "suffixOut": "尊い", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "おなしゃす", "suffixOut": "おねがいします", "conditionsIn": [], "conditionsOut": ["v5"]},
{"suffixIn": "おなしゃす", "suffixOut": "お願いします", "conditionsIn": [], "conditionsOut": ["v5"]},
{"suffixIn": "あざす", "suffixOut": "ありがとうございます", "conditionsIn": [], "conditionsOut": ["v5"]},
{"suffixIn": "さーせん", "suffixOut": "すみません", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "神ってる", "suffixOut": "神がかっている", "conditionsIn": [], "conditionsOut": ["v1p"]},
{"suffixIn": "じわる", "suffixOut": "じわじわ来る", "conditionsIn": [], "conditionsOut": ["vk"]},
{"suffixIn": "おさしみ", "suffixOut": "おやすみ", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "おやさい", "suffixOut": "おやすみ", "conditionsIn": [], "conditionsOut": []}
]
},
{
"name": "kansai-ben",
"description": "Negative form of kansai-ben verbs",
"rules": [
{"suffixIn": "へん", "suffixOut": "ない", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "ひん", "suffixOut": "ない", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "せえへん", "suffixOut": "しない", "conditionsIn": [], "conditionsOut": ["adj-i"]},
{"suffixIn": "へんかった", "suffixOut": "なかった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ひんかった", "suffixOut": "なかった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "うてへん", "suffixOut": "ってない", "conditionsIn": [], "conditionsOut": ["adj-i"]}
]
},
{
"name": "kansai-ben",
"description": "-ku stem of kansai-ben adjectives",
"rules": [
{"suffixIn": "", "suffixOut": "", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "こう", "suffixOut": "かく", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ごう", "suffixOut": "がく", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "そう", "suffixOut": "さく", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "とう", "suffixOut": "たく", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "のう", "suffixOut": "なく", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ぼう", "suffixOut": "ばく", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "もう", "suffixOut": "まく", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ろう", "suffixOut": "らく", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "よう", "suffixOut": "よく", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "しゅう", "suffixOut": "しく", "conditionsIn": [], "conditionsOut": []}
]
},
{
"name": "kansai-ben",
"description": "-te form of kansai-ben adjectives",
"rules": [
{"suffixIn": "うて", "suffixOut": "くて", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "こうて", "suffixOut": "かくて", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ごうて", "suffixOut": "がくて", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "そうて", "suffixOut": "さくて", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "とうて", "suffixOut": "たくて", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "のうて", "suffixOut": "なくて", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ぼうて", "suffixOut": "ばくて", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "もうて", "suffixOut": "まくて", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ろうて", "suffixOut": "らくて", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ようて", "suffixOut": "よくて", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "しゅうて", "suffixOut": "しくて", "conditionsIn": [], "conditionsOut": []}
]
},
{
"name": "kansai-ben",
"description": "Negative form of kansai-ben adjectives",
"rules": [
{"suffixIn": "うない", "suffixOut": "くない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]},
{"suffixIn": "こうない", "suffixOut": "かくない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]},
{"suffixIn": "ごうない", "suffixOut": "がくない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]},
{"suffixIn": "そうない", "suffixOut": "さくない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]},
{"suffixIn": "とうない", "suffixOut": "たくない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]},
{"suffixIn": "のうない", "suffixOut": "なくない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]},
{"suffixIn": "ぼうない", "suffixOut": "ばくない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]},
{"suffixIn": "もうない", "suffixOut": "まくない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]},
{"suffixIn": "ろうない", "suffixOut": "らくない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]},
{"suffixIn": "ようない", "suffixOut": "よくない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]},
{"suffixIn": "しゅうない", "suffixOut": "しくない", "conditionsIn": ["adj-i"], "conditionsOut": ["adj-i"]}
]
},
{
"name": "kansai-ben",
"description": "-te form of kansai-ben verbs",
"rules": [
{"suffixIn": "うて", "suffixOut": "って", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "おうて", "suffixOut": "あって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "こうて", "suffixOut": "かって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ごうて", "suffixOut": "がって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "そうて", "suffixOut": "さって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ぞうて", "suffixOut": "ざって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "とうて", "suffixOut": "たって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "どうて", "suffixOut": "だって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "のうて", "suffixOut": "なって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ほうて", "suffixOut": "はって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ぼうて", "suffixOut": "ばって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "もうて", "suffixOut": "まって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ろうて", "suffixOut": "らって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ようて", "suffixOut": "やって", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ゆうて", "suffixOut": "いって", "conditionsIn": [], "conditionsOut": []}
]
},
{
"name": "kansai-ben",
"description": "past form of kansai-ben terms",
"rules": [
{"suffixIn": "うた", "suffixOut": "った", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "おうた", "suffixOut": "あった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "こうた", "suffixOut": "かった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ごうた", "suffixOut": "がった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "そうた", "suffixOut": "さった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ぞうた", "suffixOut": "ざった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "とうた", "suffixOut": "たった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "どうた", "suffixOut": "だった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "のうた", "suffixOut": "なった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ほうた", "suffixOut": "はった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ぼうた", "suffixOut": "ばった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "もうた", "suffixOut": "まった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ろうた", "suffixOut": "らった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ようた", "suffixOut": "やった", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ゆうた", "suffixOut": "いった", "conditionsIn": [], "conditionsOut": []}
]
},
{
"name": "kansai-ben",
"description": "-tara form of kansai-ben terms",
"rules": [
{"suffixIn": "うたら", "suffixOut": "ったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "おうたら", "suffixOut": "あったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "こうたら", "suffixOut": "かったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ごうたら", "suffixOut": "がったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "そうたら", "suffixOut": "さったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ぞうたら", "suffixOut": "ざったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "とうたら", "suffixOut": "たったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "どうたら", "suffixOut": "だったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "のうたら", "suffixOut": "なったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ほうたら", "suffixOut": "はったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ぼうたら", "suffixOut": "ばったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "もうたら", "suffixOut": "まったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ろうたら", "suffixOut": "らったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ようたら", "suffixOut": "やったら", "conditionsIn": [], "conditionsOut": []},
{"suffixIn": "ゆうたら", "suffixOut": "いったら", "conditionsIn": [], "conditionsOut": []}
]
}
]
}
}

Loading

0 comments on commit 63a3817

Please sign in to comment.