blib/lib/AmberDB/Locale/Lang/gb.pm untested

filter: Statementstmt 0.0% 0 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 39 CC 1 SCAR 6.9
CC
1
Cov
0%
data
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package AmberDB::Locale::Lang::gb;
2  
3 use 5.016;
4 use warnings;
5 use utf8;
6  
7 our $VERSION = '5.26.6';
8 my $CREATED = '2026-09-03';
9  
10 # -------------------------------------------------------
11 # Global Base (gb) Locale Data for AmberDB::Locale.
12 #
13 # Pure data module — no logic, no methods other than data().
14 #
15 # Design Principles for Global Base (gb):
16 # 1. Universal Multilingual Support: Designed for international,
17 # cross-border datasets combining English, Turkish, German,
18 # French, Spanish, Italian, Scandinavian, and Slavic-Latin text.
19 # 2. Comprehensive Alphabet: alphabet_chars includes all European,
20 # Nordic, and Turkish extended Latin letters so no valid characters
21 # are stripped during text sanitization.
22 # 3. Permissive Search Regex: regex_map expands characters across their
23 # accented and unaccented forms (e.g. searching 'cafe' matches 'café',
24 # 'munchen' matches 'münchen', 'seker' matches 'şeker').
25 # 4. Canonical Accent Folding: accent_map flattens accented letters
26 # to base Latin forms for high-recall inverted search indexing (.src).
27 # 5. Lossless ASCII Transliteration: ascii_map cleanly converts
28 # non-decomposable Unicode ligatures (ß->ss, æ->ae, œ->oe, ø->o,
29 # ı->i, ł->l, ð->d, þ->th, ə->e) for URL slugs and ASCII IDs.
30 # 6. International Formatting: Default numbers, dates, and currency
31 # follow ISO and international English conventions (USD/cent, . decimal).
32 # -------------------------------------------------------
33 sub data {
34 return {
35  
36 # ---------------------------------------------------------
37 # Casing special-cases
38 # uc_map: applied BEFORE Perl's uc()
39 # lc_map: applied BEFORE Perl's lc()
40 # Standard Unicode casing handles almost all Latin chars.
41 # Turkish dotted capital İ -> i is preserved during lc.
42 # ---------------------------------------------------------
43 uc_map => {},
44 lc_map => {
45 "\x{130}" => 'i', # Turkish dotted capital İ -> i
46 },
47  
48 # ---------------------------------------------------------
49 # Case-insensitive & accent-tolerant search regex character map
50 # Maps both base and accented characters to a regex character class
51 # covering all regional variations.
52 # ---------------------------------------------------------
53 regex_map => {
54 # A variations: a, á, à, â, ä, ã, å, ā, æ
55 'a' => '[aA\x{E1}\x{C1}\x{E0}\x{C0}\x{E2}\x{C2}\x{E4}\x{C4}\x{E3}\x{C3}\x{E5}\x{C5}\x{101}\x{100}\x{E6}\x{C6}]',
56 'A' => '[aA\x{E1}\x{C1}\x{E0}\x{C0}\x{E2}\x{C2}\x{E4}\x{C4}\x{E3}\x{C3}\x{E5}\x{C5}\x{101}\x{100}\x{E6}\x{C6}]',
57  
58 # C variations: c, ç, ć, č
59 'c' => '[cC\x{E7}\x{C7}\x{107}\x{106}\x{10D}\x{10C}]',
60 'C' => '[cC\x{E7}\x{C7}\x{107}\x{106}\x{10D}\x{10C}]',
61 "\x{E7}" => '[cC\x{E7}\x{C7}\x{107}\x{106}\x{10D}\x{10C}]', # ç
62 "\x{C7}" => '[cC\x{E7}\x{C7}\x{107}\x{106}\x{10D}\x{10C}]', # Ç
63  
64 # D variations: d, ð, đ
65 'd' => '[dD\x{F0}\x{D0}\x{111}\x{110}]',
66 'D' => '[dD\x{F0}\x{D0}\x{111}\x{110}]',
67  
68 # E variations: e, é, è, ê, ë, ē, ė, ę, ə
69 'e' => '[eE\x{E9}\x{C9}\x{E8}\x{C8}\x{EA}\x{CA}\x{EB}\x{CB}\x{113}\x{112}\x{117}\x{116}\x{119}\x{118}\x{259}\x{18F}]',
70 'E' => '[eE\x{E9}\x{C9}\x{E8}\x{C8}\x{EA}\x{CA}\x{EB}\x{CB}\x{113}\x{112}\x{117}\x{116}\x{119}\x{118}\x{259}\x{18F}]',
71  
72 # G variations: g, ğ
73 'g' => '[gG\x{11F}\x{11E}]',
74 'G' => '[gG\x{11F}\x{11E}]',
75 "\x{11F}" => '[gG\x{11F}\x{11E}]', # ğ
76 "\x{11E}" => '[gG\x{11F}\x{11E}]', # Ğ
77  
78 # I variations: i, I, ı, İ, î, ï, í, ì, ī
79 'i' => '[iI\x{131}I\x{130}i\x{EE}\x{CE}\x{EF}\x{CF}\x{ED}\x{CD}\x{EC}\x{CC}\x{12B}\x{12A}]',
80 'I' => '[iI\x{131}I\x{130}i\x{EE}\x{CE}\x{EF}\x{CF}\x{ED}\x{CD}\x{EC}\x{CC}\x{12B}\x{12A}]',
81 "\x{131}" => '[iI\x{131}I\x{130}i\x{EE}\x{CE}\x{EF}\x{CF}\x{ED}\x{CD}\x{EC}\x{CC}\x{12B}\x{12A}]', # ı
82 "\x{130}" => '[iI\x{131}I\x{130}i\x{EE}\x{CE}\x{EF}\x{CF}\x{ED}\x{CD}\x{EC}\x{CC}\x{12B}\x{12A}]', # İ
83  
84 # L variations: l, ł
85 'l' => '[lL\x{142}\x{141}]',
86 'L' => '[lL\x{142}\x{141}]',
87  
88 # N variations: n, ñ, ń
89 'n' => '[nN\x{F1}\x{D1}\x{144}\x{143}]',
90 'N' => '[nN\x{F1}\x{D1}\x{144}\x{143}]',
91  
92 # O variations: o, ó, ò, ô, ö, õ, ø, ō, œ
93 'o' => '[oO\x{F3}\x{D3}\x{F2}\x{D2}\x{F4}\x{D4}\x{F6}\x{D6}\x{F5}\x{D5}\x{F8}\x{D8}\x{14D}\x{14C}\x{153}\x{152}]',
94 'O' => '[oO\x{F3}\x{D3}\x{F2}\x{D2}\x{F4}\x{D4}\x{F6}\x{D6}\x{F5}\x{D5}\x{F8}\x{D8}\x{14D}\x{14C}\x{153}\x{152}]',
95 "\x{F6}" => '[oO\x{F3}\x{D3}\x{F2}\x{D2}\x{F4}\x{D4}\x{F6}\x{D6}\x{F5}\x{D5}\x{F8}\x{D8}\x{14D}\x{14C}\x{153}\x{152}]', # ö
96 "\x{D6}" => '[oO\x{F3}\x{D3}\x{F2}\x{D2}\x{F4}\x{D4}\x{F6}\x{D6}\x{F5}\x{D5}\x{F8}\x{D8}\x{14D}\x{14C}\x{153}\x{152}]', # Ö
97  
98 # S variations: s, ş, ś, š, ß
99 's' => '[sS\x{15F}\x{15E}\x{15B}\x{15A}\x{161}\x{160}\x{DF}]',
100 'S' => '[sS\x{15F}\x{15E}\x{15B}\x{15A}\x{161}\x{160}\x{DF}]',
101 "\x{15F}" => '[sS\x{15F}\x{15E}\x{15B}\x{15A}\x{161}\x{160}\x{DF}]', # ş
102 "\x{15E}" => '[sS\x{15F}\x{15E}\x{15B}\x{15A}\x{161}\x{160}\x{DF}]', # Ş
103 "\x{DF}" => '[sS\x{15F}\x{15E}\x{15B}\x{15A}\x{161}\x{160}\x{DF}]', # ß
104  
105 # T variations: t, þ
106 't' => '[tT\x{FE}\x{DE}]',
107 'T' => '[tT\x{FE}\x{DE}]',
108  
109 # U variations: u, ú, ù, û, ü, ū
110 'u' => '[uU\x{FA}\x{DA}\x{F9}\x{D9}\x{FB}\x{DB}\x{FC}\x{DC}\x{16B}\x{16A}]',
111 'U' => '[uU\x{FA}\x{DA}\x{F9}\x{D9}\x{FB}\x{DB}\x{FC}\x{DC}\x{16B}\x{16A}]',
112 "\x{FC}" => '[uU\x{FA}\x{DA}\x{F9}\x{D9}\x{FB}\x{DB}\x{FC}\x{DC}\x{16B}\x{16A}]', # ü
113 "\x{DC}" => '[uU\x{FA}\x{DA}\x{F9}\x{D9}\x{FB}\x{DB}\x{FC}\x{DC}\x{16B}\x{16A}]', # Ü
114  
115 # Y variations: y, ý, ÿ
116 'y' => '[yY\x{FD}\x{DD}\x{FF}]',
117 'Y' => '[yY\x{FD}\x{DD}\x{FF}]',
118  
119 # Z variations: z, ź, ż, ž
120 'z' => '[zZ\x{17A}\x{179}\x{17C}\x{17B}\x{17E}\x{17D}]',
121 'Z' => '[zZ\x{17A}\x{179}\x{17C}\x{17B}\x{17E}\x{17D}]',
122 },
123  
124 # ---------------------------------------------------------
125 # Phonetic assimilation & double-consonant reduction
126 # ---------------------------------------------------------
127 phonetic_map => [
128 [ 'bb' => 'b' ],
129 [ 'dd' => 'd' ],
130 [ 'ff' => 'f' ],
131 [ 'gg' => 'g' ],
132 [ 'll' => 'l' ],
133 [ 'mm' => 'm' ],
134 [ 'nn' => 'n' ],
135 [ 'pp' => 'p' ],
136 [ 'rr' => 'r' ],
137 [ 'ss' => 's' ],
138 [ 'tt' => 't' ],
139 [ 'zz' => 'z' ],
140 ],
141  
142 # ---------------------------------------------------------
143 # Optional custom sort collation overrides.
144 # Unicode::Collate handles standard UCA collation.
145 # ---------------------------------------------------------
146 sort_map => {},
147  
148 # ---------------------------------------------------------
149 # Alphabet character class for normalize() & safe string handling.
150 # Characters considered valid letters alongside standard a-zA-Z.
151 # Encompasses Latin-1 Supplement, Latin Extended-A, and Nordic/Turkish letters.
152 # ---------------------------------------------------------
153 alphabet_chars =>
154 "\x{C0}\x{C1}\x{C2}\x{C3}\x{C4}\x{C5}\x{C6}\x{C7}\x{C8}\x{C9}\x{CA}\x{CB}" .
155 "\x{CC}\x{CD}\x{CE}\x{CF}\x{D0}\x{D1}\x{D2}\x{D3}\x{D4}\x{D5}\x{D6}\x{D8}" .
156 "\x{D9}\x{DA}\x{DB}\x{DC}\x{DD}\x{DE}\x{DF}" .
157 "\x{E0}\x{E1}\x{E2}\x{E3}\x{E4}\x{E5}\x{E6}\x{E7}\x{E8}\x{E9}\x{EA}\x{EB}" .
158 "\x{EC}\x{ED}\x{EE}\x{EF}\x{F0}\x{F1}\x{F2}\x{F3}\x{F4}\x{F5}\x{F6}\x{F8}" .
159 "\x{F9}\x{FA}\x{FB}\x{FC}\x{FD}\x{FE}\x{FF}" .
160 "\x{11E}\x{11F}\x{130}\x{131}\x{15E}\x{15F}" . # Ğ ğ İ ı Ş ş (Turkish/Azeri)
161 "\x{106}\x{107}\x{10C}\x{10D}\x{110}\x{111}" . # Ć ć Č č Đ đ (Slavic Latin)
162 "\x{141}\x{142}\x{143}\x{144}\x{15A}\x{15B}" . # Ł ł Ń ń Ś ś
163 "\x{160}\x{161}\x{179}\x{17A}\x{17B}\x{17C}\x{17D}\x{17E}" . # Š š Ź ź Ż ż Ž ž
164 "\x{152}\x{153}\x{18F}\x{259}", # Œ œ Ə ə (French / Azeri)
165  
166 # ---------------------------------------------------------
167 # Accent normalization map — used by normalize().
168 # Maps accented/regional characters to their clean base Latin forms.
169 # ---------------------------------------------------------
170 accent_map => {
171 # A / a
172 "\x{E0}" => 'a', "\x{E1}" => 'a', "\x{E2}" => 'a', "\x{E3}" => 'a', "\x{E4}" => 'a', "\x{E5}" => 'a', "\x{E6}" => 'ae',
173 "\x{C0}" => 'A', "\x{C1}" => 'A', "\x{C2}" => 'A', "\x{C3}" => 'A', "\x{C4}" => 'A', "\x{C5}" => 'A', "\x{C6}" => 'AE',
174  
175 # C / c
176 "\x{E7}" => 'c', "\x{C7}" => 'C', # ç, Ç
177 "\x{107}" => 'c', "\x{106}" => 'C', # ć, Ć
178 "\x{10D}" => 'c', "\x{10C}" => 'C', # č, Č
179  
180 # D / d
181 "\x{F0}" => 'd', "\x{D0}" => 'D', # ð, Ð
182 "\x{111}" => 'd', "\x{110}" => 'D', # đ, Đ
183  
184 # E / e
185 "\x{E8}" => 'e', "\x{E9}" => 'e', "\x{EA}" => 'e', "\x{EB}" => 'e',
186 "\x{C8}" => 'E', "\x{C9}" => 'E', "\x{CA}" => 'E', "\x{CB}" => 'E',
187 "\x{259}" => 'e', "\x{18F}" => 'E', # ə, Ə
188  
189 # G / g
190 "\x{11F}" => 'g', "\x{11E}" => 'G', # ğ, Ğ
191  
192 # I / i
193 "\x{EC}" => 'i', "\x{ED}" => 'i', "\x{EE}" => 'i', "\x{EF}" => 'i',
194 "\x{CC}" => 'I', "\x{CD}" => 'I', "\x{CE}" => 'I', "\x{CF}" => 'I',
195 "\x{131}" => 'i', "\x{130}" => 'I', # ı, İ
196  
197 # L / l
198 "\x{142}" => 'l', "\x{141}" => 'L', # ł, Ł
199  
200 # N / n
201 "\x{F1}" => 'n', "\x{D1}" => 'N', # ñ, Ñ
202 "\x{144}" => 'n', "\x{143}" => 'N', # ń, Ń
203  
204 # O / o
205 "\x{F2}" => 'o', "\x{F3}" => 'o', "\x{F4}" => 'o', "\x{F5}" => 'o', "\x{F6}" => 'o', "\x{F8}" => 'o',
206 "\x{D2}" => 'O', "\x{D3}" => 'O', "\x{D4}" => 'O', "\x{D5}" => 'O', "\x{D6}" => 'O', "\x{D8}" => 'O',
207 "\x{153}" => 'oe', "\x{152}" => 'OE', # œ, Œ
208  
209 # S / s
210 "\x{15F}" => 's', "\x{15E}" => 'S', # ş, Ş
211 "\x{15B}" => 's', "\x{15A}" => 'S', # ś, Ś
212 "\x{161}" => 's', "\x{160}" => 'S', # š, Š
213 "\x{DF}" => 'ss', # ß
214  
215 # T / t
216 "\x{FE}" => 'th', "\x{DE}" => 'TH', # þ, Þ
217  
218 # U / u
219 "\x{F9}" => 'u', "\x{FA}" => 'u', "\x{FB}" => 'u', "\x{FC}" => 'u',
220 "\x{D9}" => 'U', "\x{DA}" => 'U', "\x{DB}" => 'U', "\x{DC}" => 'U',
221  
222 # Y / y
223 "\x{FD}" => 'y', "\x{DD}" => 'Y', "\x{FF}" => 'y',
224  
225 # Z / z
226 "\x{17A}" => 'z', "\x{179}" => 'Z', # ź, Ź
227 "\x{17C}" => 'z', "\x{17B}" => 'Z', # ż, Ż
228 "\x{17E}" => 'z', "\x{17D}" => 'Z', # ž, Ž
229 },
230  
231 # ---------------------------------------------------------
232 # ASCII transliteration pre-map — used BEFORE NFD in to_ascii().
233 # Converts non-decomposable ligatures and special glyphs.
234 # ---------------------------------------------------------
235 ascii_map => {
236 "\x{DF}" => 'ss', # ß → ss
237 "\x{E6}" => 'ae', "\x{C6}" => 'AE',# æ → ae, Æ → AE
238 "\x{153}" => 'oe', "\x{152}" => 'OE',# œ → oe, Œ → OE
239 "\x{131}" => 'i', # ı → i
240 "\x{F0}" => 'd', "\x{D0}" => 'D', # ð → d, Ð → D
241 "\x{FE}" => 'th', "\x{DE}" => 'TH',# þ → th, Þ → TH
242 "\x{F8}" => 'o', "\x{D8}" => 'O', # ø → o, Ø → O
243 "\x{142}" => 'l', "\x{141}" => 'L', # ł → l, Ł → L
244 "\x{111}" => 'd', "\x{110}" => 'D', # đ → d, Đ → D
245 "\x{259}" => 'e', "\x{18F}" => 'E', # ə → e, Ə → E
246 },
247  
248 # ---------------------------------------------------------
249 # num2text number words (International English standard)
250 # ---------------------------------------------------------
251 numbers => {
252 zero => 'Zero',
253 negative => 'Minus',
254 ones => [qw(One Two Three Four Five Six Seven Eight Nine)],
255 tens => [qw(Ten Twenty Thirty Forty Fifty Sixty Seventy Eighty Ninety)],
256 hundred => 'Hundred',
257 thousand => 'Thousand',
258 million => 'Million',
259 billion => 'Billion',
260 currency => { main => 'USD', sub => 'cent' },
261 decimal_sep => '.',
262 hundred_one_prefix => 1, # One Hundred
263 thousand_one_prefix => 1, # One Thousand
264 },
265  
266 # ---------------------------------------------------------
267 # HTML entity extras
268 # ---------------------------------------------------------
269 html_entities => {},
270  
271 # ---------------------------------------------------------
272 # Month and Day names (International English)
273 # ---------------------------------------------------------
274 months => [
275 "January", "February", "March", "April", "May", "June",
276 "July", "August", "September", "October", "November", "December"
277 ],
278 days => [
279 "Sunday", "Monday", "Tuesday", "Wednesday",
280 "Thursday", "Friday", "Saturday"
281 ],
282  
283 # ---------------------------------------------------------
284 # Formatting metadata (number, currency, date)
285 # ---------------------------------------------------------
286 number_format => {
287 decimal_sep => '.',
288 group_sep => ',',
289 group_size => 3,
290 },
291 };
292 }
293  
294 1;
295  
296 __END__