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
|
|
1192
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
219
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
27
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
46
|
|
23
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
52
|
|
24
|
2
|
|
|
2
|
|
17
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174403; |
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{hu} = {"3688", "Veszprém", |
100
|
|
|
|
|
|
|
"3649", "Mezőkövesd", |
101
|
|
|
|
|
|
|
"3625", "Dunaújváros", |
102
|
|
|
|
|
|
|
"3672", "Pécs", |
103
|
|
|
|
|
|
|
"3645", "Kisvárda", |
104
|
|
|
|
|
|
|
"3682", "Kaposvár", |
105
|
|
|
|
|
|
|
"3678", "Kiskőrös", |
106
|
|
|
|
|
|
|
"3632", "Salgótarján", |
107
|
|
|
|
|
|
|
"3627", "Vác", |
108
|
|
|
|
|
|
|
"3668", "Orosháza", |
109
|
|
|
|
|
|
|
"3628", "Gödöllő", |
110
|
|
|
|
|
|
|
"3669", "Mohács", |
111
|
|
|
|
|
|
|
"3657", "Jászberény", |
112
|
|
|
|
|
|
|
"3642", "Nyíregyháza", |
113
|
|
|
|
|
|
|
"3695", "Sárvár", |
114
|
|
|
|
|
|
|
"3689", "Pápa", |
115
|
|
|
|
|
|
|
"3637", "Gyöngyös", |
116
|
|
|
|
|
|
|
"3648", "Ózd", |
117
|
|
|
|
|
|
|
"3674", "Szekszárd", |
118
|
|
|
|
|
|
|
"3696", "Győr", |
119
|
|
|
|
|
|
|
"3654", "Berettyóújfalu", |
120
|
|
|
|
|
|
|
"3676", "Kecskemét", |
121
|
|
|
|
|
|
|
"3634", "Tatabánya", |
122
|
|
|
|
|
|
|
"3653", "Cegléd", |
123
|
|
|
|
|
|
|
"3666", "Békéscsaba", |
124
|
|
|
|
|
|
|
"3673", "Szigetvár", |
125
|
|
|
|
|
|
|
"3684", "Siófok",}; |
126
|
|
|
|
|
|
|
$areanames{en} = {"3622", "Székesfehérvár", |
127
|
|
|
|
|
|
|
"3689", "Papa", |
128
|
|
|
|
|
|
|
"3637", "Gyongyos", |
129
|
|
|
|
|
|
|
"3675", "Paks", |
130
|
|
|
|
|
|
|
"3699", "Sopron", |
131
|
|
|
|
|
|
|
"3687", "Tapolca", |
132
|
|
|
|
|
|
|
"3648", "Ozd", |
133
|
|
|
|
|
|
|
"3628", "Godollo", |
134
|
|
|
|
|
|
|
"3677", "Kiskunhalas", |
135
|
|
|
|
|
|
|
"3635", "Balassagyarmat", |
136
|
|
|
|
|
|
|
"3659", "Karcag", |
137
|
|
|
|
|
|
|
"3685", "Marcali", |
138
|
|
|
|
|
|
|
"3657", "Jaszbereny", |
139
|
|
|
|
|
|
|
"3642", "Nyiregyhaza", |
140
|
|
|
|
|
|
|
"3695", "Sarvar", |
141
|
|
|
|
|
|
|
"3679", "Baja", |
142
|
|
|
|
|
|
|
"3669", "Mohacs", |
143
|
|
|
|
|
|
|
"3653", "Cegled", |
144
|
|
|
|
|
|
|
"361", "Budapest", |
145
|
|
|
|
|
|
|
"3666", "Bekescsaba", |
146
|
|
|
|
|
|
|
"3676", "Kecskemet", |
147
|
|
|
|
|
|
|
"3634", "Tatabanya", |
148
|
|
|
|
|
|
|
"3694", "Szombathely", |
149
|
|
|
|
|
|
|
"3656", "Szolnok", |
150
|
|
|
|
|
|
|
"3663", "Szentes", |
151
|
|
|
|
|
|
|
"3684", "Siofok", |
152
|
|
|
|
|
|
|
"3673", "Szigetvar", |
153
|
|
|
|
|
|
|
"3693", "Nagykanizsa", |
154
|
|
|
|
|
|
|
"3683", "Keszthely", |
155
|
|
|
|
|
|
|
"3674", "Szekszard", |
156
|
|
|
|
|
|
|
"3636", "Eger", |
157
|
|
|
|
|
|
|
"3696", "Gyor", |
158
|
|
|
|
|
|
|
"3654", "Berettyoujfalu", |
159
|
|
|
|
|
|
|
"3633", "Esztergom", |
160
|
|
|
|
|
|
|
"3646", "Miskolc", |
161
|
|
|
|
|
|
|
"3624", "Szigetszentmiklós", |
162
|
|
|
|
|
|
|
"3623", "Biatorbágy", |
163
|
|
|
|
|
|
|
"3644", "Mátészalka", |
164
|
|
|
|
|
|
|
"3626", "Szentendre", |
165
|
|
|
|
|
|
|
"3629", "Monor", |
166
|
|
|
|
|
|
|
"3645", "Kisvarda", |
167
|
|
|
|
|
|
|
"3682", "Kaposvar", |
168
|
|
|
|
|
|
|
"3692", "Zalaegerszeg", |
169
|
|
|
|
|
|
|
"3632", "Salgotarjan", |
170
|
|
|
|
|
|
|
"3668", "Oroshaza", |
171
|
|
|
|
|
|
|
"3627", "Vac", |
172
|
|
|
|
|
|
|
"3678", "Kiskoros", |
173
|
|
|
|
|
|
|
"3688", "Veszprem", |
174
|
|
|
|
|
|
|
"3652", "Debrecen", |
175
|
|
|
|
|
|
|
"3647", "Szerencs", |
176
|
|
|
|
|
|
|
"3649", "Mezokovesd", |
177
|
|
|
|
|
|
|
"3625", "Dunaujvaros", |
178
|
|
|
|
|
|
|
"3672", "Pecs", |
179
|
|
|
|
|
|
|
"3662", "Szeged",}; |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub new { |
182
|
19
|
|
|
19
|
1
|
40
|
my $class = shift; |
183
|
19
|
|
|
|
|
32
|
my $number = shift; |
184
|
19
|
|
|
|
|
119
|
$number =~ s/(^\+36|\D)//g; |
185
|
19
|
|
|
|
|
129
|
my $self = bless({ country_code => '36', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
186
|
19
|
100
|
|
|
|
103
|
return $self if ($self->is_valid()); |
187
|
1
|
|
|
|
|
2
|
$number =~ s/^(?:06)//; |
188
|
1
|
|
|
|
|
10
|
$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; |