diff options
| author | lonkaars <loek@pipeframe.xyz> | 2023-07-08 23:43:14 +0200 |
|---|---|---|
| committer | lonkaars <loek@pipeframe.xyz> | 2023-07-08 23:43:14 +0200 |
| commit | d36cefb50ddf67daa08a221d2de4d3eaae9e2492 (patch) | |
| tree | bf8139bd668f1d99304f3f92ec01e9172a67e463 /language | |
| parent | 92bc1ed78859984486336d95641ddbdca8d02841 (diff) | |
more deinflections
Diffstat (limited to 'language')
| -rw-r--r-- | language/tags.ts | 9 |
1 files changed, 8 insertions, 1 deletions
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); } |