diff options
author | Lyroxide <33834537+Lyroxide@users.noreply.github.com> | 2024-05-16 15:44:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 07:44:24 +0000 |
commit | 6ade1eb2e0d8037472631a5e6718c33621303e31 (patch) | |
tree | dbb91d0f78999a80143485e7b070cea3ae3419ef | |
parent | e9b147d20c0004abc74adafc3cb4c361bb9757f5 (diff) |
Fix -ge and add -garu transforms (#952)
* add -rya -cha -n
* add tests
* fix typos
* resolve merge conflicts
* add tests
* change to -ya with chaining
* fix -ge and add -garu
-rw-r--r-- | ext/js/language/ja/japanese-transforms.js | 9 | ||||
-rw-r--r-- | test/language/japanese-transforms.test.js | 27 |
2 files changed, 31 insertions, 5 deletions
diff --git a/ext/js/language/ja/japanese-transforms.js b/ext/js/language/ja/japanese-transforms.js index 2d688ce5..97de8bcc 100644 --- a/ext/js/language/ja/japanese-transforms.js +++ b/ext/js/language/ja/japanese-transforms.js @@ -917,7 +917,14 @@ export const japaneseTransforms = { { name: '-ge', rules: [ - suffixInflection('しげ', 'しい', [], ['adj-i']) + suffixInflection('げ', 'い', [], ['adj-i']), + suffixInflection('気', 'い', [], ['adj-i']) + ] + }, + { + name: '-garu', + rules: [ + suffixInflection('がる', 'い', ['v5'], ['adj-i']) ] }, { diff --git a/test/language/japanese-transforms.test.js b/test/language/japanese-transforms.test.js index 45697a19..c1fdb865 100644 --- a/test/language/japanese-transforms.test.js +++ b/test/language/japanese-transforms.test.js @@ -39,7 +39,9 @@ const tests = [ {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']} + {term: '愛しい', source: '愛しげ', rule: 'adj-i', reasons: ['-ge']}, + {term: '愛しい', source: '愛し気', rule: 'adj-i', reasons: ['-ge']}, + {term: '愛しい', source: '愛しがる', rule: 'adj-i', reasons: ['-garu']} ] }, { @@ -77,6 +79,7 @@ const tests = [ {term: '食べる', source: '食べそう', rule: 'v1', reasons: ['-sou']}, {term: '食べる', source: '食べすぎる', rule: 'v1', reasons: ['-sugiru']}, {term: '食べる', source: '食べたい', rule: 'v1', reasons: ['-tai']}, + {term: '食べる', source: '食べたがる', rule: 'v1', reasons: ['-tai', '-garu']}, {term: '食べる', source: '食べたら', rule: 'v1', reasons: ['-tara']}, {term: '食べる', source: '食べたり', rule: 'v1', reasons: ['-tari']}, {term: '食べる', source: '食べず', rule: 'v1', reasons: ['-zu']}, @@ -131,6 +134,7 @@ const tests = [ {term: '買う', source: '買いそう', rule: 'v5', reasons: ['-sou']}, {term: '買う', source: '買いすぎる', rule: 'v5', reasons: ['-sugiru']}, {term: '買う', source: '買いたい', rule: 'v5', reasons: ['-tai']}, + {term: '買う', source: '買いたがる', rule: 'v5', reasons: ['-tai', '-garu']}, {term: '買う', source: '買ったら', rule: 'v5', reasons: ['-tara']}, {term: '買う', source: '買ったり', rule: 'v5', reasons: ['-tari']}, {term: '買う', source: '買わず', rule: 'v5', reasons: ['-zu']}, @@ -185,6 +189,7 @@ const tests = [ {term: '行く', source: '行きそう', rule: 'v5', reasons: ['-sou']}, {term: '行く', source: '行きすぎる', rule: 'v5', reasons: ['-sugiru']}, {term: '行く', source: '行きたい', rule: 'v5', reasons: ['-tai']}, + {term: '行く', source: '行きたがる', rule: 'v5', reasons: ['-tai', '-garu']}, {term: '行く', source: '行いたら', rule: 'v5', reasons: ['-tara']}, {term: '行く', source: '行いたり', rule: 'v5', reasons: ['-tari']}, {term: '行く', source: '行かず', rule: 'v5', reasons: ['-zu']}, @@ -239,6 +244,7 @@ const tests = [ {term: '泳ぐ', source: '泳ぎそう', rule: 'v5', reasons: ['-sou']}, {term: '泳ぐ', source: '泳ぎすぎる', rule: 'v5', reasons: ['-sugiru']}, {term: '泳ぐ', source: '泳ぎたい', rule: 'v5', reasons: ['-tai']}, + {term: '泳ぐ', source: '泳ぎたがる', rule: 'v5', reasons: ['-tai', '-garu']}, {term: '泳ぐ', source: '泳いだら', rule: 'v5', reasons: ['-tara']}, {term: '泳ぐ', source: '泳いだり', rule: 'v5', reasons: ['-tari']}, {term: '泳ぐ', source: '泳がず', rule: 'v5', reasons: ['-zu']}, @@ -292,6 +298,7 @@ const tests = [ {term: '話す', source: '話しそう', rule: 'v5', reasons: ['-sou']}, {term: '話す', source: '話しすぎる', rule: 'v5', reasons: ['-sugiru']}, {term: '話す', source: '話したい', rule: 'v5', reasons: ['-tai']}, + {term: '話す', source: '話したがる', rule: 'v5', reasons: ['-tai', '-garu']}, {term: '話す', source: '話したら', rule: 'v5', reasons: ['-tara']}, {term: '話す', source: '話したり', rule: 'v5', reasons: ['-tari']}, {term: '話す', source: '話さず', rule: 'v5', reasons: ['-zu']}, @@ -346,6 +353,7 @@ const tests = [ {term: '待つ', source: '待ちそう', rule: 'v5', reasons: ['-sou']}, {term: '待つ', source: '待ちすぎる', rule: 'v5', reasons: ['-sugiru']}, {term: '待つ', source: '待ちたい', rule: 'v5', reasons: ['-tai']}, + {term: '待つ', source: '待ちたがる', rule: 'v5', reasons: ['-tai', '-garu']}, {term: '待つ', source: '待ったら', rule: 'v5', reasons: ['-tara']}, {term: '待つ', source: '待ったり', rule: 'v5', reasons: ['-tari']}, {term: '待つ', source: '待たず', rule: 'v5', reasons: ['-zu']}, @@ -400,6 +408,7 @@ const tests = [ {term: '死ぬ', source: '死にそう', rule: 'v5', reasons: ['-sou']}, {term: '死ぬ', source: '死にすぎる', rule: 'v5', reasons: ['-sugiru']}, {term: '死ぬ', source: '死にたい', rule: 'v5', reasons: ['-tai']}, + {term: '死ぬ', source: '死にたがる', rule: 'v5', reasons: ['-tai', '-garu']}, {term: '死ぬ', source: '死んだら', rule: 'v5', reasons: ['-tara']}, {term: '死ぬ', source: '死んだり', rule: 'v5', reasons: ['-tari']}, {term: '死ぬ', source: '死なず', rule: 'v5', reasons: ['-zu']}, @@ -453,6 +462,7 @@ const tests = [ {term: '遊ぶ', source: '遊びそう', rule: 'v5', reasons: ['-sou']}, {term: '遊ぶ', source: '遊びすぎる', rule: 'v5', reasons: ['-sugiru']}, {term: '遊ぶ', source: '遊びたい', rule: 'v5', reasons: ['-tai']}, + {term: '遊ぶ', source: '遊びたがる', rule: 'v5', reasons: ['-tai', '-garu']}, {term: '遊ぶ', source: '遊んだら', rule: 'v5', reasons: ['-tara']}, {term: '遊ぶ', source: '遊んだり', rule: 'v5', reasons: ['-tari']}, {term: '遊ぶ', source: '遊ばず', rule: 'v5', reasons: ['-zu']}, @@ -506,6 +516,7 @@ const tests = [ {term: '飲む', source: '飲みそう', rule: 'v5', reasons: ['-sou']}, {term: '飲む', source: '飲みすぎる', rule: 'v5', reasons: ['-sugiru']}, {term: '飲む', source: '飲みたい', rule: 'v5', reasons: ['-tai']}, + {term: '飲む', source: '飲みたがる', rule: 'v5', reasons: ['-tai', '-garu']}, {term: '飲む', source: '飲んだら', rule: 'v5', reasons: ['-tara']}, {term: '飲む', source: '飲んだり', rule: 'v5', reasons: ['-tari']}, {term: '飲む', source: '飲まず', rule: 'v5', reasons: ['-zu']}, @@ -559,6 +570,7 @@ const tests = [ {term: '作る', source: '作りそう', rule: 'v5', reasons: ['-sou']}, {term: '作る', source: '作りすぎる', rule: 'v5', reasons: ['-sugiru']}, {term: '作る', source: '作りたい', rule: 'v5', reasons: ['-tai']}, + {term: '作る', source: '作りたがる', rule: 'v5', reasons: ['-tai', '-garu']}, {term: '作る', source: '作ったら', rule: 'v5', reasons: ['-tara']}, {term: '作る', source: '作ったり', rule: 'v5', reasons: ['-tari']}, {term: '作る', source: '作らず', rule: 'v5', reasons: ['-zu']}, @@ -617,6 +629,7 @@ const tests = [ {term: '為る', source: '為そう', rule: 'vs', reasons: ['-sou']}, {term: '為る', source: '為すぎる', rule: 'vs', reasons: ['-sugiru']}, {term: '為る', source: '為たい', rule: 'vs', reasons: ['-tai']}, + {term: '為る', source: '為たがる', rule: 'vs', reasons: ['-tai', '-garu']}, {term: '為る', source: '為たら', rule: 'vs', reasons: ['-tara']}, {term: '為る', source: '為たり', rule: 'vs', reasons: ['-tari']}, {term: '為る', source: '為ず', rule: 'vs', reasons: ['-zu']}, @@ -672,6 +685,7 @@ const tests = [ {term: 'する', source: 'しそう', rule: 'vs', reasons: ['-sou']}, {term: 'する', source: 'しすぎる', rule: 'vs', reasons: ['-sugiru']}, {term: 'する', source: 'したい', rule: 'vs', reasons: ['-tai']}, + {term: 'する', source: 'したがる', rule: 'vs', reasons: ['-tai', '-garu']}, {term: 'する', source: 'したら', rule: 'vs', reasons: ['-tara']}, {term: 'する', source: 'したり', rule: 'vs', reasons: ['-tari']}, {term: 'する', source: 'せず', rule: 'vs', reasons: ['-zu']}, @@ -722,6 +736,7 @@ const tests = [ {term: '来る', source: '来そう', rule: 'vk', reasons: ['-sou']}, {term: '来る', source: '来すぎる', rule: 'vk', reasons: ['-sugiru']}, {term: '来る', source: '来たい', rule: 'vk', reasons: ['-tai']}, + {term: '来る', source: '来たがる', rule: 'vk', reasons: ['-tai', '-garu']}, {term: '来る', source: '来たら', rule: 'vk', reasons: ['-tara']}, {term: '来る', source: '来たり', rule: 'vk', reasons: ['-tari']}, {term: '来る', source: '来ず', rule: 'vk', reasons: ['-zu']}, @@ -771,6 +786,7 @@ const tests = [ {term: '來る', source: '來そう', rule: 'vk', reasons: ['-sou']}, {term: '來る', source: '來すぎる', rule: 'vk', reasons: ['-sugiru']}, {term: '來る', source: '來たい', rule: 'vk', reasons: ['-tai']}, + {term: '來る', source: '來たがる', rule: 'vk', reasons: ['-tai', '-garu']}, {term: '來る', source: '來たら', rule: 'vk', reasons: ['-tara']}, {term: '來る', source: '來たり', rule: 'vk', reasons: ['-tari']}, {term: '來る', source: '來ず', rule: 'vk', reasons: ['-zu']}, @@ -820,6 +836,7 @@ const tests = [ {term: 'くる', source: 'きそう', rule: 'vk', reasons: ['-sou']}, {term: 'くる', source: 'きすぎる', rule: 'vk', reasons: ['-sugiru']}, {term: 'くる', source: 'きたい', rule: 'vk', reasons: ['-tai']}, + {term: 'くる', source: 'きたがる', rule: 'vk', reasons: ['-tai', '-garu']}, {term: 'くる', source: 'きたら', rule: 'vk', reasons: ['-tara']}, {term: 'くる', source: 'きたり', rule: 'vk', reasons: ['-tari']}, {term: 'くる', source: 'こず', rule: 'vk', reasons: ['-zu']}, @@ -881,6 +898,7 @@ const tests = [ {term: '論ずる', source: '論じそう', rule: 'vz', reasons: ['-sou']}, {term: '論ずる', source: '論じすぎる', rule: 'vz', reasons: ['-sugiru']}, {term: '論ずる', source: '論じたい', rule: 'vz', reasons: ['-tai']}, + {term: '論ずる', source: '論じたがる', rule: 'vz', reasons: ['-tai', '-garu']}, {term: '論ずる', source: '論じたら', rule: 'vz', reasons: ['-tara']}, {term: '論ずる', source: '論じたり', rule: 'vz', reasons: ['-tari']}, {term: '論ずる', source: '論ぜず', rule: 'vz', reasons: ['-zu']}, @@ -1070,11 +1088,12 @@ const tests = [ ] }, { - category: 'kawaii (this leads to infinite expansions)', - valid: false, + category: 'kawaii', + valid: true, tests: [ {term: 'かわいい', source: 'かわいげ', rule: 'adj-i', reasons: ['-ge']}, - {term: '可愛い', source: 'かわいげ', rule: 'adj-i', reasons: ['-ge']} + {term: '可愛い', source: '可愛げ', rule: 'adj-i', reasons: ['-ge']}, + {term: '可愛い', source: '可愛気', rule: 'adj-i', reasons: ['-ge']} ] }, { |