line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# automatically generated file, don't edit |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Copyright 2023 David Cantrell, derived from data from libphonenumber |
6
|
|
|
|
|
|
|
# http://code.google.com/p/libphonenumber/ |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
9
|
|
|
|
|
|
|
# you may not use this file except in compliance with the License. |
10
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
15
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
16
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
18
|
|
|
|
|
|
|
# limitations under the License. |
19
|
|
|
|
|
|
|
package Number::Phone::StubCountry::SI; |
20
|
2
|
|
|
2
|
|
1186
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
212
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
17
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
66
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
55
|
|
24
|
2
|
|
|
2
|
|
12
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
13
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181422; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'leading_digits' => ' |
31
|
|
|
|
|
|
|
8[09]| |
32
|
|
|
|
|
|
|
9 |
33
|
|
|
|
|
|
|
', |
34
|
|
|
|
|
|
|
'national_rule' => '0$1', |
35
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3,6})' |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
{ |
38
|
|
|
|
|
|
|
'format' => '$1 $2', |
39
|
|
|
|
|
|
|
'leading_digits' => ' |
40
|
|
|
|
|
|
|
59| |
41
|
|
|
|
|
|
|
8 |
42
|
|
|
|
|
|
|
', |
43
|
|
|
|
|
|
|
'national_rule' => '0$1', |
44
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{5})' |
45
|
|
|
|
|
|
|
}, |
46
|
|
|
|
|
|
|
{ |
47
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
48
|
|
|
|
|
|
|
'leading_digits' => ' |
49
|
|
|
|
|
|
|
[37][01]| |
50
|
|
|
|
|
|
|
4[0139]| |
51
|
|
|
|
|
|
|
51| |
52
|
|
|
|
|
|
|
6 |
53
|
|
|
|
|
|
|
', |
54
|
|
|
|
|
|
|
'national_rule' => '0$1', |
55
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3})' |
56
|
|
|
|
|
|
|
}, |
57
|
|
|
|
|
|
|
{ |
58
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
59
|
|
|
|
|
|
|
'leading_digits' => '[1-57]', |
60
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
61
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})' |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
]; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $validators = { |
66
|
|
|
|
|
|
|
'fixed_line' => ' |
67
|
|
|
|
|
|
|
(?: |
68
|
|
|
|
|
|
|
[1-357][2-8]| |
69
|
|
|
|
|
|
|
4[24-8] |
70
|
|
|
|
|
|
|
)\\d{6} |
71
|
|
|
|
|
|
|
', |
72
|
|
|
|
|
|
|
'geographic' => ' |
73
|
|
|
|
|
|
|
(?: |
74
|
|
|
|
|
|
|
[1-357][2-8]| |
75
|
|
|
|
|
|
|
4[24-8] |
76
|
|
|
|
|
|
|
)\\d{6} |
77
|
|
|
|
|
|
|
', |
78
|
|
|
|
|
|
|
'mobile' => ' |
79
|
|
|
|
|
|
|
65(?: |
80
|
|
|
|
|
|
|
[178]\\d| |
81
|
|
|
|
|
|
|
5[56]| |
82
|
|
|
|
|
|
|
6[01] |
83
|
|
|
|
|
|
|
)\\d{4}| |
84
|
|
|
|
|
|
|
(?: |
85
|
|
|
|
|
|
|
[37][01]| |
86
|
|
|
|
|
|
|
4[0139]| |
87
|
|
|
|
|
|
|
51| |
88
|
|
|
|
|
|
|
6[489] |
89
|
|
|
|
|
|
|
)\\d{6} |
90
|
|
|
|
|
|
|
', |
91
|
|
|
|
|
|
|
'pager' => '', |
92
|
|
|
|
|
|
|
'personal_number' => '', |
93
|
|
|
|
|
|
|
'specialrate' => '( |
94
|
|
|
|
|
|
|
89[1-3]\\d{2,5}| |
95
|
|
|
|
|
|
|
90\\d{4,6} |
96
|
|
|
|
|
|
|
)', |
97
|
|
|
|
|
|
|
'toll_free' => '80\\d{4,6}', |
98
|
|
|
|
|
|
|
'voip' => ' |
99
|
|
|
|
|
|
|
(?: |
100
|
|
|
|
|
|
|
59\\d\\d| |
101
|
|
|
|
|
|
|
8(?: |
102
|
|
|
|
|
|
|
1(?: |
103
|
|
|
|
|
|
|
[67]\\d| |
104
|
|
|
|
|
|
|
8[0-589] |
105
|
|
|
|
|
|
|
)| |
106
|
|
|
|
|
|
|
2(?: |
107
|
|
|
|
|
|
|
0\\d| |
108
|
|
|
|
|
|
|
2[0-37-9]| |
109
|
|
|
|
|
|
|
8[0-2489] |
110
|
|
|
|
|
|
|
)| |
111
|
|
|
|
|
|
|
3[389]\\d |
112
|
|
|
|
|
|
|
) |
113
|
|
|
|
|
|
|
)\\d{4} |
114
|
|
|
|
|
|
|
' |
115
|
|
|
|
|
|
|
}; |
116
|
|
|
|
|
|
|
my %areanames = (); |
117
|
|
|
|
|
|
|
$areanames{en} = {"38633", "Celje\/Trbovlje", |
118
|
|
|
|
|
|
|
"38636", "Celje\/Trbovlje", |
119
|
|
|
|
|
|
|
"38647", "Kranj", |
120
|
|
|
|
|
|
|
"38673", "Novo\ Mesto\/Krško", |
121
|
|
|
|
|
|
|
"38657", "Gorica\/Koper\/Postojna", |
122
|
|
|
|
|
|
|
"38676", "Novo\ Mesto\/Krško", |
123
|
|
|
|
|
|
|
"38634", "Celje\/Trbovlje", |
124
|
|
|
|
|
|
|
"38658", "Gorica\/Koper\/Postojna", |
125
|
|
|
|
|
|
|
"3862", "Maribor\/Ravne\ na\ Koroškem\/Murska\ Sobota", |
126
|
|
|
|
|
|
|
"38642", "Kranj", |
127
|
|
|
|
|
|
|
"38645", "Kranj", |
128
|
|
|
|
|
|
|
"38652", "Gorica\/Koper\/Postojna", |
129
|
|
|
|
|
|
|
"38674", "Novo\ Mesto\/Krško", |
130
|
|
|
|
|
|
|
"38655", "Gorica\/Koper\/Postojna", |
131
|
|
|
|
|
|
|
"38648", "Kranj", |
132
|
|
|
|
|
|
|
"38637", "Celje\/Trbovlje", |
133
|
|
|
|
|
|
|
"38646", "Kranj", |
134
|
|
|
|
|
|
|
"38653", "Gorica\/Koper\/Postojna", |
135
|
|
|
|
|
|
|
"38677", "Novo\ Mesto\/Krško", |
136
|
|
|
|
|
|
|
"38656", "Gorica\/Koper\/Postojna", |
137
|
|
|
|
|
|
|
"38635", "Celje\/Trbovlje", |
138
|
|
|
|
|
|
|
"38678", "Novo\ Mesto\/Krško", |
139
|
|
|
|
|
|
|
"38632", "Celje\/Trbovlje", |
140
|
|
|
|
|
|
|
"38644", "Kranj", |
141
|
|
|
|
|
|
|
"38672", "Novo\ Mesto\/Krško", |
142
|
|
|
|
|
|
|
"38675", "Novo\ Mesto\/Krško", |
143
|
|
|
|
|
|
|
"38654", "Gorica\/Koper\/Postojna", |
144
|
|
|
|
|
|
|
"38638", "Celje\/Trbovlje", |
145
|
|
|
|
|
|
|
"3861", "Ljubljana",}; |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub new { |
148
|
16
|
|
|
16
|
1
|
38
|
my $class = shift; |
149
|
16
|
|
|
|
|
33
|
my $number = shift; |
150
|
16
|
|
|
|
|
107
|
$number =~ s/(^\+386|\D)//g; |
151
|
16
|
|
|
|
|
86
|
my $self = bless({ country_code => '386', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
152
|
16
|
100
|
|
|
|
75
|
return $self if ($self->is_valid()); |
153
|
1
|
|
|
|
|
2
|
$number =~ s/^(?:0)//; |
154
|
1
|
|
|
|
|
14
|
$self = bless({ country_code => '386', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
155
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
1; |