diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/deinflection/cases.ts | 10 | ||||
-rw-r--r-- | test/deinflection/test.ts | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/test/deinflection/cases.ts b/test/deinflection/cases.ts index c29bdf1..3f03f6d 100644 --- a/test/deinflection/cases.ts +++ b/test/deinflection/cases.ts @@ -10,7 +10,7 @@ interface Test { export default [ // jisho.org generated conjugations for 取る (u-verb) - { input: "取る", mustHave: [], mustNotHave: [], }, + { input: "取る", mustHave: [ Inflection.Affirmative ], mustNotHave: [], }, { input: "取らない", mustHave: [ Inflection.Negative ], mustNotHave: [], }, { input: "取ります", mustHave: [ Inflection.Polite.Masu ], mustNotHave: [], }, { input: "取りません", mustHave: [ Inflection.Negative, Inflection.Polite.Masu ], mustNotHave: [], }, @@ -38,13 +38,13 @@ export default [ { input: "食べさせる", mustHave: [ Inflection.Causative ], mustNotHave: [], }, { input: "落ちられる", mustHave: [ Inflection.Potential ], mustNotHave: [], }, { input: "言われる", mustHave: [ Inflection.Passive ], mustNotHave: [], }, - { input: "喋っている", mustHave: [ Inflection.Tense.Continuous ], mustNotHave: [ Inflection.Suffix.Te ], }, + { input: "喋っている", mustHave: [ Inflection.Tense.Continuous ], mustNotHave: [ Inflection.Suffix.Te, Inflection.Tense.Past ], }, { input: "泳げれば", mustHave: [ Inflection.Conditional.Ba ], mustNotHave: [], }, { input: "取らなければ", mustHave: [ Inflection.Conditional.Ba, Inflection.Negative ], mustNotHave: [], }, { input: "入ってはいけない", mustHave: [ Inflection.Obligatory, Inflection.Negative ], mustNotHave: [ Inflection.Affirmative ], }, // obliged + negative = must not ~ { input: "行かなくてはなりません", mustHave: [ Inflection.Obligatory, Inflection.Affirmative ], mustNotHave: [ Inflection.Negative ], }, // obliged + affirmative = must ~ - { input: "しなくちゃ", mustHave: [ Inflection.Obligatory, Inflection.Affirmative ], mustNotHave: [ Inflection.Negative ], }, - { input: "食べなきゃ", mustHave: [ Inflection.Obligatory, Inflection.Affirmative ], mustNotHave: [ Inflection.Negative ], }, + { input: "しなくちゃ", mustHave: [ Inflection.Obligatory, Inflection.Affirmative ], mustNotHave: [ Inflection.Negative, Inflection.Suffix.Te ], }, + { input: "食べなきゃ", mustHave: [ Inflection.Obligatory, Inflection.Affirmative ], mustNotHave: [ Inflection.Negative, Inflection.Conditional.Ba ], }, { input: "行かないと", mustHave: [ Inflection.Obligatory, Inflection.Affirmative ], mustNotHave: [ Inflection.Negative ], }, { input: "入っちゃだめ", mustHave: [ Inflection.Obligatory, Inflection.Negative ], mustNotHave: [ Inflection.Affirmative ], }, { input: "死んじゃだめ", mustHave: [ Inflection.Obligatory, Inflection.Negative ], mustNotHave: [ Inflection.Affirmative ], }, @@ -67,7 +67,7 @@ export default [ { input: "切ってみなかった", mustHave: [ Inflection.Attempt.Miru, Inflection.Negative, Inflection.Tense.Past ], mustNotHave: [ Inflection.Suffix.Te ] }, { input: "見ようとする", mustHave: [ Inflection.Attempt.ToSuru ], mustNotHave: [ Inflection.Desirable.Volitional ], }, { input: "行こうとする", mustHave: [ Inflection.Attempt.ToSuru ], mustNotHave: [ Inflection.Desirable.Volitional ], }, - { input: "避けようとする", mustHave: [ Inflection.Attempt.ToSuru ], mustNotHave: [ Inflection.Desirable.Volitional ], }, + { input: "避けようとする", force: { writing: "避ける", reading: "さける" }, mustHave: [ Inflection.Attempt.ToSuru ], mustNotHave: [ Inflection.Desirable.Volitional, Inflection.Potential ], }, { input: "入ろうとしている", mustHave: [ Inflection.Attempt.ToSuru, Inflection.Tense.Continuous ], mustNotHave: [ Inflection.Desirable.Volitional ], }, { input: "食べなさい", mustHave: [ Inflection.Polite.Nasai ], mustNotHave: [], }, { input: "飲みなさい", mustHave: [ Inflection.Polite.Nasai ], mustNotHave: [], }, diff --git a/test/deinflection/test.ts b/test/deinflection/test.ts index 1d2f172..6c1667b 100644 --- a/test/deinflection/test.ts +++ b/test/deinflection/test.ts @@ -25,6 +25,8 @@ cases.forEach(({ input, mustHave, mustNotHave, force }) => { for (tag of mustNotHave) if (result.tags.includes(tag)) throw new Error(`Deconjugation includes unallowed tag ${tag}`); + + console.log(result.writing + " + " + result.tags.filter(tag => tag.startsWith("infl:") && !tag.startsWith("infl:reason:")).join(" + ")); }); }) |