aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/japanese.ts7
-rw-r--r--api/word.ts5
2 files changed, 8 insertions, 4 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);
diff --git a/api/word.ts b/api/word.ts
index e92bc19..ff07043 100644
--- a/api/word.ts
+++ b/api/word.ts
@@ -52,7 +52,7 @@ function irregularKuru(tags: TokenTags, conjugation: string): string {
].includes(tag as any)) return "こ" + conjugation;
break;
}
- return "く" + conjugation;
+ return "くる";
}
export default class Word extends APIBase {
@@ -115,6 +115,9 @@ export default class Word extends APIBase {
}
furigana(format: JapaneseFormatter) {
+ // don't create furigana for filler/kana only terms
+ if (this.text.writing == this.text.reading) return this.text.writing;
+
return this.text.furigana(format);
}