From c998e1c0477d51c886f9e4246e102dec4d7ef8dd Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 29 Jun 2023 11:33:23 +0200 Subject: add jmdict importer to repo --- util/string.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'util') diff --git a/util/string.ts b/util/string.ts index d94f5a3..e0cc5eb 100644 --- a/util/string.ts +++ b/util/string.ts @@ -1,4 +1,4 @@ -import { TokenTags, TokenTag, Tag } from "../language/tags.ts"; +import { TokenTags, parseTags } from "../language/tags.ts"; import JapaneseString from "../language/japanese.ts"; declare global { @@ -60,15 +60,6 @@ String.prototype.jp = function() { /** @summary parse concatenated tag string to TokenTags */ String.prototype.parseTags = function() { - var tags = this.replaceAll(/ +/g, " ").trim().split(" ") as TokenTag[]; - var filteredTags: TokenTag[] = []; - for (var tag of tags) { - // skip past tense tags after -te and -tari deinflection - if (tag == Tag.Inflection.Tense.Past && - filteredTags.anyOf([Tag.Inflection.Suffix.Te, Tag.Inflection.Suffix.Tari])) continue; - - filteredTags.push(tag); - } - return new Set(filteredTags) as TokenTags; + return parseTags(this as string); } -- cgit v1.2.3