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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//! Language and dialect support for phonetic rules.
//!
//! This module provides a language-aware API for selecting phonetic transformation
//! rules based on BCP 47 language tags (e.g., "en-us", "en-gb", "es", "fr-ca").
//!
//! # Supported Languages
//!
//! ## English
//! - `"en"` / `"en-us"` / `"english"` - American English (default)
//! - Includes yod-dropping (tune → toon, new → noo)
//! - Includes t-flapping (water → wader, butter → budder)
//! - `"en-gb"` / `"british"` - British English (RP)
//! - Includes non-rhotic r-dropping (car → cah, farm → fahm)
//! - Includes broad 'a' in BATH words (bath → bahth, class → clahs)
//!
//! ## Spanish
//! - `"es"` / `"spanish"` / `"castilian"` - Castilian Spanish (Spain)
//! - Includes distinción: z, c(e,i) → θ (theta)
//! - `"es-419"` / `"es-mx"` / `"es-ar"` - Latin American Spanish
//! - Includes seseo: z, c(e,i) → s
//!
//! ## French
//! - `"fr"` / `"french"` - Standard French (Metropolitan)
//! - Standard pronunciation without affrication
//! - `"fr-ca"` / `"quebec"` - Canadian French (Québécois)
//! - Includes affrication: ti → tsi, tu → tsu, di → dzi
//!
//! ## Portuguese
//! - `"pt"` / `"pt-pt"` / `"portuguese"` - European Portuguese (Portugal)
//! - Includes vowel reduction, uvular R, s → sh before consonants
//! - `"pt-br"` / `"brazilian"` - Brazilian Portuguese
//! - Includes t/d palatalization, l vocalization, h-like R
//!
//! ## Italian
//! - `"it"` / `"italian"` - Standard Italian
//! - Includes c/g softening, geminate preservation, gn/gli patterns
//!
//! ## German
//! - `"de"` / `"german"` / `"deutsch"` - Standard German (Hochdeutsch)
//! - Includes umlauts (ä, ö, ü), eszett (ß), CH variations, final devoicing
//!
//! ## Dutch
//! - `"nl"` / `"dutch"` / `"nederlands"` - Standard Dutch (Nederlands)
//! - Includes IJ digraph, guttural G/CH, OE/EU/UI patterns
//!
//! ## Russian
//! - `"ru"` / `"russian"` / `"русский"` - Standard Russian (Cyrillic)
//! - Includes Cyrillic to Latin transliteration, iotated vowels, palatalization
//!
//! ## Korean
//! - `"ko"` / `"korean"` / `"한국어"` - Korean (Hangul)
//! - Includes Hangul jamo to Latin transliteration, double/aspirated consonants
//! - `"ko-latn"` / `"korean-romanization"` - Korean Romanization
//! - Normalizes McCune-Reischauer to Revised Romanization variants
//!
//! ## Hebrew
//! - `"he"` / `"hebrew"` / `"עברית"` - Hebrew
//! - Includes Hebrew letters to Latin, dagesh, shin/sin, final forms
//!
//! ## Polish
//! - `"pl"` / `"polish"` / `"polski"` - Polish
//! - Includes nasal vowels (ą, ę), digraphs (sz, cz, rz), special letters
//!
//! ## Turkish
//! - `"tr"` / `"turkish"` / `"türkçe"` - Turkish (Türkçe)
//! - Includes dotted/undotted I, special consonants (ş, ç, ğ), front vowels
//!
//! ## Japanese Romaji
//! - `"ja-latn"` / `"romaji"` / `"ローマ字"` - Japanese Romaji
//! - Includes long vowels (macrons), romanization variants, gemination
//!
//! ## Chinese Pinyin
//! - `"zh-latn"` / `"pinyin"` / `"拼音"` - Chinese Pinyin
//! - Includes tone mark removal, ü handling, retroflex consonants
//!
//! ## Arabic
//! - `"ar"` / `"arabic"` / `"العربية"` - Arabic (العربية)
//! - Includes Arabic letters to Latin, emphatic consonants, diacritics
//!
//! ## Urdu
//! - `"ur"` / `"urdu"` / `"اردو"` - Urdu (اردو)
//! - Includes Arabic-inherited consonants, Persian additions, retroflex, aspirated
//!
//! ## Hindi
//! - `"hi"` / `"hindi"` / `"हिन्दी"` - Hindi (हिन्दी)
//! - Includes Devanagari consonants, vowel matras, retroflex, aspirated, nukta letters
//!
//! ## Ukrainian
//! - `"uk"` / `"ukrainian"` / `"українська"` - Ukrainian (Українська мова)
//! - Unique letters: і, ї, є, ґ; Ukrainian г→h (not g!); и→y
//!
//! ## Hungarian
//! - `"hu"` / `"hungarian"` / `"magyar"` - Hungarian (Magyar)
//! - 9 digraphs (cs, dz, dzs, gy, ly, ny, sz, ty, zs); S→SH; long/double-acute vowels
//!
//! # Example
//!
//! ```rust,ignore
//! use liblevenshtein::phonetic::language::{rules_for_language, is_supported, default_language};
//!
//! // Check supported languages
//! assert!(is_supported("en-us"));
//! assert!(is_supported("es"));
//! assert!(is_supported("fr-ca"));
//! assert!(is_supported("pt-br"));
//! assert!(is_supported("it"));
//!
//! // Get rules for a language
//! let rules = rules_for_language("es-419").expect("Latin American Spanish is supported");
//! assert!(!rules.is_empty());
//!
//! // Get the default language
//! assert_eq!(default_language(), "en-us");
//! ```
//!
//! # Integration with PhoneticNormalizedDictionary
//!
//! ```rust,ignore
//! use liblevenshtein::dictionary::phonetic_normalized::PhoneticNormalizedDictionary;
//!
//! // Create dictionary with explicit language
//! let dict = PhoneticNormalizedDictionary::<()>::from_terms_with_language(
//! &["phone", "fone", "elephant"],
//! "en-us"
//! );
//!
//! // Query as usual
//! let results = dict.query("fone", 2);
//! ```
// Re-export the public dispatch API so existing call sites
// (`crate::phonetic::language::rules_for_language`, etc.) keep working.
pub use ;