aboutsummaryrefslogtreecommitdiff
path: root/test/deinflection/cases.ts
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-07-10 16:26:13 +0200
committerlonkaars <loek@pipeframe.xyz>2023-07-10 16:26:13 +0200
commita3a81530a0a30ba02b5253b762e2ccd77d3b01fc (patch)
treeafad1bae0c2f7cb9d4a11b6c1c56bc8bae2f14e5 /test/deinflection/cases.ts
parente430d8cb4a30640298b7fae3c93bc6329e2a0382 (diff)
small restructuring + all deinflection tests working
Diffstat (limited to 'test/deinflection/cases.ts')
-rw-r--r--test/deinflection/cases.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/deinflection/cases.ts b/test/deinflection/cases.ts
index 08517d4..c29bdf1 100644
--- a/test/deinflection/cases.ts
+++ b/test/deinflection/cases.ts
@@ -1,11 +1,11 @@
-import { TokenTags, Tag } from "../../language/tags.ts";
+import { TokenTags, Tag } from "../../search/tags.ts";
const { Inflection } = Tag;
interface Test {
input: string;
mustHave: TokenTags;
mustNotHave: TokenTags;
- forceID?: number;
+ force?: { reading: string, writing: string };
};
export default [
@@ -32,7 +32,7 @@ export default [
{ input: "取るな", mustHave: [ Inflection.Negative, Inflection.Command ], mustNotHave: [], },
// other tests
{ input: "取ったり", mustHave: [ Inflection.Suffix.Tari ], mustNotHave: [ Inflection.Tense.Past ], },
- { input: "早く", mustHave: [ Inflection.Adverb ], mustNotHave: [], },
+ { input: "早く", force: { reading: "はやい", writing: "早い" }, mustHave: [ Inflection.Adverb ], mustNotHave: [], },
{ input: "遊んだり", mustHave: [ Inflection.Suffix.Tari ], mustNotHave: [ Inflection.Tense.Past ], },
{ input: "聞け", mustHave: [ Inflection.Command ], mustNotHave: [], },
{ input: "食べさせる", mustHave: [ Inflection.Causative ], mustNotHave: [], },
@@ -51,13 +51,12 @@ export default [
{ 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 ], },
- { 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.Conditional.Ba ], },
+ { input: "しなければだめ", mustHave: [ Inflection.Obligatory, Inflection.Affirmative ], mustNotHave: [ Inflection.Negative, Inflection.Conditional.Ba ], },
{ input: "行かないと", mustHave: [ Inflection.Obligatory, Inflection.Affirmative ], mustNotHave: [ Inflection.Negative ], },
{ input: "買いたい", mustHave: [ Inflection.Desirable.Itai ], mustNotHave: [], },
{ input: "寝よう", mustHave: [ Inflection.Desirable.Volitional ], mustNotHave: [], },
- // TODO: for this test to work, a parseSentencePart function needs to be made that returns all possible words (currently clipped)
- // { input: "しましょう", forceID: 17327, mustHave: [ Inflection.Desirable.Volitional, Inflection.Polite.Masu ], mustNotHave: [], },
+ { input: "しましょう", force: { reading: "する", writing: "為る" }, mustHave: [ Inflection.Desirable.Volitional, Inflection.Polite.Masu ], mustNotHave: [], },
{ input: "きましょう", mustHave: [ Inflection.Desirable.Volitional, Inflection.Polite.Masu ], mustNotHave: [], },
{ input: "寝ましょう", mustHave: [ Inflection.Desirable.Volitional, Inflection.Polite.Masu ], mustNotHave: [], },
{ input: "行きましょう", mustHave: [ Inflection.Desirable.Volitional, Inflection.Polite.Masu ], mustNotHave: [], },
@@ -76,9 +75,10 @@ export default [
{ input: "聞きなさい", mustHave: [ Inflection.Polite.Nasai ], mustNotHave: [], },
{ input: "座りなさい", mustHave: [ Inflection.Polite.Nasai ], mustNotHave: [], },
{ input: "食べさせられる", mustHave: [ Inflection.Passive, Inflection.Causative ], mustNotHave: [], },
+ { input: "見極めなければならない", mustHave: [ Inflection.Obligatory, Inflection.Affirmative ], mustNotHave: [ Inflection.Conditional.Ba, Inflection.Negative ] }
// TODO: りゃ for いることは
// TODO: じゃ for では
// TODO: なきゃ + なくちゃ
// and more!
-] as Test[];
+] satisfies Test[] as Test[];