1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! Per-language rule aggregators for CJK languages.
//!
//! Covers: Korean (Hangul), Korean Romanization, Japanese Romaji,
//! Chinese Pinyin, Chinese Hanzi.
use crateRewriteRuleChar;
/// Get Korean rule set.
///
/// Returns the complete phonetic normalization rules for Korean Hangul:
/// - Hangul jamo to Latin transliteration
/// - Double consonants (ㄲ→kk, ㄸ→tt, ㅃ→pp, ㅆ→ss, ㅉ→jj)
/// - Aspirated consonants (ㅋ→k, ㅌ→t, ㅍ→p, ㅊ→ch)
/// - Compound finals (ㄳ→ks, ㄵ→nj, etc.)
/// - Vowels and diphthongs
pub
/// Get Korean Romanization rule set.
///
/// Returns the complete phonetic normalization rules for Korean romanization:
/// - McCune-Reischauer breve vowels (ŏ→eo, ŭ→eu)
/// - Aspirate markers (k'→k, t'→t, p'→p, ch'→ch)
/// - Long vowel macrons removal (ā→a, ē→e, etc.)
/// - Variant vowel digraphs (oe→we, ui→i)
pub
/// Get Japanese Romaji rule set.
///
/// Returns the complete phonetic normalization rules for Japanese romanization:
/// - Long vowels (macrons: ā→A, ē→E, ī→I, ō→O, ū→U)
/// - Romanization variants (ti→C, tu→TS, si→S, hu→F)
/// - Digraphs (shi→S, chi→C, tsu→TS)
/// - Gemination (kk→K, pp→P, tt→T)
/// - Syllabic N (n'→N)
pub
/// Get Chinese Pinyin rule set.
///
/// Returns the complete phonetic normalization rules for Chinese Pinyin:
/// - Tone marks (ā á ǎ à → a, etc.)
/// - Ü handling (ü, v → U)
/// - Retroflex consonants (zh→Z, ch→C, sh→S, r→R)
/// - Palatal consonants (x→X, q→Q)
/// - Affricate c (c→TS)
pub
/// Chinese Hanzi phonetic rules.
///
/// Returns rules for normalizing Chinese characters (汉字) to Pinyin.
///
/// # Key Features
///
/// - **HSK 1-4 characters**: ~400 most common characters
/// - **Character→Pinyin mapping**: 我→wo, 你→ni, 好→hao
/// - **Pronouns**: 我→wo, 你→ni, 他/她/它→ta
/// - **Numbers**: 一→yi through 十→shi
/// - **Common verbs**: 是→shi, 有→you, 在→zai, 去→qu, 来→lai
/// - **Common nouns**: 人→ren, 家→jia, 学→xue, 中→zhong, 国→guo
/// - **Multi-character compounds**: 我们→women, 什么→shenme
pub