From d36cefb50ddf67daa08a221d2de4d3eaae9e2492 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 8 Jul 2023 23:43:14 +0200 Subject: more deinflections --- language/tags.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'language') diff --git a/language/tags.ts b/language/tags.ts index 7f5757f..a9fc5ca 100644 --- a/language/tags.ts +++ b/language/tags.ts @@ -73,6 +73,8 @@ export const Tag = { Tense: { /** @constant past tense (e.g. 叩いた) */ Past: "infl:tense:past", + /** @constant continuous tense (e.g. 喋っている) */ + Continuous: "infl:tense:cont", }, /** @constant adverbs (e.g. 早く) */ Adverb: "infl:adverb", @@ -87,6 +89,8 @@ export const Tag = { Te: "infl:suffix:te", /** @constant -tari ending (e.g. 遊んだり) */ Tari: "infl:suffix:tari", + /** @constant -ba ending for conditionals (e.g. 泳げれば)*/ + Ba: "infl:suffix:ba", }, /** @constant internal deinflection rules */ Reason: { @@ -137,9 +141,12 @@ export function parseTags(input: string) { var tags = input.replaceAll(/ +/g, " ").trim().split(" ") as TokenTag[]; var filteredTags: TokenTag[] = []; for (var tag of tags) { - // skip past tense tags after -te and -tari deinflection + // skip past tense tag if used as step for -te and -tari inflection if (tag == Tag.Inflection.Tense.Past && filteredTags.anyOf([Tag.Inflection.Suffix.Te, Tag.Inflection.Suffix.Tari])) continue; + // skip -te suffix tag if it's a base for continuous tense + if (tag == Tag.Inflection.Suffix.Te && + filteredTags.anyOf([Tag.Inflection.Tense.Continuous])) continue; filteredTags.push(tag); } -- cgit v1.2.3