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