use crate::phonetic::types::{ContextChar, PhoneChar, RewriteRuleChar};
const FRONT_VOWELS_CHAR: &[char] = &['e', 'i'];
const VOWELS_CHAR: &[char] = &['a', 'e', 'i', 'o', 'u'];
fn rule_ch_to_tsh_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 1,
rule_name: "ch → ç (tsh sound)".to_string(),
pattern: vec![PhoneChar::Consonant('c'), PhoneChar::Consonant('h')],
replacement: vec![PhoneChar::Digraph('c', 'h')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_sh_to_sh_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 2,
rule_name: "sh → $ (sh sound)".to_string(),
pattern: vec![PhoneChar::Consonant('s'), PhoneChar::Consonant('h')],
replacement: vec![PhoneChar::Digraph('s', 'h')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_ph_to_f_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 3,
rule_name: "ph → f".to_string(),
pattern: vec![PhoneChar::Consonant('p'), PhoneChar::Consonant('h')],
replacement: vec![PhoneChar::Consonant('f')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_c_to_s_before_front_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 20,
rule_name: "c → s / _[ie]".to_string(),
pattern: vec![PhoneChar::Consonant('c')],
replacement: vec![PhoneChar::Consonant('s')],
context: ContextChar::BeforeVowel(FRONT_VOWELS_CHAR.to_vec()),
weight: 0.0,
syllable_condition: None,
}
}
fn rule_c_to_k_elsewhere_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 21,
rule_name: "c → k (elsewhere)".to_string(),
pattern: vec![PhoneChar::Consonant('c')],
replacement: vec![PhoneChar::Consonant('k')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_g_to_j_before_front_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 22,
rule_name: "g → j / _[ie]".to_string(),
pattern: vec![PhoneChar::Consonant('g')],
replacement: vec![PhoneChar::Consonant('j')],
context: ContextChar::BeforeVowel(FRONT_VOWELS_CHAR.to_vec()),
weight: 0.0,
syllable_condition: None,
}
}
fn rule_silent_e_final_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 33,
rule_name: "e → ∅ / _#".to_string(),
pattern: vec![PhoneChar::Vowel('e')],
replacement: vec![PhoneChar::Silent],
context: ContextChar::Final,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_gh_silent_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 34,
rule_name: "gh → ∅".to_string(),
pattern: vec![PhoneChar::Consonant('g'), PhoneChar::Consonant('h')],
replacement: vec![PhoneChar::Silent],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn phonetic_th_to_t_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 100,
rule_name: "th → t (phonetic)".to_string(),
pattern: vec![PhoneChar::Consonant('t'), PhoneChar::Consonant('h')],
replacement: vec![PhoneChar::Consonant('t')],
context: ContextChar::Anywhere,
weight: 0.15,
syllable_condition: None,
}
}
fn phonetic_qu_to_kw_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 101,
rule_name: "qu → kw (phonetic)".to_string(),
pattern: vec![PhoneChar::Consonant('q'), PhoneChar::Consonant('u')],
replacement: vec![PhoneChar::Consonant('k'), PhoneChar::Consonant('w')],
context: ContextChar::Anywhere,
weight: 0.15,
syllable_condition: None,
}
}
fn phonetic_kw_to_qu_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 102,
rule_name: "kw → qu (phonetic reverse)".to_string(),
pattern: vec![PhoneChar::Consonant('k'), PhoneChar::Consonant('w')],
replacement: vec![PhoneChar::Consonant('q'), PhoneChar::Consonant('u')],
context: ContextChar::Anywhere,
weight: 0.15,
syllable_condition: None,
}
}
fn rule_x_expand_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 200,
rule_name: "x → yy (expansion test)".to_string(),
pattern: vec![PhoneChar::Consonant('x')],
replacement: vec![PhoneChar::Consonant('y'), PhoneChar::Consonant('y')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_y_to_z_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 201,
rule_name: "y → z (transformation test)".to_string(),
pattern: vec![PhoneChar::Consonant('y')],
replacement: vec![PhoneChar::Consonant('z')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_wr_initial_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 4,
rule_name: "wr → r / #_".to_string(),
pattern: vec![PhoneChar::Consonant('w'), PhoneChar::Consonant('r')],
replacement: vec![PhoneChar::Consonant('r')],
context: ContextChar::Initial,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_wh_initial_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 5,
rule_name: "wh → w / #_".to_string(),
pattern: vec![PhoneChar::Consonant('w'), PhoneChar::Consonant('h')],
replacement: vec![PhoneChar::Consonant('w')],
context: ContextChar::Initial,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_gn_initial_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 6,
rule_name: "gn → n / #_".to_string(),
pattern: vec![PhoneChar::Consonant('g'), PhoneChar::Consonant('n')],
replacement: vec![PhoneChar::Consonant('n')],
context: ContextChar::Initial,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_kn_initial_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 7,
rule_name: "kn → n / #_".to_string(),
pattern: vec![PhoneChar::Consonant('k'), PhoneChar::Consonant('n')],
replacement: vec![PhoneChar::Consonant('n')],
context: ContextChar::Initial,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_mn_initial_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 8,
rule_name: "mn → n / #_".to_string(),
pattern: vec![PhoneChar::Consonant('m'), PhoneChar::Consonant('n')],
replacement: vec![PhoneChar::Consonant('n')],
context: ContextChar::Initial,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_pt_initial_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 9,
rule_name: "pt → t / #_".to_string(),
pattern: vec![PhoneChar::Consonant('p'), PhoneChar::Consonant('t')],
replacement: vec![PhoneChar::Consonant('t')],
context: ContextChar::Initial,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_ps_initial_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 10,
rule_name: "ps → s / #_".to_string(),
pattern: vec![PhoneChar::Consonant('p'), PhoneChar::Consonant('s')],
replacement: vec![PhoneChar::Consonant('s')],
context: ContextChar::Initial,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_tm_initial_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 11,
rule_name: "tm → m / #_".to_string(),
pattern: vec![PhoneChar::Consonant('t'), PhoneChar::Consonant('m')],
replacement: vec![PhoneChar::Consonant('m')],
context: ContextChar::Initial,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_gh_before_vowel_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 35,
rule_name: "gh → g / _[aeiou]".to_string(),
pattern: vec![PhoneChar::Consonant('g'), PhoneChar::Consonant('h')],
replacement: vec![PhoneChar::Consonant('g')],
context: ContextChar::BeforeVowel(VOWELS_CHAR.to_vec()),
weight: 0.0,
syllable_condition: None,
}
}
fn rule_ough_pattern_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 36,
rule_name: "ough → o".to_string(),
pattern: vec![
PhoneChar::Vowel('o'),
PhoneChar::Vowel('u'),
PhoneChar::Consonant('g'),
PhoneChar::Consonant('h'),
],
replacement: vec![PhoneChar::Vowel('o')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_aught_pattern_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 37,
rule_name: "aught → ot".to_string(),
pattern: vec![
PhoneChar::Vowel('a'),
PhoneChar::Vowel('u'),
PhoneChar::Consonant('g'),
PhoneChar::Consonant('h'),
PhoneChar::Consonant('t'),
],
replacement: vec![PhoneChar::Vowel('o'), PhoneChar::Consonant('t')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_ought_pattern_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 38,
rule_name: "ought → ot".to_string(),
pattern: vec![
PhoneChar::Vowel('o'),
PhoneChar::Vowel('u'),
PhoneChar::Consonant('g'),
PhoneChar::Consonant('h'),
PhoneChar::Consonant('t'),
],
replacement: vec![PhoneChar::Vowel('o'), PhoneChar::Consonant('t')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_x_to_ks_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 40,
rule_name: "x → ks".to_string(),
pattern: vec![PhoneChar::Consonant('x')],
replacement: vec![PhoneChar::Consonant('k'), PhoneChar::Consonant('s')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_x_to_gz_voiced_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 41,
rule_name: "x → gz / [aeiou]_[aeiou]".to_string(),
pattern: vec![PhoneChar::Consonant('x')],
replacement: vec![PhoneChar::Consonant('g'), PhoneChar::Consonant('z')],
context: ContextChar::And(
Box::new(ContextChar::AfterVowel(VOWELS_CHAR.to_vec())),
Box::new(ContextChar::BeforeVowel(VOWELS_CHAR.to_vec())),
),
weight: 0.0,
syllable_condition: None,
}
}
fn rule_ea_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 50,
rule_name: "ea → e".to_string(),
pattern: vec![PhoneChar::Vowel('e'), PhoneChar::Vowel('a')],
replacement: vec![PhoneChar::Vowel('e')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_ee_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 51,
rule_name: "ee → e".to_string(),
pattern: vec![PhoneChar::Vowel('e'), PhoneChar::Vowel('e')],
replacement: vec![PhoneChar::Vowel('e')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_ai_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 52,
rule_name: "ai → a".to_string(),
pattern: vec![PhoneChar::Vowel('a'), PhoneChar::Vowel('i')],
replacement: vec![PhoneChar::Vowel('a')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_ay_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 53,
rule_name: "ay → a".to_string(),
pattern: vec![PhoneChar::Vowel('a'), PhoneChar::Consonant('y')],
replacement: vec![PhoneChar::Vowel('a')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_oa_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 54,
rule_name: "oa → o".to_string(),
pattern: vec![PhoneChar::Vowel('o'), PhoneChar::Vowel('a')],
replacement: vec![PhoneChar::Vowel('o')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_oe_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 55,
rule_name: "oe → o".to_string(),
pattern: vec![PhoneChar::Vowel('o'), PhoneChar::Vowel('e')],
replacement: vec![PhoneChar::Vowel('o')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_ou_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 56,
rule_name: "ou → ow".to_string(),
pattern: vec![PhoneChar::Vowel('o'), PhoneChar::Vowel('u')],
replacement: vec![PhoneChar::Vowel('o'), PhoneChar::Consonant('w')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_oi_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 58,
rule_name: "oi → oy".to_string(),
pattern: vec![PhoneChar::Vowel('o'), PhoneChar::Vowel('i')],
replacement: vec![PhoneChar::Vowel('o'), PhoneChar::Consonant('y')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_ey_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 59,
rule_name: "ey → e".to_string(),
pattern: vec![PhoneChar::Vowel('e'), PhoneChar::Consonant('y')],
replacement: vec![PhoneChar::Vowel('e')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_ie_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 60,
rule_name: "ie → i".to_string(),
pattern: vec![PhoneChar::Vowel('i'), PhoneChar::Vowel('e')],
replacement: vec![PhoneChar::Vowel('i')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_oo_digraph_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 61,
rule_name: "oo → u".to_string(),
pattern: vec![PhoneChar::Vowel('o'), PhoneChar::Vowel('o')],
replacement: vec![PhoneChar::Vowel('u')],
context: ContextChar::Anywhere,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_ue_final_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 62,
rule_name: "ue → u / _#".to_string(),
pattern: vec![PhoneChar::Vowel('u'), PhoneChar::Vowel('e')],
replacement: vec![PhoneChar::Vowel('u')],
context: ContextChar::Final,
weight: 0.1,
syllable_condition: None,
}
}
fn rule_bb_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 80,
rule_name: "bb → b".to_string(),
pattern: vec![PhoneChar::Consonant('b'), PhoneChar::Consonant('b')],
replacement: vec![PhoneChar::Consonant('b')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_cc_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 81,
rule_name: "cc → c".to_string(),
pattern: vec![PhoneChar::Consonant('c'), PhoneChar::Consonant('c')],
replacement: vec![PhoneChar::Consonant('c')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_dd_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 82,
rule_name: "dd → d".to_string(),
pattern: vec![PhoneChar::Consonant('d'), PhoneChar::Consonant('d')],
replacement: vec![PhoneChar::Consonant('d')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_ff_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 83,
rule_name: "ff → f".to_string(),
pattern: vec![PhoneChar::Consonant('f'), PhoneChar::Consonant('f')],
replacement: vec![PhoneChar::Consonant('f')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_gg_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 84,
rule_name: "gg → g".to_string(),
pattern: vec![PhoneChar::Consonant('g'), PhoneChar::Consonant('g')],
replacement: vec![PhoneChar::Consonant('g')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_ll_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 85,
rule_name: "ll → l".to_string(),
pattern: vec![PhoneChar::Consonant('l'), PhoneChar::Consonant('l')],
replacement: vec![PhoneChar::Consonant('l')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_mm_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 86,
rule_name: "mm → m".to_string(),
pattern: vec![PhoneChar::Consonant('m'), PhoneChar::Consonant('m')],
replacement: vec![PhoneChar::Consonant('m')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_nn_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 87,
rule_name: "nn → n".to_string(),
pattern: vec![PhoneChar::Consonant('n'), PhoneChar::Consonant('n')],
replacement: vec![PhoneChar::Consonant('n')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_pp_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 88,
rule_name: "pp → p".to_string(),
pattern: vec![PhoneChar::Consonant('p'), PhoneChar::Consonant('p')],
replacement: vec![PhoneChar::Consonant('p')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_rr_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 89,
rule_name: "rr → r".to_string(),
pattern: vec![PhoneChar::Consonant('r'), PhoneChar::Consonant('r')],
replacement: vec![PhoneChar::Consonant('r')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_ss_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 90,
rule_name: "ss → s".to_string(),
pattern: vec![PhoneChar::Consonant('s'), PhoneChar::Consonant('s')],
replacement: vec![PhoneChar::Consonant('s')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_tt_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 91,
rule_name: "tt → t".to_string(),
pattern: vec![PhoneChar::Consonant('t'), PhoneChar::Consonant('t')],
replacement: vec![PhoneChar::Consonant('t')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_zz_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 92,
rule_name: "zz → z".to_string(),
pattern: vec![PhoneChar::Consonant('z'), PhoneChar::Consonant('z')],
replacement: vec![PhoneChar::Consonant('z')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_tion_ending_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 110,
rule_name: "tion → shun".to_string(),
pattern: vec![
PhoneChar::Consonant('t'),
PhoneChar::Vowel('i'),
PhoneChar::Vowel('o'),
PhoneChar::Consonant('n'),
],
replacement: vec![
PhoneChar::Consonant('s'),
PhoneChar::Consonant('h'),
PhoneChar::Vowel('u'),
PhoneChar::Consonant('n'),
],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_sion_ending_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 111,
rule_name: "sion → zhun".to_string(),
pattern: vec![
PhoneChar::Consonant('s'),
PhoneChar::Vowel('i'),
PhoneChar::Vowel('o'),
PhoneChar::Consonant('n'),
],
replacement: vec![
PhoneChar::Consonant('z'),
PhoneChar::Consonant('h'),
PhoneChar::Vowel('u'),
PhoneChar::Consonant('n'),
],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_cious_ending_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 112,
rule_name: "cious → shus".to_string(),
pattern: vec![
PhoneChar::Consonant('c'),
PhoneChar::Vowel('i'),
PhoneChar::Vowel('o'),
PhoneChar::Vowel('u'),
PhoneChar::Consonant('s'),
],
replacement: vec![
PhoneChar::Consonant('s'),
PhoneChar::Consonant('h'),
PhoneChar::Vowel('u'),
PhoneChar::Consonant('s'),
],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_tious_ending_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 113,
rule_name: "tious → shus".to_string(),
pattern: vec![
PhoneChar::Consonant('t'),
PhoneChar::Vowel('i'),
PhoneChar::Vowel('o'),
PhoneChar::Vowel('u'),
PhoneChar::Consonant('s'),
],
replacement: vec![
PhoneChar::Consonant('s'),
PhoneChar::Consonant('h'),
PhoneChar::Vowel('u'),
PhoneChar::Consonant('s'),
],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_tch_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 130,
rule_name: "tch → ch".to_string(),
pattern: vec![
PhoneChar::Consonant('t'),
PhoneChar::Consonant('c'),
PhoneChar::Consonant('h'),
],
replacement: vec![PhoneChar::Consonant('c'), PhoneChar::Consonant('h')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_dge_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 131,
rule_name: "dge → j".to_string(),
pattern: vec![
PhoneChar::Consonant('d'),
PhoneChar::Consonant('g'),
PhoneChar::Vowel('e'),
],
replacement: vec![PhoneChar::Consonant('j')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_ck_simplify_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 132,
rule_name: "ck → k".to_string(),
pattern: vec![PhoneChar::Consonant('c'), PhoneChar::Consonant('k')],
replacement: vec![PhoneChar::Consonant('k')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_mb_final_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 133,
rule_name: "mb → m / _#".to_string(),
pattern: vec![PhoneChar::Consonant('m'), PhoneChar::Consonant('b')],
replacement: vec![PhoneChar::Consonant('m')],
context: ContextChar::Final,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_bt_silent_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 134,
rule_name: "bt → t".to_string(),
pattern: vec![PhoneChar::Consonant('b'), PhoneChar::Consonant('t')],
replacement: vec![PhoneChar::Consonant('t')],
context: ContextChar::Anywhere,
weight: 0.0,
syllable_condition: None,
}
}
fn rule_mn_final_char() -> RewriteRuleChar {
RewriteRuleChar {
rule_id: 135,
rule_name: "mn → m / _#".to_string(),
pattern: vec![PhoneChar::Consonant('m'), PhoneChar::Consonant('n')],
replacement: vec![PhoneChar::Consonant('m')],
context: ContextChar::Final,
weight: 0.0,
syllable_condition: None,
}
}
pub fn orthography_rules_char() -> Vec<RewriteRuleChar> {
vec![
rule_tion_ending_char(), rule_sion_ending_char(), rule_cious_ending_char(), rule_tious_ending_char(), rule_ough_pattern_char(), rule_aught_pattern_char(), rule_ought_pattern_char(), rule_tch_simplify_char(), rule_dge_simplify_char(), rule_gh_before_vowel_char(), rule_ch_to_tsh_char(), rule_sh_to_sh_char(), rule_ph_to_f_char(), rule_wr_initial_char(), rule_wh_initial_char(), rule_gn_initial_char(), rule_kn_initial_char(), rule_mn_initial_char(), rule_pt_initial_char(), rule_ps_initial_char(), rule_tm_initial_char(), rule_x_to_gz_voiced_char(), rule_x_to_ks_char(), rule_c_to_s_before_front_char(), rule_c_to_k_elsewhere_char(), rule_g_to_j_before_front_char(), rule_ck_simplify_char(), rule_mb_final_char(), rule_bt_silent_char(), rule_mn_final_char(), rule_bb_simplify_char(), rule_cc_simplify_char(), rule_dd_simplify_char(), rule_ff_simplify_char(), rule_gg_simplify_char(), rule_ll_simplify_char(), rule_mm_simplify_char(), rule_nn_simplify_char(), rule_pp_simplify_char(), rule_rr_simplify_char(), rule_ss_simplify_char(), rule_tt_simplify_char(), rule_zz_simplify_char(), rule_silent_e_final_char(), rule_gh_silent_char(), ]
}
pub fn vowel_digraph_rules_char() -> Vec<RewriteRuleChar> {
vec![
rule_ea_digraph_char(), rule_ee_digraph_char(), rule_ai_digraph_char(), rule_ay_digraph_char(), rule_oa_digraph_char(), rule_oe_digraph_char(), rule_ou_digraph_char(), rule_oi_digraph_char(), rule_ey_digraph_char(), rule_ie_digraph_char(), rule_oo_digraph_char(), rule_ue_final_char(), ]
}
pub fn phonetic_rules_char() -> Vec<RewriteRuleChar> {
vec![
phonetic_th_to_t_char(),
phonetic_qu_to_kw_char(),
phonetic_kw_to_qu_char(),
]
}
pub fn test_rules_char() -> Vec<RewriteRuleChar> {
vec![rule_x_expand_char(), rule_y_to_z_char()]
}
pub fn zompist_rules_char() -> Vec<RewriteRuleChar> {
let mut rules = Vec::with_capacity(62);
rules.extend(orthography_rules_char());
rules.extend(vowel_digraph_rules_char());
rules.extend(phonetic_rules_char());
rules.extend(test_rules_char());
rules
}