pub(crate) fn is_word(ch: char) -> bool {
is_alphanumeric(ch) || is_mark_or_connector(ch)
}
pub(crate) fn is_mark_or_connector(ch: char) -> bool {
matches!(ch as u32,
0x5f | 0x300..=0x344 | 0x346..=0x36f | 0x483..=0x489
| 0x591..=0x5af | 0x658 | 0x6df..=0x6e0 | 0x6ea..=0x6ec
| 0x740..=0x74a | 0x7eb..=0x7f3 | 0x7fd | 0x818..=0x819
| 0x82d | 0x859..=0x85b | 0x898..=0x89f | 0x8ca..=0x8d3
| 0x8e0..=0x8e1 | 0x8ea..=0x8ef | 0x93c | 0x94d
| 0x951..=0x954 | 0x9bc | 0x9cd | 0x9fe
| 0xa3c | 0xa4d | 0xabc | 0xacd
| 0xafd..=0xaff | 0xb3c | 0xb4d | 0xb55
| 0xbcd | 0xc3c | 0xc4d | 0xcbc
| 0xccd | 0xd3b..=0xd3c | 0xd4d | 0xdca
| 0xe47..=0xe4c | 0xe4e | 0xeba | 0xec8..=0xecc
| 0xece | 0xf18..=0xf19 | 0xf35 | 0xf37
| 0xf39 | 0xf3e..=0xf3f | 0xf84 | 0xf86..=0xf87
| 0xfc6 | 0x1037 | 0x1039..=0x103a | 0x135d..=0x135f
| 0x1714..=0x1715 | 0x1734 | 0x17b4..=0x17b5 | 0x17c9..=0x17d3
| 0x17dd | 0x180b..=0x180d | 0x180f | 0x1939..=0x193b
| 0x1a60 | 0x1a75..=0x1a7c | 0x1a7f | 0x1ab0..=0x1abe
| 0x1ac1..=0x1acb | 0x1b34 | 0x1b44 | 0x1b6b..=0x1b73
| 0x1baa..=0x1bab | 0x1be6 | 0x1bf2..=0x1bf3 | 0x1c37
| 0x1cd0..=0x1cd2 | 0x1cd4..=0x1ce8 | 0x1ced | 0x1cf4
| 0x1cf7..=0x1cf9 | 0x1dc0..=0x1de6 | 0x1df5..=0x1dff | 0x203f..=0x2040
| 0x2054 | 0x20d0..=0x20f0 | 0x2cef..=0x2cf1 | 0x2d7f
| 0x302a..=0x302f | 0x3099..=0x309a | 0xa66f..=0xa672 | 0xa67c..=0xa67d
| 0xa6f0..=0xa6f1 | 0xa806 | 0xa82c | 0xa8c4
| 0xa8e0..=0xa8f1 | 0xa92b..=0xa92d | 0xa953 | 0xa9b3
| 0xa9c0 | 0xaabf | 0xaac1 | 0xaaf6
| 0xabec..=0xabed | 0xfe00..=0xfe0f | 0xfe20..=0xfe2f | 0xfe33..=0xfe34
| 0xfe4d..=0xfe4f | 0xff3f | 0x101fd | 0x102e0
| 0x10a38..=0x10a3a | 0x10a3f | 0x10ae5..=0x10ae6 | 0x10efd..=0x10eff
| 0x10f46..=0x10f50 | 0x10f82..=0x10f85 | 0x11046 | 0x11070
| 0x1107f | 0x110b9..=0x110ba | 0x11133..=0x11134 | 0x11173
| 0x111c0 | 0x111c9..=0x111cc | 0x11235..=0x11236 | 0x112e9..=0x112ea
| 0x1133b..=0x1133c | 0x1134d | 0x11366..=0x1136c | 0x11370..=0x11374
| 0x11442 | 0x11446 | 0x1145e | 0x114c2..=0x114c3
| 0x115bf..=0x115c0 | 0x1163f | 0x116b6..=0x116b7 | 0x1172b
| 0x11839..=0x1183a | 0x1193d..=0x1193e | 0x11943 | 0x119e0
| 0x11a33..=0x11a34 | 0x11a47 | 0x11a98..=0x11a99 | 0x11c3f
| 0x11d42 | 0x11d44..=0x11d45 | 0x11d97 | 0x11f41..=0x11f42
| 0x13440 | 0x13447..=0x13455 | 0x16af0..=0x16af4 | 0x16b30..=0x16b36
| 0x16fe4 | 0x1bc9d | 0x1cf00..=0x1cf2d | 0x1cf30..=0x1cf46
| 0x1d165..=0x1d169 | 0x1d16d..=0x1d172 | 0x1d17b..=0x1d182 | 0x1d185..=0x1d18b
| 0x1d1aa..=0x1d1ad | 0x1d242..=0x1d244 | 0x1da00..=0x1da36 | 0x1da3b..=0x1da6c
| 0x1da75 | 0x1da84 | 0x1da9b..=0x1da9f | 0x1daa1..=0x1daaf
| 0x1e130..=0x1e136 | 0x1e2ae | 0x1e2ec..=0x1e2ef | 0x1e4ec..=0x1e4ef
| 0x1e8d0..=0x1e8d6 | 0x1e944..=0x1e946 | 0x1e948..=0x1e94a | 0xe0100..=0xe01ef
)
}
pub(crate) fn is_alphanumeric(ch: char) -> bool {
ch.is_alphabetic() || is_decimal(ch)
}
pub(crate) fn is_decimal(ch: char) -> bool {
matches!(
ch as u32,
0x30..=0x39 | 0x660..=0x669 | 0x6f0..=0x6f9
| 0x7c0..=0x7c9 | 0x966..=0x96f | 0x9e6..=0x9ef
| 0xa66..=0xa6f | 0xae6..=0xaef | 0xb66..=0xb6f
| 0xbe6..=0xbef | 0xc66..=0xc6f | 0xce6..=0xcef
| 0xd66..=0xd6f | 0xde6..=0xdef | 0xe50..=0xe59
| 0xed0..=0xed9 | 0xf20..=0xf29 | 0x1040..=0x1049
| 0x1090..=0x1099 | 0x17e0..=0x17e9 | 0x1810..=0x1819
| 0x1946..=0x194f | 0x19d0..=0x19d9 | 0x1a80..=0x1a89
| 0x1a90..=0x1a99 | 0x1b50..=0x1b59 | 0x1bb0..=0x1bb9
| 0x1c40..=0x1c49 | 0x1c50..=0x1c59 | 0xa620..=0xa629
| 0xa8d0..=0xa8d9 | 0xa900..=0xa909 | 0xa9d0..=0xa9d9
| 0xa9f0..=0xa9f9 | 0xaa50..=0xaa59 | 0xabf0..=0xabf9
| 0xff10..=0xff19 | 0x104a0..=0x104a9 | 0x10d30..=0x10d39
| 0x11066..=0x1106f | 0x110f0..=0x110f9 | 0x11136..=0x1113f
| 0x111d0..=0x111d9 | 0x112f0..=0x112f9 | 0x11450..=0x11459
| 0x114d0..=0x114d9 | 0x11650..=0x11659 | 0x116c0..=0x116c9
| 0x11730..=0x11739 | 0x118e0..=0x118e9 | 0x11950..=0x11959
| 0x11c50..=0x11c59 | 0x11d50..=0x11d59 | 0x11da0..=0x11da9
| 0x11f50..=0x11f59 | 0x16a60..=0x16a69 | 0x16ac0..=0x16ac9
| 0x16b50..=0x16b59 | 0x1d7ce..=0x1d7ff | 0x1e140..=0x1e149
| 0x1e2f0..=0x1e2f9 | 0x1e4f0..=0x1e4f9 | 0x1e950..=0x1e959
| 0x1fbf0..=0x1fbf9
)
}