aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/japanese.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-14 16:11:07 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-15 22:24:30 -0400
commit264820f2087e7dee13e358ba703d3dd863ed7faa (patch)
tree4293451b03d355fa3df9315db61bb28facb6a9a2 /ext/bg/js/japanese.js
parent0f15cca2dff995218a52ff7066008da4cd414e3f (diff)
Add more unicode code point ranges
Diffstat (limited to 'ext/bg/js/japanese.js')
-rw-r--r--ext/bg/js/japanese.js26
1 files changed, 20 insertions, 6 deletions
diff --git a/ext/bg/js/japanese.js b/ext/bg/js/japanese.js
index 182d5b98..4c2df674 100644
--- a/ext/bg/js/japanese.js
+++ b/ext/bg/js/japanese.js
@@ -84,9 +84,24 @@ const jp = (() => {
const KATAKANA_RANGE = [0x30a0, 0x30ff];
const KANA_RANGES = [HIRAGANA_RANGE, KATAKANA_RANGE];
- const CJK_COMMON_RANGE = [0x4e00, 0x9fff];
- const CJK_RARE_RANGE = [0x3400, 0x4dbf];
- const CJK_RANGES = [CJK_COMMON_RANGE, CJK_RARE_RANGE];
+ const CJK_UNIFIED_IDEOGRAPHS_RANGE = [0x4e00, 0x9fff];
+ const CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_RANGE = [0x3400, 0x4dbf];
+ const CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_RANGE = [0x20000, 0x2a6df];
+ const CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_RANGE = [0x2a700, 0x2b73f];
+ const CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_RANGE = [0x2b740, 0x2b81f];
+ const CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E_RANGE = [0x2b820, 0x2ceaf];
+ const CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F_RANGE = [0x2ceb0, 0x2ebef];
+ const CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_RANGE = [0x2f800, 0x2fa1f];
+ const CJK_UNIFIED_IDEOGRAPHS_RANGES = [
+ CJK_UNIFIED_IDEOGRAPHS_RANGE,
+ CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_RANGE,
+ CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_RANGE,
+ CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_RANGE,
+ CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_RANGE,
+ CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E_RANGE,
+ CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F_RANGE,
+ CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_RANGE
+ ];
const ITERATION_MARK_CODE_POINT = 0x3005;
@@ -95,8 +110,7 @@ const jp = (() => {
HIRAGANA_RANGE,
KATAKANA_RANGE,
- CJK_COMMON_RANGE,
- CJK_RARE_RANGE,
+ ...CJK_UNIFIED_IDEOGRAPHS_RANGES,
[0xff66, 0xff9f], // Halfwidth katakana
@@ -119,7 +133,7 @@ const jp = (() => {
// Character code testing functions
function isCodePointKanji(codePoint) {
- return isCodePointInRanges(codePoint, CJK_RANGES);
+ return isCodePointInRanges(codePoint, CJK_UNIFIED_IDEOGRAPHS_RANGES);
}
function isCodePointKana(codePoint) {