File Coverage

blib/lib/Locale/CLDR/NumberingSystems.pm
Criterion Covered Total %
statement 41 41 100.0
branch 7 8 87.5
condition n/a
subroutine 13 13 100.0
pod 0 1 0.0
total 61 63 96.8


line stmt bran cond sub pod time code
1             package Locale::CLDR::NumberingSystems;
2             # This file auto generated from Data\common\supplemental\numberingSystems.xml
3             # on Fri 17 Jan 12:03:31 pm GMT
4              
5 23     23   19279 use strict;
  23         59  
  23         1009  
6 23     23   124 use warnings;
  23         48  
  23         1532  
7 23     23   215 use version;
  23         45  
  23         213  
8              
9             our $VERSION = version->declare('v0.46.0');
10              
11 23     23   3103 use v5.12.0;
  23         95  
12 23     23   169 use mro 'c3';
  23         53  
  23         251  
13 23     23   793 use utf8;
  23         54  
  23         228  
14 23     23   3302 use feature 'unicode_strings';
  23         55  
  23         3656  
15 23     23   181 use Types::Standard qw( Str Int HashRef ArrayRef CodeRef RegexpRef );
  23         45  
  23         321  
16 23     23   80618 use Moo::Role;
  23         65  
  23         264  
17              
18             has 'numbering_system' => (
19             is => 'ro',
20             isa => HashRef,
21             init_arg => undef,
22             default => sub { return {
23             'adlm' => {
24             type => 'numeric',
25             data => [qw(𞥐 𞥑 𞥒 𞥓 𞥔 𞥕 𞥖 𞥗 𞥘 𞥙)],
26             },
27             'ahom' => {
28             type => 'numeric',
29             data => [qw(𑜰 𑜱 𑜲 𑜳 𑜴 𑜵 𑜶 𑜷 𑜸 𑜹)],
30             },
31             'arab' => {
32             type => 'numeric',
33             data => [qw(٠ ١ ٢ ٣ ٤ ٥ ٦ ٧ ٨ ٩)],
34             },
35             'arabext' => {
36             type => 'numeric',
37             data => [qw(۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹)],
38             },
39             'armn' => {
40             type => 'algorithmic',
41             data => 'armenian-upper',
42             },
43             'armnlow' => {
44             type => 'algorithmic',
45             data => 'armenian-lower',
46             },
47             'bali' => {
48             type => 'numeric',
49             data => [qw(᭐ ᭑ ᭒ ᭓ ᭔ ᭕ ᭖ ᭗ ᭘ ᭙)],
50             },
51             'beng' => {
52             type => 'numeric',
53             data => [qw(০ ১ ২ ৩ ৪ ৫ ৬ ৭ ৮ ৯)],
54             },
55             'bhks' => {
56             type => 'numeric',
57             data => [qw(𑱐 𑱑 𑱒 𑱓 𑱔 𑱕 𑱖 𑱗 𑱘 𑱙)],
58             },
59             'brah' => {
60             type => 'numeric',
61             data => [qw(𑁦 𑁧 𑁨 𑁩 𑁪 𑁫 𑁬 𑁭 𑁮 𑁯)],
62             },
63             'cakm' => {
64             type => 'numeric',
65             data => [qw(𑄶 𑄷 𑄸 𑄹 𑄺 𑄻 𑄼 𑄽 𑄾 𑄿)],
66             },
67             'cham' => {
68             type => 'numeric',
69             data => [qw(꩐ ꩑ ꩒ ꩓ ꩔ ꩕ ꩖ ꩗ ꩘ ꩙)],
70             },
71             'cyrl' => {
72             type => 'algorithmic',
73             data => 'cyrillic-lower',
74             },
75             'deva' => {
76             type => 'numeric',
77             data => [qw(० १ २ ३ ४ ५ ६ ७ ८ ९)],
78             },
79             'diak' => {
80             type => 'numeric',
81             data => [qw(𑥐 𑥑 𑥒 𑥓 𑥔 𑥕 𑥖 𑥗 𑥘 𑥙)],
82             },
83             'ethi' => {
84             type => 'algorithmic',
85             data => 'ethiopic',
86             },
87             'fullwide' => {
88             type => 'numeric',
89             data => [qw(0 1 2 3 4 5 6 7 8 9)],
90             },
91             'gara' => {
92             type => 'numeric',
93             data => [qw(𐵀 𐵁 𐵂 𐵃 𐵄 𐵅 𐵆 𐵇 𐵈 𐵉)],
94             },
95             'geor' => {
96             type => 'algorithmic',
97             data => 'georgian',
98             },
99             'gong' => {
100             type => 'numeric',
101             data => [qw(𑶠 𑶡 𑶢 𑶣 𑶤 𑶥 𑶦 𑶧 𑶨 𑶩)],
102             },
103             'gonm' => {
104             type => 'numeric',
105             data => [qw(𑵐 𑵑 𑵒 𑵓 𑵔 𑵕 𑵖 𑵗 𑵘 𑵙)],
106             },
107             'grek' => {
108             type => 'algorithmic',
109             data => 'greek-upper',
110             },
111             'greklow' => {
112             type => 'algorithmic',
113             data => 'greek-lower',
114             },
115             'gujr' => {
116             type => 'numeric',
117             data => [qw(૦ ૧ ૨ ૩ ૪ ૫ ૬ ૭ ૮ ૯)],
118             },
119             'gukh' => {
120             type => 'numeric',
121             data => [qw(𖄰 𖄱 𖄲 𖄳 𖄴 𖄵 𖄶 𖄷 𖄸 𖄹)],
122             },
123             'guru' => {
124             type => 'numeric',
125             data => [qw(੦ ੧ ੨ ੩ ੪ ੫ ੬ ੭ ੮ ੯)],
126             },
127             'hanidays' => {
128             type => 'algorithmic',
129             data => 'zh/SpelloutRules/spellout-numbering-days',
130             },
131             'hanidec' => {
132             type => 'numeric',
133             data => [qw(〇 一 二 三 四 五 六 七 八 九)],
134             },
135             'hans' => {
136             type => 'algorithmic',
137             data => 'zh/SpelloutRules/spellout-cardinal',
138             },
139             'hansfin' => {
140             type => 'algorithmic',
141             data => 'zh/SpelloutRules/spellout-cardinal-financial',
142             },
143             'hant' => {
144             type => 'algorithmic',
145             data => 'zh_Hant/SpelloutRules/spellout-cardinal',
146             },
147             'hantfin' => {
148             type => 'algorithmic',
149             data => 'zh_Hant/SpelloutRules/spellout-cardinal-financial',
150             },
151             'hebr' => {
152             type => 'algorithmic',
153             data => 'hebrew',
154             },
155             'hmng' => {
156             type => 'numeric',
157             data => [qw(𖭐 𖭑 𖭒 𖭓 𖭔 𖭕 𖭖 𖭗 𖭘 𖭙)],
158             },
159             'hmnp' => {
160             type => 'numeric',
161             data => [qw(𞅀 𞅁 𞅂 𞅃 𞅄 𞅅 𞅆 𞅇 𞅈 𞅉)],
162             },
163             'java' => {
164             type => 'numeric',
165             data => [qw(꧐ ꧑ ꧒ ꧓ ꧔ ꧕ ꧖ ꧗ ꧘ ꧙)],
166             },
167             'jpan' => {
168             type => 'algorithmic',
169             data => 'ja/SpelloutRules/spellout-cardinal',
170             },
171             'jpanfin' => {
172             type => 'algorithmic',
173             data => 'ja/SpelloutRules/spellout-cardinal-financial',
174             },
175             'jpanyear' => {
176             type => 'algorithmic',
177             data => 'ja/SpelloutRules/spellout-numbering-year-latn',
178             },
179             'kali' => {
180             type => 'numeric',
181             data => [qw(꤀ ꤁ ꤂ ꤃ ꤄ ꤅ ꤆ ꤇ ꤈ ꤉)],
182             },
183             'kawi' => {
184             type => 'numeric',
185             data => [qw(𑽐 𑽑 𑽒 𑽓 𑽔 𑽕 𑽖 𑽗 𑽘 𑽙)],
186             },
187             'khmr' => {
188             type => 'numeric',
189             data => [qw(០ ១ ២ ៣ ៤ ៥ ៦ ៧ ៨ ៩)],
190             },
191             'knda' => {
192             type => 'numeric',
193             data => [qw(೦ ೧ ೨ ೩ ೪ ೫ ೬ ೭ ೮ ೯)],
194             },
195             'krai' => {
196             type => 'numeric',
197             data => [qw(𖵰 𖵱 𖵲 𖵳 𖵴 𖵵 𖵶 𖵷 𖵸 𖵹)],
198             },
199             'lana' => {
200             type => 'numeric',
201             data => [qw(᪀ ᪁ ᪂ ᪃ ᪄ ᪅ ᪆ ᪇ ᪈ ᪉)],
202             },
203             'lanatham' => {
204             type => 'numeric',
205             data => [qw(᪐ ᪑ ᪒ ᪓ ᪔ ᪕ ᪖ ᪗ ᪘ ᪙)],
206             },
207             'laoo' => {
208             type => 'numeric',
209             data => [qw(໐ ໑ ໒ ໓ ໔ ໕ ໖ ໗ ໘ ໙)],
210             },
211             'latn' => {
212             type => 'numeric',
213             data => [qw(0 1 2 3 4 5 6 7 8 9)],
214             },
215             'lepc' => {
216             type => 'numeric',
217             data => [qw(᱀ ᱁ ᱂ ᱃ ᱄ ᱅ ᱆ ᱇ ᱈ ᱉)],
218             },
219             'limb' => {
220             type => 'numeric',
221             data => [qw(᥆ ᥇ ᥈ ᥉ ᥊ ᥋ ᥌ ᥍ ᥎ ᥏)],
222             },
223             'mathbold' => {
224             type => 'numeric',
225             data => [qw(𝟎 𝟏 𝟐 𝟑 𝟒 𝟓 𝟔 𝟕 𝟖 𝟗)],
226             },
227             'mathdbl' => {
228             type => 'numeric',
229             data => [qw(𝟘 𝟙 𝟚 𝟛 𝟜 𝟝 𝟞 𝟟 𝟠 𝟡)],
230             },
231             'mathmono' => {
232             type => 'numeric',
233             data => [qw(𝟶 𝟷 𝟸 𝟹 𝟺 𝟻 𝟼 𝟽 𝟾 𝟿)],
234             },
235             'mathsanb' => {
236             type => 'numeric',
237             data => [qw(𝟬 𝟭 𝟮 𝟯 𝟰 𝟱 𝟲 𝟳 𝟴 𝟵)],
238             },
239             'mathsans' => {
240             type => 'numeric',
241             data => [qw(𝟢 𝟣 𝟤 𝟥 𝟦 𝟧 𝟨 𝟩 𝟪 𝟫)],
242             },
243             'mlym' => {
244             type => 'numeric',
245             data => [qw(൦ ൧ ൨ ൩ ൪ ൫ ൬ ൭ ൮ ൯)],
246             },
247             'modi' => {
248             type => 'numeric',
249             data => [qw(𑙐 𑙑 𑙒 𑙓 𑙔 𑙕 𑙖 𑙗 𑙘 𑙙)],
250             },
251             'mong' => {
252             type => 'numeric',
253             data => [qw(᠐ ᠑ ᠒ ᠓ ᠔ ᠕ ᠖ ᠗ ᠘ ᠙)],
254             },
255             'mroo' => {
256             type => 'numeric',
257             data => [qw(𖩠 𖩡 𖩢 𖩣 𖩤 𖩥 𖩦 𖩧 𖩨 𖩩)],
258             },
259             'mtei' => {
260             type => 'numeric',
261             data => [qw(꯰ ꯱ ꯲ ꯳ ꯴ ꯵ ꯶ ꯷ ꯸ ꯹)],
262             },
263             'mymr' => {
264             type => 'numeric',
265             data => [qw(၀ ၁ ၂ ၃ ၄ ၅ ၆ ၇ ၈ ၉)],
266             },
267             'mymrepka' => {
268             type => 'numeric',
269             data => [qw(𑛚 𑛛 𑛜 𑛝 𑛞 𑛟 𑛠 𑛡 𑛢 𑛣)],
270             },
271             'mymrpao' => {
272             type => 'numeric',
273             data => [qw(𑛐 𑛑 𑛒 𑛓 𑛔 𑛕 𑛖 𑛗 𑛘 𑛙)],
274             },
275             'mymrshan' => {
276             type => 'numeric',
277             data => [qw(႐ ႑ ႒ ႓ ႔ ႕ ႖ ႗ ႘ ႙)],
278             },
279             'mymrtlng' => {
280             type => 'numeric',
281             data => [qw(꧰ ꧱ ꧲ ꧳ ꧴ ꧵ ꧶ ꧷ ꧸ ꧹)],
282             },
283             'nagm' => {
284             type => 'numeric',
285             data => [qw(𞓰 𞓱 𞓲 𞓳 𞓴 𞓵 𞓶 𞓷 𞓸 𞓹)],
286             },
287             'newa' => {
288             type => 'numeric',
289             data => [qw(𑑐 𑑑 𑑒 𑑓 𑑔 𑑕 𑑖 𑑗 𑑘 𑑙)],
290             },
291             'nkoo' => {
292             type => 'numeric',
293             data => [qw(߀ ߁ ߂ ߃ ߄ ߅ ߆ ߇ ߈ ߉)],
294             },
295             'olck' => {
296             type => 'numeric',
297             data => [qw(᱐ ᱑ ᱒ ᱓ ᱔ ᱕ ᱖ ᱗ ᱘ ᱙)],
298             },
299             'onao' => {
300             type => 'numeric',
301             data => [qw(𞗱 𞗲 𞗳 𞗴 𞗵 𞗶 𞗷 𞗸 𞗹 𞗺)],
302             },
303             'orya' => {
304             type => 'numeric',
305             data => [qw(୦ ୧ ୨ ୩ ୪ ୫ ୬ ୭ ୮ ୯)],
306             },
307             'osma' => {
308             type => 'numeric',
309             data => [qw(𐒠 𐒡 𐒢 𐒣 𐒤 𐒥 𐒦 𐒧 𐒨 𐒩)],
310             },
311             'outlined' => {
312             type => 'numeric',
313             data => [qw(𜳰 𜳱 𜳲 𜳳 𜳴 𜳵 𜳶 𜳷 𜳸 𜳹)],
314             },
315             'rohg' => {
316             type => 'numeric',
317             data => [qw(𐴰 𐴱 𐴲 𐴳 𐴴 𐴵 𐴶 𐴷 𐴸 𐴹)],
318             },
319             'roman' => {
320             type => 'algorithmic',
321             data => 'roman-upper',
322             },
323             'romanlow' => {
324             type => 'algorithmic',
325             data => 'roman-lower',
326             },
327             'saur' => {
328             type => 'numeric',
329             data => [qw(꣐ ꣑ ꣒ ꣓ ꣔ ꣕ ꣖ ꣗ ꣘ ꣙)],
330             },
331             'segment' => {
332             type => 'numeric',
333             data => [qw(🯰 🯱 🯲 🯳 🯴 🯵 🯶 🯷 🯸 🯹)],
334             },
335             'shrd' => {
336             type => 'numeric',
337             data => [qw(𑇐 𑇑 𑇒 𑇓 𑇔 𑇕 𑇖 𑇗 𑇘 𑇙)],
338             },
339             'sind' => {
340             type => 'numeric',
341             data => [qw(𑋰 𑋱 𑋲 𑋳 𑋴 𑋵 𑋶 𑋷 𑋸 𑋹)],
342             },
343             'sinh' => {
344             type => 'numeric',
345             data => [qw(෦ ෧ ෨ ෩ ෪ ෫ ෬ ෭ ෮ ෯)],
346             },
347             'sora' => {
348             type => 'numeric',
349             data => [qw(𑃰 𑃱 𑃲 𑃳 𑃴 𑃵 𑃶 𑃷 𑃸 𑃹)],
350             },
351             'sund' => {
352             type => 'numeric',
353             data => [qw(᮰ ᮱ ᮲ ᮳ ᮴ ᮵ ᮶ ᮷ ᮸ ᮹)],
354             },
355             'sunu' => {
356             type => 'numeric',
357             data => [qw(𑯰 𑯱 𑯲 𑯳 𑯴 𑯵 𑯶 𑯷 𑯸 𑯹)],
358             },
359             'takr' => {
360             type => 'numeric',
361             data => [qw(𑛀 𑛁 𑛂 𑛃 𑛄 𑛅 𑛆 𑛇 𑛈 𑛉)],
362             },
363             'talu' => {
364             type => 'numeric',
365             data => [qw(᧐ ᧑ ᧒ ᧓ ᧔ ᧕ ᧖ ᧗ ᧘ ᧙)],
366             },
367             'taml' => {
368             type => 'algorithmic',
369             data => 'tamil',
370             },
371             'tamldec' => {
372             type => 'numeric',
373             data => [qw(௦ ௧ ௨ ௩ ௪ ௫ ௬ ௭ ௮ ௯)],
374             },
375             'tnsa' => {
376             type => 'numeric',
377             data => [qw(𖫀 𖫁 𖫂 𖫃 𖫄 𖫅 𖫆 𖫇 𖫈 𖫉)],
378             },
379             'telu' => {
380             type => 'numeric',
381             data => [qw(౦ ౧ ౨ ౩ ౪ ౫ ౬ ౭ ౮ ౯)],
382             },
383             'thai' => {
384             type => 'numeric',
385             data => [qw(๐ ๑ ๒ ๓ ๔ ๕ ๖ ๗ ๘ ๙)],
386             },
387             'tibt' => {
388             type => 'numeric',
389             data => [qw(༠ ༡ ༢ ༣ ༤ ༥ ༦ ༧ ༨ ༩)],
390             },
391             'tirh' => {
392             type => 'numeric',
393             data => [qw(𑓐 𑓑 𑓒 𑓓 𑓔 𑓕 𑓖 𑓗 𑓘 𑓙)],
394             },
395             'vaii' => {
396             type => 'numeric',
397             data => [qw(꘠ ꘡ ꘢ ꘣ ꘤ ꘥ ꘦ ꘧ ꘨ ꘩)],
398             },
399             'wara' => {
400             type => 'numeric',
401             data => [qw(𑣠 𑣡 𑣢 𑣣 𑣤 𑣥 𑣦 𑣧 𑣨 𑣩)],
402             },
403             'wcho' => {
404             type => 'numeric',
405             data => [qw(𞋰 𞋱 𞋲 𞋳 𞋴 𞋵 𞋶 𞋷 𞋸 𞋹)],
406             },
407             }},
408             );
409              
410             has '_default_numbering_system' => (
411             is => 'ro',
412             isa => ArrayRef,
413             init_arg => undef,
414             default => sub {[]},
415             clearer => '_clear_default_nu',
416             writer => '_set_default_numbering_system',
417             );
418              
419             sub _set_default_nu {
420 11     11   44 my ($self, $system) = @_;
421 11 100       80 $system = [ $system ] unless ref $system;
422             die "Unknown numbering system $system\n"
423 11 50       113 unless exists $self->numbering_system->{$system->[0]};
424 11         359 $self->_set_default_numbering_system($system);
425             }
426              
427             around _default_numbering_system => sub {
428             my ($orij, $self) = @_;
429              
430             if (wantarray) {
431             return @{$self->$orij};
432             }
433             else {
434             return $self->$orij->[0] // '';
435             }
436             };
437              
438             around _set_default_numbering_system => sub {
439             my ($orij, $self, $value) = @_;
440             $value = [ $value ] unless ref $value;
441             return $self->$orij($value);
442             };
443              
444             sub _test_default_nu {
445 2388     2388   3894 my $self = shift;
446 2388 100       77901 return length $self->_default_numbering_system ? 1 : 0;
447             }
448              
449             sub default_numbering_system {
450 2388     2388 0 4623 my $self = shift;
451              
452 2388 100       7058 if($self->_test_default_nu) {
453 2378         54413 return $self->_default_numbering_system;
454             }
455             else {
456 10         56 my $numbering_system = $self->_find_bundle('default_numbering_system')->default_numbering_system;
457 10         189 $self->_set_default_nu($numbering_system);
458 10         454 return $numbering_system
459             }
460             }
461              
462 23     23   76429 no Moo::Role;
  23         65  
  23         186  
463              
464             1;
465              
466             # vim: tabstop=4