mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
Type: no Japanese–Latin space next to Hangul compatibility or half-width jamo
Follow-up to #370: Hangul Compatibility Jamo (U+3130–318F, ㄱ ㅏ) and half-width Hangul (U+FFA0–FFDC) counted as Japanese letters, so a Latin letter next to them took the quarter em. They are left out like Hangul syllables; the test covers both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
committed by
bflatastic
co-authored by
Claude Opus 5.5
parent
f5183da3dd
commit
6952780c1f
@@ -281,7 +281,10 @@ fn is_japanese_letter(c: char) -> bool {
|
||||
return true;
|
||||
}
|
||||
is_cjk(c)
|
||||
&& !matches!(c as u32, 0x3000..=0x303F | 0xAC00..=0xD7AF | 0xFF01..=0xFF0F | 0xFF1A..=0xFF20 | 0xFF3B..=0xFF40 | 0xFF5B..=0xFF65)
|
||||
&& !matches!(
|
||||
c as u32,
|
||||
0x3000..=0x303F | 0x3130..=0x318F | 0xAC00..=0xD7AF | 0xFF01..=0xFF0F | 0xFF1A..=0xFF20 | 0xFF3B..=0xFF40 | 0xFF5B..=0xFF65 | 0xFFA0..=0xFFDC
|
||||
)
|
||||
&& c != '・'
|
||||
&& punct(c).is_none()
|
||||
}
|
||||
@@ -818,7 +821,8 @@ fn japanese_letters_for_the_latin_space_are_kana_kanji_and_marks_not_hangul_or_p
|
||||
for c in ['あ', 'カ', '漢', '々', '〆', '〇', 'A'] {
|
||||
assert!(is_japanese_letter(c), "{c}");
|
||||
}
|
||||
for c in ['한', '。', '「', '・', '、', 'a'] {
|
||||
// Hangul in every form: syllables, compatibility jamo (ㄱ ㅏ), half-width jamo (ᄀ).
|
||||
for c in ['한', 'ㄱ', 'ㅏ', '\u{FFA1}', '。', '「', '・', '、', 'a'] {
|
||||
assert!(!is_japanese_letter(c), "{c}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user