summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/mixed/js/japanese.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/mixed/js/japanese.js b/ext/mixed/js/japanese.js
index 26349094..44db4b8c 100644
--- a/ext/mixed/js/japanese.js
+++ b/ext/mixed/js/japanese.js
@@ -78,11 +78,18 @@ const jpHalfWidthCharacterMapping = new Map([
function jpIsKanji(c) {
const code = c.charCodeAt(0);
- return code >= 0x4e00 && code < 0x9fb0 || code >= 0x3400 && code < 0x4dc0;
+ return (
+ (code >= 0x4e00 && code < 0x9fb0) ||
+ (code >= 0x3400 && code < 0x4dc0)
+ );
}
function jpIsKana(c) {
- return wanakana.isKana(c);
+ const code = c.charCodeAt(0);
+ return (
+ (code >= 0x3041 && code <= 0x3096) || // hiragana
+ (code >= 0x30a1 && code <= 0x30fc) // katakana
+ );
}
function jpIsJapaneseText(text) {