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::HU; |
20
|
2
|
|
|
2
|
|
1221
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
243
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
56
|
|
23
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
52
|
|
24
|
2
|
|
|
2
|
|
12
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
21
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131447; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => '1', |
31
|
|
|
|
|
|
|
'national_rule' => '(06 $1)', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{4})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
[27][2-9]| |
38
|
|
|
|
|
|
|
3[2-7]| |
39
|
|
|
|
|
|
|
4[24-9]| |
40
|
|
|
|
|
|
|
5[2-79]| |
41
|
|
|
|
|
|
|
6| |
42
|
|
|
|
|
|
|
8[2-57-9]| |
43
|
|
|
|
|
|
|
9[2-69] |
44
|
|
|
|
|
|
|
', |
45
|
|
|
|
|
|
|
'national_rule' => '(06 $1)', |
46
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3})' |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
{ |
49
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
50
|
|
|
|
|
|
|
'leading_digits' => '[2-9]', |
51
|
|
|
|
|
|
|
'national_rule' => '06 $1', |
52
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})' |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
]; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my $validators = { |
57
|
|
|
|
|
|
|
'fixed_line' => ' |
58
|
|
|
|
|
|
|
(?: |
59
|
|
|
|
|
|
|
1\\d| |
60
|
|
|
|
|
|
|
[27][2-9]| |
61
|
|
|
|
|
|
|
3[2-7]| |
62
|
|
|
|
|
|
|
4[24-9]| |
63
|
|
|
|
|
|
|
5[2-79]| |
64
|
|
|
|
|
|
|
6[23689]| |
65
|
|
|
|
|
|
|
8[2-57-9]| |
66
|
|
|
|
|
|
|
9[2-69] |
67
|
|
|
|
|
|
|
)\\d{6} |
68
|
|
|
|
|
|
|
', |
69
|
|
|
|
|
|
|
'geographic' => ' |
70
|
|
|
|
|
|
|
(?: |
71
|
|
|
|
|
|
|
1\\d| |
72
|
|
|
|
|
|
|
[27][2-9]| |
73
|
|
|
|
|
|
|
3[2-7]| |
74
|
|
|
|
|
|
|
4[24-9]| |
75
|
|
|
|
|
|
|
5[2-79]| |
76
|
|
|
|
|
|
|
6[23689]| |
77
|
|
|
|
|
|
|
8[2-57-9]| |
78
|
|
|
|
|
|
|
9[2-69] |
79
|
|
|
|
|
|
|
)\\d{6} |
80
|
|
|
|
|
|
|
', |
81
|
|
|
|
|
|
|
'mobile' => ' |
82
|
|
|
|
|
|
|
(?: |
83
|
|
|
|
|
|
|
[257]0| |
84
|
|
|
|
|
|
|
3[01] |
85
|
|
|
|
|
|
|
)\\d{7} |
86
|
|
|
|
|
|
|
', |
87
|
|
|
|
|
|
|
'pager' => '', |
88
|
|
|
|
|
|
|
'personal_number' => '', |
89
|
|
|
|
|
|
|
'specialrate' => '(9[01]\\d{6})|(38\\d{7})', |
90
|
|
|
|
|
|
|
'toll_free' => ' |
91
|
|
|
|
|
|
|
(?: |
92
|
|
|
|
|
|
|
[48]0\\d| |
93
|
|
|
|
|
|
|
680[29] |
94
|
|
|
|
|
|
|
)\\d{5} |
95
|
|
|
|
|
|
|
', |
96
|
|
|
|
|
|
|
'voip' => '21\\d{7}' |
97
|
|
|
|
|
|
|
}; |
98
|
|
|
|
|
|
|
my %areanames = (); |
99
|
|
|
|
|
|
|
$areanames{en} = {"3633", "Esztergom", |
100
|
|
|
|
|
|
|
"3678", "Kiskoros", |
101
|
|
|
|
|
|
|
"3692", "Zalaegerszeg", |
102
|
|
|
|
|
|
|
"3694", "Szombathely", |
103
|
|
|
|
|
|
|
"3636", "Eger", |
104
|
|
|
|
|
|
|
"3677", "Kiskunhalas", |
105
|
|
|
|
|
|
|
"3668", "Oroshaza", |
106
|
|
|
|
|
|
|
"3649", "Mezokovesd", |
107
|
|
|
|
|
|
|
"3675", "Paks", |
108
|
|
|
|
|
|
|
"3684", "Siofok", |
109
|
|
|
|
|
|
|
"3646", "Miskolc", |
110
|
|
|
|
|
|
|
"3682", "Kaposvar", |
111
|
|
|
|
|
|
|
"3676", "Kecskemet", |
112
|
|
|
|
|
|
|
"3637", "Gyongyos", |
113
|
|
|
|
|
|
|
"3663", "Szentes", |
114
|
|
|
|
|
|
|
"3679", "Baja", |
115
|
|
|
|
|
|
|
"3645", "Kisvarda", |
116
|
|
|
|
|
|
|
"3647", "Szerencs", |
117
|
|
|
|
|
|
|
"3635", "Balassagyarmat", |
118
|
|
|
|
|
|
|
"3652", "Debrecen", |
119
|
|
|
|
|
|
|
"3654", "Berettyoujfalu", |
120
|
|
|
|
|
|
|
"3666", "Bekescsaba", |
121
|
|
|
|
|
|
|
"3669", "Mohacs", |
122
|
|
|
|
|
|
|
"3622", "Székesfehérvár", |
123
|
|
|
|
|
|
|
"3673", "Szigetvar", |
124
|
|
|
|
|
|
|
"3624", "Szigetszentmiklós", |
125
|
|
|
|
|
|
|
"3648", "Ozd", |
126
|
|
|
|
|
|
|
"3659", "Karcag", |
127
|
|
|
|
|
|
|
"3626", "Szentendre", |
128
|
|
|
|
|
|
|
"3662", "Szeged", |
129
|
|
|
|
|
|
|
"3629", "Monor", |
130
|
|
|
|
|
|
|
"3656", "Szolnok", |
131
|
|
|
|
|
|
|
"3695", "Sarvar", |
132
|
|
|
|
|
|
|
"3688", "Veszprem", |
133
|
|
|
|
|
|
|
"3685", "Marcali", |
134
|
|
|
|
|
|
|
"3653", "Cegled", |
135
|
|
|
|
|
|
|
"3674", "Szekszard", |
136
|
|
|
|
|
|
|
"3623", "Biatorbágy", |
137
|
|
|
|
|
|
|
"3672", "Pecs", |
138
|
|
|
|
|
|
|
"3687", "Tapolca", |
139
|
|
|
|
|
|
|
"3634", "Tatabanya", |
140
|
|
|
|
|
|
|
"3632", "Salgotarjan", |
141
|
|
|
|
|
|
|
"3693", "Nagykanizsa", |
142
|
|
|
|
|
|
|
"3628", "Godollo", |
143
|
|
|
|
|
|
|
"3642", "Nyiregyhaza", |
144
|
|
|
|
|
|
|
"3644", "Mátészalka", |
145
|
|
|
|
|
|
|
"3689", "Papa", |
146
|
|
|
|
|
|
|
"3657", "Jaszbereny", |
147
|
|
|
|
|
|
|
"3696", "Gyor", |
148
|
|
|
|
|
|
|
"3699", "Sopron", |
149
|
|
|
|
|
|
|
"3627", "Vac", |
150
|
|
|
|
|
|
|
"3625", "Dunaujvaros", |
151
|
|
|
|
|
|
|
"361", "Budapest", |
152
|
|
|
|
|
|
|
"3683", "Keszthely",}; |
153
|
|
|
|
|
|
|
$areanames{hu} = {"3649", "Mezőkövesd", |
154
|
|
|
|
|
|
|
"3684", "Siófok", |
155
|
|
|
|
|
|
|
"3682", "Kaposvár", |
156
|
|
|
|
|
|
|
"3668", "Orosháza", |
157
|
|
|
|
|
|
|
"3678", "Kiskőrös", |
158
|
|
|
|
|
|
|
"3648", "Ózd", |
159
|
|
|
|
|
|
|
"3654", "Berettyóújfalu", |
160
|
|
|
|
|
|
|
"3666", "Békéscsaba", |
161
|
|
|
|
|
|
|
"3669", "Mohács", |
162
|
|
|
|
|
|
|
"3673", "Szigetvár", |
163
|
|
|
|
|
|
|
"3637", "Gyöngyös", |
164
|
|
|
|
|
|
|
"3676", "Kecskemét", |
165
|
|
|
|
|
|
|
"3645", "Kisvárda", |
166
|
|
|
|
|
|
|
"3653", "Cegléd", |
167
|
|
|
|
|
|
|
"3674", "Szekszárd", |
168
|
|
|
|
|
|
|
"3672", "Pécs", |
169
|
|
|
|
|
|
|
"3695", "Sárvár", |
170
|
|
|
|
|
|
|
"3688", "Veszprém", |
171
|
|
|
|
|
|
|
"3625", "Dunaújváros", |
172
|
|
|
|
|
|
|
"3696", "Győr", |
173
|
|
|
|
|
|
|
"3657", "Jászberény", |
174
|
|
|
|
|
|
|
"3627", "Vác", |
175
|
|
|
|
|
|
|
"3642", "Nyíregyháza", |
176
|
|
|
|
|
|
|
"3689", "Pápa", |
177
|
|
|
|
|
|
|
"3634", "Tatabánya", |
178
|
|
|
|
|
|
|
"3632", "Salgótarján", |
179
|
|
|
|
|
|
|
"3628", "Gödöllő",}; |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub new { |
182
|
19
|
|
|
19
|
1
|
42
|
my $class = shift; |
183
|
19
|
|
|
|
|
37
|
my $number = shift; |
184
|
19
|
|
|
|
|
126
|
$number =~ s/(^\+36|\D)//g; |
185
|
19
|
|
|
|
|
178
|
my $self = bless({ country_code => '36', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
186
|
19
|
100
|
|
|
|
126
|
return $self if ($self->is_valid()); |
187
|
1
|
|
|
|
|
8
|
$number =~ s/^(?:06)//; |
188
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '36', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
189
|
1
|
50
|
|
|
|
4
|
return $self->is_valid() ? $self : undef; |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
1; |