aboutsummaryrefslogtreecommitdiff
path: root/api/japanese.ts
diff options
context:
space:
mode:
Diffstat (limited to 'api/japanese.ts')
-rw-r--r--api/japanese.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/api/japanese.ts b/api/japanese.ts
index 4f176a9..bfb04b4 100644
--- a/api/japanese.ts
+++ b/api/japanese.ts
@@ -70,14 +70,15 @@ export default class Japanese {
normalized: "",
ruby: true,
};
- var kana: boolean = this.writing[0].kanaOnly();
+ var kanji: boolean = this.writing[0].kanjiOnly(true);
for (var char of this.writing) {
- if (char.kanaOnly() != kana) {
+ var kanjiNow = char.kanjiOnly(true);
+ if (kanjiNow != kanji) {
tokens.push({ ...token });
token.writing = "";
}
token.writing += char;
- kana = char.kanaOnly();
+ kanji = kanjiNow;
}
tokens.push(token);