Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ja] deinflect -nya as -neba+ya #1279

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions ext/js/language/ja/japanese-transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,22 +801,22 @@ export const japaneseTransforms = {
},
],
rules: [
suffixInflection('ねば', 'る', [], ['v1']),
suffixInflection('かねば', 'く', [], ['v5']),
suffixInflection('がねば', 'ぐ', [], ['v5']),
suffixInflection('さねば', 'す', [], ['v5']),
suffixInflection('たねば', 'つ', [], ['v5']),
suffixInflection('なねば', 'ぬ', [], ['v5']),
suffixInflection('ばねば', 'ぶ', [], ['v5']),
suffixInflection('まねば', 'む', [], ['v5']),
suffixInflection('らねば', 'る', [], ['v5']),
suffixInflection('わねば', 'う', [], ['v5']),
suffixInflection('ぜねば', 'ずる', [], ['vz']),
suffixInflection('せねば', 'する', [], ['vs']),
suffixInflection('為ねば', '為る', [], ['vs']),
suffixInflection('こねば', 'くる', [], ['vk']),
suffixInflection('来ねば', '来る', [], ['vk']),
suffixInflection('來ねば', '來る', [], ['vk']),
suffixInflection('ねば', 'る', ['-ba'], ['v1']),
suffixInflection('かねば', 'く', ['-ba'], ['v5']),
suffixInflection('がねば', 'ぐ', ['-ba'], ['v5']),
suffixInflection('さねば', 'す', ['-ba'], ['v5']),
suffixInflection('たねば', 'つ', ['-ba'], ['v5']),
suffixInflection('なねば', 'ぬ', ['-ba'], ['v5']),
suffixInflection('ばねば', 'ぶ', ['-ba'], ['v5']),
suffixInflection('まねば', 'む', ['-ba'], ['v5']),
suffixInflection('らねば', 'る', ['-ba'], ['v5']),
suffixInflection('わねば', 'う', ['-ba'], ['v5']),
suffixInflection('ぜねば', 'ずる', ['-ba'], ['vz']),
suffixInflection('せねば', 'する', ['-ba'], ['vs']),
suffixInflection('為ねば', '為る', ['-ba'], ['vs']),
suffixInflection('こねば', 'くる', ['-ba'], ['vk']),
suffixInflection('来ねば', '来る', ['-ba'], ['vk']),
suffixInflection('來ねば', '來る', ['-ba'], ['vk']),
],
},
'-ku': {
Expand Down
16 changes: 16 additions & 0 deletions test/language/japanese-transforms.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const tests = [
{term: '食べる', source: '食べん', rule: 'v1', reasons: ['-n']},
{term: '食べる', source: '食べざる', rule: 'v1', reasons: ['-zaru']},
{term: '食べる', source: '食べねば', rule: 'v1', reasons: ['-neba']},
{term: '食べる', source: '食べにゃ', rule: 'v1', reasons: ['-neba', '-ya']},
{term: '食べる', source: '食べ', rule: 'v1d', reasons: ['continuative']},
{term: '食べる', source: '食べましょう', rule: 'v1', reasons: ['-masu', 'volitional']},
{term: '食べる', source: '食べよう', rule: 'v1', reasons: ['volitional']},
Expand Down Expand Up @@ -145,6 +146,7 @@ const tests = [
{term: '買う', source: '買わん', rule: 'v5', reasons: ['-n']},
{term: '買う', source: '買わざる', rule: 'v5', reasons: ['-zaru']},
{term: '買う', source: '買わねば', rule: 'v5', reasons: ['-neba']},
{term: '買う', source: '買わにゃ', rule: 'v5', reasons: ['-neba', '-ya']},
{term: '買う', source: '買い', rule: 'v5', reasons: ['continuative']},
{term: '買う', source: '買いましょう', rule: 'v5', reasons: ['-masu', 'volitional']},
{term: '買う', source: '買おう', rule: 'v5', reasons: ['volitional']},
Expand Down Expand Up @@ -201,6 +203,7 @@ const tests = [
{term: '行く', source: '行かん', rule: 'v5', reasons: ['-n']},
{term: '行く', source: '行かざる', rule: 'v5', reasons: ['-zaru']},
{term: '行く', source: '行かねば', rule: 'v5', reasons: ['-neba']},
{term: '行く', source: '行かにゃ', rule: 'v5', reasons: ['-neba', '-ya']},
{term: '行く', source: '行き', rule: 'v5', reasons: ['continuative']},
StefanVukovic99 marked this conversation as resolved.
Show resolved Hide resolved
{term: '行く', source: '行きましょう', rule: 'v5', reasons: ['-masu', 'volitional']},
{term: '行く', source: '行こう', rule: 'v5', reasons: ['volitional']},
Expand Down Expand Up @@ -257,6 +260,7 @@ const tests = [
{term: '泳ぐ', source: '泳がん', rule: 'v5', reasons: ['-n']},
{term: '泳ぐ', source: '泳がざる', rule: 'v5', reasons: ['-zaru']},
{term: '泳ぐ', source: '泳がねば', rule: 'v5', reasons: ['-neba']},
{term: '泳ぐ', source: '泳がにゃ', rule: 'v5', reasons: ['-neba', '-ya']},
{term: '泳ぐ', source: '泳ぎ', rule: 'v5', reasons: ['continuative']},
{term: '泳ぐ', source: '泳ぎましょう', rule: 'v5', reasons: ['-masu', 'volitional']},
{term: '泳ぐ', source: '泳ごう', rule: 'v5', reasons: ['volitional']},
Expand Down Expand Up @@ -312,6 +316,7 @@ const tests = [
{term: '話す', source: '話さん', rule: 'v5', reasons: ['-n']},
{term: '話す', source: '話さざる', rule: 'v5', reasons: ['-zaru']},
{term: '話す', source: '話さねば', rule: 'v5', reasons: ['-neba']},
{term: '話す', source: '話さにゃ', rule: 'v5', reasons: ['-neba', '-ya']},
{term: '話す', source: '話し', rule: 'v5', reasons: ['continuative']},
{term: '話す', source: '話しましょう', rule: 'v5', reasons: ['-masu', 'volitional']},
{term: '話す', source: '話そう', rule: 'v5', reasons: ['volitional']},
Expand Down Expand Up @@ -370,6 +375,7 @@ const tests = [
{term: '待つ', source: '待たん', rule: 'v5', reasons: ['-n']},
{term: '待つ', source: '待たざる', rule: 'v5', reasons: ['-zaru']},
{term: '待つ', source: '待たねば', rule: 'v5', reasons: ['-neba']},
{term: '待つ', source: '待たにゃ', rule: 'v5', reasons: ['-neba', '-ya']},
{term: '待つ', source: '待ち', rule: 'v5', reasons: ['continuative']},
{term: '待つ', source: '待ちましょう', rule: 'v5', reasons: ['-masu', 'volitional']},
{term: '待つ', source: '待とう', rule: 'v5', reasons: ['volitional']},
Expand Down Expand Up @@ -426,6 +432,7 @@ const tests = [
{term: '死ぬ', source: '死なん', rule: 'v5', reasons: ['-n']},
{term: '死ぬ', source: '死なざる', rule: 'v5', reasons: ['-zaru']},
{term: '死ぬ', source: '死なねば', rule: 'v5', reasons: ['-neba']},
{term: '死ぬ', source: '死なにゃ', rule: 'v5', reasons: ['-neba', '-ya']},
{term: '死ぬ', source: '死に', rule: 'v5', reasons: ['continuative']},
{term: '死ぬ', source: '死にましょう', rule: 'v5', reasons: ['-masu', 'volitional']},
{term: '死ぬ', source: '死のう', rule: 'v5', reasons: ['volitional']},
Expand Down Expand Up @@ -481,6 +488,7 @@ const tests = [
{term: '遊ぶ', source: '遊ばん', rule: 'v5', reasons: ['-n']},
{term: '遊ぶ', source: '遊ばざる', rule: 'v5', reasons: ['-zaru']},
{term: '遊ぶ', source: '遊ばねば', rule: 'v5', reasons: ['-neba']},
{term: '遊ぶ', source: '遊ばにゃ', rule: 'v5', reasons: ['-neba', '-ya']},
{term: '遊ぶ', source: '遊び', rule: 'v5', reasons: ['continuative']},
{term: '遊ぶ', source: '遊びましょう', rule: 'v5', reasons: ['-masu', 'volitional']},
{term: '遊ぶ', source: '遊ぼう', rule: 'v5', reasons: ['volitional']},
Expand Down Expand Up @@ -536,6 +544,7 @@ const tests = [
{term: '飲む', source: '飲まん', rule: 'v5', reasons: ['-n']},
{term: '飲む', source: '飲まざる', rule: 'v5', reasons: ['-zaru']},
{term: '飲む', source: '飲まねば', rule: 'v5', reasons: ['-neba']},
{term: '飲む', source: '飲まにゃ', rule: 'v5', reasons: ['-neba', '-ya']},
{term: '飲む', source: '飲み', rule: 'v5', reasons: ['continuative']},
{term: '飲む', source: '飲みましょう', rule: 'v5', reasons: ['-masu', 'volitional']},
{term: '飲む', source: '飲もう', rule: 'v5', reasons: ['volitional']},
Expand Down Expand Up @@ -591,6 +600,7 @@ const tests = [
{term: '作る', source: '作らん', rule: 'v5', reasons: ['-n']},
{term: '作る', source: '作らざる', rule: 'v5', reasons: ['-zaru']},
{term: '作る', source: '作らねば', rule: 'v5', reasons: ['-neba']},
{term: '作る', source: '作らにゃ', rule: 'v5', reasons: ['-neba', '-ya']},
{term: '作る', source: '作り', rule: 'v5', reasons: ['continuative']},
{term: '作る', source: '作りましょう', rule: 'v5', reasons: ['-masu', 'volitional']},
{term: '作る', source: '作ろう', rule: 'v5', reasons: ['volitional']},
Expand Down Expand Up @@ -651,6 +661,7 @@ const tests = [
{term: '為る', source: '為ん', rule: 'vs', reasons: ['-n']},
{term: '為る', source: '為ざる', rule: 'vs', reasons: ['-zaru']},
{term: '為る', source: '為ねば', rule: 'vs', reasons: ['-neba']},
{term: '為る', source: '為にゃ', rule: 'vs', reasons: ['-neba', '-ya']},
// ['continuative']
{term: '為る', source: '為ましょう', rule: 'vs', reasons: ['-masu', 'volitional']},
{term: '為る', source: '為よう', rule: 'vs', reasons: ['volitional']},
Expand Down Expand Up @@ -708,6 +719,7 @@ const tests = [
{term: 'する', source: 'せん', rule: 'vs', reasons: ['-n']},
{term: 'する', source: 'せざる', rule: 'vs', reasons: ['-zaru']},
{term: 'する', source: 'せねば', rule: 'vs', reasons: ['-neba']},
{term: 'する', source: 'せにゃ', rule: 'vs', reasons: ['-neba', '-ya']},
{term: 'する', source: 'し', rule: 'vs', reasons: ['continuative']},
{term: 'する', source: 'しましょう', rule: 'vs', reasons: ['-masu', 'volitional']},
{term: 'する', source: 'しよう', rule: 'vs', reasons: ['volitional']},
Expand Down Expand Up @@ -760,6 +772,7 @@ const tests = [
{term: '来る', source: '来ん', rule: 'vk', reasons: ['-n']},
{term: '来る', source: '来ざる', rule: 'vk', reasons: ['-zaru']},
{term: '来る', source: '来ねば', rule: 'vk', reasons: ['-neba']},
{term: '来る', source: '来にゃ', rule: 'vk', reasons: ['-neba', '-ya']},
{term: '来る', source: '来', rule: 'vk', reasons: ['continuative']},
{term: '来る', source: '来ましょう', rule: 'vk', reasons: ['-masu', 'volitional']},
{term: '来る', source: '来よう', rule: 'vk', reasons: ['volitional']},
Expand Down Expand Up @@ -811,6 +824,7 @@ const tests = [
{term: '來る', source: '來ん', rule: 'vk', reasons: ['-n']},
{term: '來る', source: '來ざる', rule: 'vk', reasons: ['-zaru']},
{term: '來る', source: '來ねば', rule: 'vk', reasons: ['-neba']},
{term: '來る', source: '來にゃ', rule: 'vk', reasons: ['-neba', '-ya']},
{term: '來る', source: '來', rule: 'vk', reasons: ['continuative']},
{term: '來る', source: '來ましょう', rule: 'vk', reasons: ['-masu', 'volitional']},
{term: '來る', source: '來よう', rule: 'vk', reasons: ['volitional']},
Expand Down Expand Up @@ -862,6 +876,7 @@ const tests = [
{term: 'くる', source: 'こん', rule: 'vk', reasons: ['-n']},
{term: 'くる', source: 'こざる', rule: 'vk', reasons: ['-zaru']},
{term: 'くる', source: 'こねば', rule: 'vk', reasons: ['-neba']},
{term: 'くる', source: 'こにゃ', rule: 'vk', reasons: ['-neba', '-ya']},
{term: 'くる', source: 'き', rule: 'vk', reasons: ['continuative']},
{term: 'くる', source: 'きましょう', rule: 'vk', reasons: ['-masu', 'volitional']},
{term: 'くる', source: 'こよう', rule: 'vk', reasons: ['volitional']},
Expand Down Expand Up @@ -925,6 +940,7 @@ const tests = [
{term: '論ずる', source: '論ぜん', rule: 'vz', reasons: ['-n']},
{term: '論ずる', source: '論ぜざる', rule: 'vz', reasons: ['-zaru']},
{term: '論ずる', source: '論ぜねば', rule: 'vz', reasons: ['-neba']},
{term: '論ずる', source: '論ぜにゃ', rule: 'vz', reasons: ['-neba', '-ya']},
// ['continuative']
{term: '論ずる', source: '論じましょう', rule: 'vz', reasons: ['-masu', 'volitional']},
{term: '論ずる', source: '論じよう', rule: 'vz', reasons: ['volitional']},
Expand Down
Loading