aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/japanese.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/mixed/js/japanese.js b/ext/mixed/js/japanese.js
index 9f401da7..d24f56a6 100644
--- a/ext/mixed/js/japanese.js
+++ b/ext/mixed/js/japanese.js
@@ -26,6 +26,15 @@ function jpIsKana(c) {
return wanakana.isKana(c);
}
+function jpIsJapaneseText(text) {
+ for (const c of text) {
+ if (jpIsKanji(c) || jpIsKana(c)) {
+ return true;
+ }
+ }
+ return false;
+}
+
function jpKatakanaToHiragana(text) {
let result = '';
for (const c of text) {