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::SK; |
20
|
2
|
|
|
2
|
|
1330
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
355
|
|
|
2
|
|
|
|
|
236
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
46
|
|
23
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
59
|
|
|
2
|
|
|
|
|
63
|
|
24
|
2
|
|
|
2
|
|
15
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
14
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181422; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => '21', |
31
|
|
|
|
|
|
|
'national_rule' => '0$1', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{2})(\\d{3,4})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
36
|
|
|
|
|
|
|
'leading_digits' => '[3-5][1-8]1[67]', |
37
|
|
|
|
|
|
|
'national_rule' => '0$1', |
38
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{2})(\\d{2,3})' |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
'format' => '$1 $2', |
42
|
|
|
|
|
|
|
'intl_format' => 'NA', |
43
|
|
|
|
|
|
|
'leading_digits' => '9090', |
44
|
|
|
|
|
|
|
'national_rule' => '0$1', |
45
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})' |
46
|
|
|
|
|
|
|
}, |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
'format' => '$1/$2 $3 $4', |
49
|
|
|
|
|
|
|
'leading_digits' => '2', |
50
|
|
|
|
|
|
|
'national_rule' => '0$1', |
51
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})' |
52
|
|
|
|
|
|
|
}, |
53
|
|
|
|
|
|
|
{ |
54
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
55
|
|
|
|
|
|
|
'leading_digits' => '[689]', |
56
|
|
|
|
|
|
|
'national_rule' => '0$1', |
57
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3})' |
58
|
|
|
|
|
|
|
}, |
59
|
|
|
|
|
|
|
{ |
60
|
|
|
|
|
|
|
'format' => '$1/$2 $3 $4', |
61
|
|
|
|
|
|
|
'leading_digits' => '[3-5]', |
62
|
|
|
|
|
|
|
'national_rule' => '0$1', |
63
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})' |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
]; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
my $validators = { |
68
|
|
|
|
|
|
|
'fixed_line' => ' |
69
|
|
|
|
|
|
|
(?: |
70
|
|
|
|
|
|
|
2(?: |
71
|
|
|
|
|
|
|
16| |
72
|
|
|
|
|
|
|
[2-9]\\d{3} |
73
|
|
|
|
|
|
|
)| |
74
|
|
|
|
|
|
|
(?: |
75
|
|
|
|
|
|
|
(?: |
76
|
|
|
|
|
|
|
[3-5][1-8]\\d| |
77
|
|
|
|
|
|
|
819 |
78
|
|
|
|
|
|
|
)\\d| |
79
|
|
|
|
|
|
|
601[1-5] |
80
|
|
|
|
|
|
|
)\\d |
81
|
|
|
|
|
|
|
)\\d{4}| |
82
|
|
|
|
|
|
|
(?: |
83
|
|
|
|
|
|
|
2| |
84
|
|
|
|
|
|
|
[3-5][1-8] |
85
|
|
|
|
|
|
|
)1[67]\\d{3}| |
86
|
|
|
|
|
|
|
[3-5][1-8]16\\d\\d |
87
|
|
|
|
|
|
|
', |
88
|
|
|
|
|
|
|
'geographic' => ' |
89
|
|
|
|
|
|
|
(?: |
90
|
|
|
|
|
|
|
2(?: |
91
|
|
|
|
|
|
|
16| |
92
|
|
|
|
|
|
|
[2-9]\\d{3} |
93
|
|
|
|
|
|
|
)| |
94
|
|
|
|
|
|
|
(?: |
95
|
|
|
|
|
|
|
(?: |
96
|
|
|
|
|
|
|
[3-5][1-8]\\d| |
97
|
|
|
|
|
|
|
819 |
98
|
|
|
|
|
|
|
)\\d| |
99
|
|
|
|
|
|
|
601[1-5] |
100
|
|
|
|
|
|
|
)\\d |
101
|
|
|
|
|
|
|
)\\d{4}| |
102
|
|
|
|
|
|
|
(?: |
103
|
|
|
|
|
|
|
2| |
104
|
|
|
|
|
|
|
[3-5][1-8] |
105
|
|
|
|
|
|
|
)1[67]\\d{3}| |
106
|
|
|
|
|
|
|
[3-5][1-8]16\\d\\d |
107
|
|
|
|
|
|
|
', |
108
|
|
|
|
|
|
|
'mobile' => ' |
109
|
|
|
|
|
|
|
909[1-9]\\d{5}| |
110
|
|
|
|
|
|
|
9(?: |
111
|
|
|
|
|
|
|
0[1-8]| |
112
|
|
|
|
|
|
|
1[0-24-9]| |
113
|
|
|
|
|
|
|
4[03-57-9]| |
114
|
|
|
|
|
|
|
5\\d |
115
|
|
|
|
|
|
|
)\\d{6} |
116
|
|
|
|
|
|
|
', |
117
|
|
|
|
|
|
|
'pager' => '9090\\d{3}', |
118
|
|
|
|
|
|
|
'personal_number' => '', |
119
|
|
|
|
|
|
|
'specialrate' => '(8[5-9]\\d{7})|( |
120
|
|
|
|
|
|
|
9(?: |
121
|
|
|
|
|
|
|
00| |
122
|
|
|
|
|
|
|
[78]\\d |
123
|
|
|
|
|
|
|
)\\d{6} |
124
|
|
|
|
|
|
|
)|(96\\d{7})', |
125
|
|
|
|
|
|
|
'toll_free' => '800\\d{6}', |
126
|
|
|
|
|
|
|
'voip' => ' |
127
|
|
|
|
|
|
|
6(?: |
128
|
|
|
|
|
|
|
02| |
129
|
|
|
|
|
|
|
5[0-4]| |
130
|
|
|
|
|
|
|
9[0-6] |
131
|
|
|
|
|
|
|
)\\d{6} |
132
|
|
|
|
|
|
|
' |
133
|
|
|
|
|
|
|
}; |
134
|
|
|
|
|
|
|
my %areanames = (); |
135
|
|
|
|
|
|
|
$areanames{en} = {"42158", "Roznava", |
136
|
|
|
|
|
|
|
"42134", "Senica", |
137
|
|
|
|
|
|
|
"4212", "Bratislava", |
138
|
|
|
|
|
|
|
"42142", "Povazska\ Bystrica", |
139
|
|
|
|
|
|
|
"42141", "Zilina", |
140
|
|
|
|
|
|
|
"42145", "Zvolen", |
141
|
|
|
|
|
|
|
"42151", "Presov", |
142
|
|
|
|
|
|
|
"42152", "Poprad", |
143
|
|
|
|
|
|
|
"42155", "Kosice", |
144
|
|
|
|
|
|
|
"42148", "Banska\ Bystrica", |
145
|
|
|
|
|
|
|
"42133", "Trnava", |
146
|
|
|
|
|
|
|
"42136", "Levice", |
147
|
|
|
|
|
|
|
"42147", "Lucenec", |
148
|
|
|
|
|
|
|
"42157", "Humenne", |
149
|
|
|
|
|
|
|
"42135", "Nove\ Zamky", |
150
|
|
|
|
|
|
|
"42131", "Dunajska\ Streda", |
151
|
|
|
|
|
|
|
"42132", "Trencin", |
152
|
|
|
|
|
|
|
"42144", "Liptovsky\ Mikulas", |
153
|
|
|
|
|
|
|
"42138", "Topolcany", |
154
|
|
|
|
|
|
|
"42154", "Bardejov", |
155
|
|
|
|
|
|
|
"42137", "Nitra", |
156
|
|
|
|
|
|
|
"42146", "Prievidza", |
157
|
|
|
|
|
|
|
"42143", "Martin", |
158
|
|
|
|
|
|
|
"42153", "Spisska\ Nova\ Ves", |
159
|
|
|
|
|
|
|
"421601", "Roznava", |
160
|
|
|
|
|
|
|
"42156", "Michalovce",}; |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
sub new { |
163
|
25
|
|
|
25
|
1
|
54
|
my $class = shift; |
164
|
25
|
|
|
|
|
50
|
my $number = shift; |
165
|
25
|
|
|
|
|
165
|
$number =~ s/(^\+421|\D)//g; |
166
|
25
|
|
|
|
|
132
|
my $self = bless({ country_code => '421', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
167
|
25
|
100
|
|
|
|
116
|
return $self if ($self->is_valid()); |
168
|
1
|
|
|
|
|
6
|
$number =~ s/^(?:0)//; |
169
|
1
|
|
|
|
|
14
|
$self = bless({ country_code => '421', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
170
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
1; |