aboutsummaryrefslogtreecommitdiff
path: root/util/string.ts
diff options
context:
space:
mode:
Diffstat (limited to 'util/string.ts')
-rw-r--r--util/string.ts13
1 files changed, 2 insertions, 11 deletions
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);
}