diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-07-05 18:23:56 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-07-05 18:23:56 +0200 |
commit | 4e32a1942ff2478b557af1b900b3f3282d7ce55b (patch) | |
tree | dda6cc88d4113d691cf8a16c49f3e13890b9d67d /language/parser.ts | |
parent | 5b0b8c82a8477cfe49a538f267805488daa7f5bd (diff) |
fix examples/furigana-html.ts
Diffstat (limited to 'language/parser.ts')
-rw-r--r-- | language/parser.ts | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/language/parser.ts b/language/parser.ts index 40bdd81..6398595 100644 --- a/language/parser.ts +++ b/language/parser.ts @@ -1,15 +1,10 @@ -import { Tag } from "./tags.ts"; +import { Tag, TagGroup } from "./tags.ts"; import { ParseResult, InputSentenceProps, ParseDepth } from "./types.ts"; import DB from "../db/db.ts"; import "../util/array.ts"; import "../util/set.ts"; import { DeepPartial } from "../util/types.ts"; -const CONJUGABLE_TAGS = [ - ...Object.values(Tag.Class.Verb), - ...Object.values(Tag.Class.Adjective), -]; - // TODO: rename Parser to Search /** @summary main Parser class */ export default class Parser { @@ -71,7 +66,7 @@ export default class Parser { // deconjugated words if (result.depth > 0) { // check if this word can be conjugated at all - if (!result.tags.anyOf(CONJUGABLE_TAGS)) return false; + if (!result.tags.anyOf(TagGroup.Conjugable as string[])) return false; // ignore other wrong deconjugations if (result.tags.includes(Tag.Class.Verb.U) && |