summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-06-10 21:57:08 +0200
committerGitHub <noreply@github.com>2024-06-10 19:57:08 +0000
commitee2b425ffea94c069d48b6cebcc68352f05c3d50 (patch)
treef58e40b1d0d992ebef8fb83214a46bdc99fe80b2
parente24075e1a91ab8b58bb5836cf7abcefae5cbf8c3 (diff)
fix -masen verbs being deinflected as negative potential polite (#1046)
* test * fix * positive test
-rw-r--r--ext/js/language/ja/japanese-transforms.js51
-rw-r--r--test/language/japanese-transforms.test.js6
2 files changed, 38 insertions, 19 deletions
diff --git a/ext/js/language/ja/japanese-transforms.js b/ext/js/language/ja/japanese-transforms.js
index c8f9f671..8e7ba243 100644
--- a/ext/js/language/ja/japanese-transforms.js
+++ b/ext/js/language/ja/japanese-transforms.js
@@ -72,6 +72,21 @@ export const japaneseTransforms = {
},
],
isDictionaryForm: true,
+ subConditions: ['v5d', 'v5m'],
+ },
+ 'v5d': {
+ name: 'Godan verb, dictionary form',
+ i18n: [
+ {
+ language: 'ja',
+ name: '五段動詞、辞書形',
+ },
+ ],
+ isDictionaryForm: false,
+ },
+ 'v5m': {
+ name: 'Godan verb, polite (masu) form',
+ isDictionaryForm: false,
},
'vk': {
name: 'Kuru verb',
@@ -789,15 +804,15 @@ export const japaneseTransforms = {
name: 'polite',
rules: [
suffixInflection('ます', 'る', ['v1'], ['v1']),
- suffixInflection('います', 'う', ['v5'], ['v5']),
- suffixInflection('きます', 'く', ['v5'], ['v5']),
- suffixInflection('ぎます', 'ぐ', ['v5'], ['v5']),
- suffixInflection('します', 'す', ['v5'], ['v5']),
- suffixInflection('ちます', 'つ', ['v5'], ['v5']),
- suffixInflection('にます', 'ぬ', ['v5'], ['v5']),
- suffixInflection('びます', 'ぶ', ['v5'], ['v5']),
- suffixInflection('みます', 'む', ['v5'], ['v5']),
- suffixInflection('ります', 'る', ['v5'], ['v5']),
+ suffixInflection('います', 'う', ['v5m'], ['v5d']),
+ suffixInflection('きます', 'く', ['v5m'], ['v5d']),
+ suffixInflection('ぎます', 'ぐ', ['v5m'], ['v5d']),
+ suffixInflection('します', 'す', ['v5m'], ['v5d']),
+ suffixInflection('ちます', 'つ', ['v5m'], ['v5d']),
+ suffixInflection('にます', 'ぬ', ['v5m'], ['v5d']),
+ suffixInflection('びます', 'ぶ', ['v5m'], ['v5d']),
+ suffixInflection('みます', 'む', ['v5m'], ['v5d']),
+ suffixInflection('ります', 'る', ['v5m'], ['v5d']),
suffixInflection('じます', 'ずる', ['vz'], ['vz']),
suffixInflection('します', 'する', ['vs'], ['vs']),
suffixInflection('為ます', '為る', ['vs'], ['vs']),
@@ -810,15 +825,15 @@ export const japaneseTransforms = {
'potential': {
name: 'potential',
rules: [
- suffixInflection('れる', 'る', ['v1'], ['v1', 'v5']),
- suffixInflection('える', 'う', ['v1'], ['v5']),
- suffixInflection('ける', 'く', ['v1'], ['v5']),
- suffixInflection('げる', 'ぐ', ['v1'], ['v5']),
- suffixInflection('せる', 'す', ['v1'], ['v5']),
- suffixInflection('てる', 'つ', ['v1'], ['v5']),
- suffixInflection('ねる', 'ぬ', ['v1'], ['v5']),
- suffixInflection('べる', 'ぶ', ['v1'], ['v5']),
- suffixInflection('める', 'む', ['v1'], ['v5']),
+ suffixInflection('れる', 'る', ['v1'], ['v1', 'v5d']),
+ suffixInflection('える', 'う', ['v1'], ['v5d']),
+ suffixInflection('ける', 'く', ['v1'], ['v5d']),
+ suffixInflection('げる', 'ぐ', ['v1'], ['v5d']),
+ suffixInflection('せる', 'す', ['v1'], ['v5d']),
+ suffixInflection('てる', 'つ', ['v1'], ['v5d']),
+ suffixInflection('ねる', 'ぬ', ['v1'], ['v5d']),
+ suffixInflection('べる', 'ぶ', ['v1'], ['v5d']),
+ suffixInflection('める', 'む', ['v1'], ['v5d']),
suffixInflection('できる', 'する', ['v1'], ['vs']),
suffixInflection('出来る', 'する', ['v1'], ['vs']),
suffixInflection('これる', 'くる', ['v1'], ['vk']),
diff --git a/test/language/japanese-transforms.test.js b/test/language/japanese-transforms.test.js
index d0ff131e..f62eef0f 100644
--- a/test/language/japanese-transforms.test.js
+++ b/test/language/japanese-transforms.test.js
@@ -316,6 +316,8 @@ const tests = [
{term: '話す', source: '話してる', rule: 'v5', reasons: ['-te', 'progressive or perfect']},
{term: '話す', source: '話しとる', rule: 'v5', reasons: ['-te', 'progressive or perfect']},
{term: '話す', source: '話してしまう', rule: 'v5', reasons: ['-te', '-shimau']},
+
+ {term: '増す', source: '増せん', rule: 'v5', reasons: ['potential', '-n']},
],
},
{
@@ -1097,10 +1099,12 @@ const tests = [
],
},
{
- category: 'incorrect -te rule chain',
+ category: 'incorrect chains',
valid: false,
tests: [
{term: '食べる', source: '食べて', rule: null, reasons: ['-te', 'progressive or perfect', 'masu stem']},
+
+ {term: 'なる', source: 'なりません', rule: null, reasons: ['polite', 'potential', '-n']},
],
},
// Kansai-ben