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::VI; |
20
|
2
|
|
|
2
|
|
1188
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
229
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
21
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
48
|
|
23
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
60
|
|
24
|
2
|
|
|
2
|
|
15
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
18
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174405; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1-$2', |
30
|
|
|
|
|
|
|
'leading_digits' => '310', |
31
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})' |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
'format' => '$1-$2', |
35
|
|
|
|
|
|
|
'intl_format' => 'NA', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
[24-9]| |
38
|
|
|
|
|
|
|
3(?: |
39
|
|
|
|
|
|
|
[02-9]| |
40
|
|
|
|
|
|
|
1[1-9] |
41
|
|
|
|
|
|
|
) |
42
|
|
|
|
|
|
|
', |
43
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})' |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
{ |
46
|
|
|
|
|
|
|
'format' => '($1) $2-$3', |
47
|
|
|
|
|
|
|
'intl_format' => '$1-$2-$3', |
48
|
|
|
|
|
|
|
'leading_digits' => '[2-9]', |
49
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{4})' |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
]; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $validators = { |
54
|
|
|
|
|
|
|
'geographic' => '( |
55
|
|
|
|
|
|
|
340(?: |
56
|
|
|
|
|
|
|
2(?: |
57
|
|
|
|
|
|
|
0[0-368]| |
58
|
|
|
|
|
|
|
2[06-8]| |
59
|
|
|
|
|
|
|
4[49]| |
60
|
|
|
|
|
|
|
77 |
61
|
|
|
|
|
|
|
)| |
62
|
|
|
|
|
|
|
3(?: |
63
|
|
|
|
|
|
|
32| |
64
|
|
|
|
|
|
|
44 |
65
|
|
|
|
|
|
|
)| |
66
|
|
|
|
|
|
|
4(?: |
67
|
|
|
|
|
|
|
2[23]| |
68
|
|
|
|
|
|
|
44| |
69
|
|
|
|
|
|
|
7[34]| |
70
|
|
|
|
|
|
|
89 |
71
|
|
|
|
|
|
|
)| |
72
|
|
|
|
|
|
|
5(?: |
73
|
|
|
|
|
|
|
1[34]| |
74
|
|
|
|
|
|
|
55 |
75
|
|
|
|
|
|
|
)| |
76
|
|
|
|
|
|
|
6(?: |
77
|
|
|
|
|
|
|
2[56]| |
78
|
|
|
|
|
|
|
4[23]| |
79
|
|
|
|
|
|
|
77| |
80
|
|
|
|
|
|
|
9[023] |
81
|
|
|
|
|
|
|
)| |
82
|
|
|
|
|
|
|
7(?: |
83
|
|
|
|
|
|
|
1[2-57-9]| |
84
|
|
|
|
|
|
|
2[57]| |
85
|
|
|
|
|
|
|
7\\d |
86
|
|
|
|
|
|
|
)| |
87
|
|
|
|
|
|
|
884| |
88
|
|
|
|
|
|
|
998 |
89
|
|
|
|
|
|
|
)\\d{4} |
90
|
|
|
|
|
|
|
| |
91
|
|
|
|
|
|
|
340(?: |
92
|
|
|
|
|
|
|
2(?: |
93
|
|
|
|
|
|
|
0[0-368]| |
94
|
|
|
|
|
|
|
2[06-8]| |
95
|
|
|
|
|
|
|
4[49]| |
96
|
|
|
|
|
|
|
77 |
97
|
|
|
|
|
|
|
)| |
98
|
|
|
|
|
|
|
3(?: |
99
|
|
|
|
|
|
|
32| |
100
|
|
|
|
|
|
|
44 |
101
|
|
|
|
|
|
|
)| |
102
|
|
|
|
|
|
|
4(?: |
103
|
|
|
|
|
|
|
2[23]| |
104
|
|
|
|
|
|
|
44| |
105
|
|
|
|
|
|
|
7[34]| |
106
|
|
|
|
|
|
|
89 |
107
|
|
|
|
|
|
|
)| |
108
|
|
|
|
|
|
|
5(?: |
109
|
|
|
|
|
|
|
1[34]| |
110
|
|
|
|
|
|
|
55 |
111
|
|
|
|
|
|
|
)| |
112
|
|
|
|
|
|
|
6(?: |
113
|
|
|
|
|
|
|
2[56]| |
114
|
|
|
|
|
|
|
4[23]| |
115
|
|
|
|
|
|
|
77| |
116
|
|
|
|
|
|
|
9[023] |
117
|
|
|
|
|
|
|
)| |
118
|
|
|
|
|
|
|
7(?: |
119
|
|
|
|
|
|
|
1[2-57-9]| |
120
|
|
|
|
|
|
|
2[57]| |
121
|
|
|
|
|
|
|
7\\d |
122
|
|
|
|
|
|
|
)| |
123
|
|
|
|
|
|
|
884| |
124
|
|
|
|
|
|
|
998 |
125
|
|
|
|
|
|
|
)\\d{4} |
126
|
|
|
|
|
|
|
)', |
127
|
|
|
|
|
|
|
'pager' => '', |
128
|
|
|
|
|
|
|
'personal_number' => ' |
129
|
|
|
|
|
|
|
52(?: |
130
|
|
|
|
|
|
|
3(?: |
131
|
|
|
|
|
|
|
[2-46-9][02-9]\\d| |
132
|
|
|
|
|
|
|
5(?: |
133
|
|
|
|
|
|
|
[02-46-9]\\d| |
134
|
|
|
|
|
|
|
5[0-46-9] |
135
|
|
|
|
|
|
|
) |
136
|
|
|
|
|
|
|
)| |
137
|
|
|
|
|
|
|
4(?: |
138
|
|
|
|
|
|
|
[2-478][02-9]\\d| |
139
|
|
|
|
|
|
|
5(?: |
140
|
|
|
|
|
|
|
[034]\\d| |
141
|
|
|
|
|
|
|
2[024-9]| |
142
|
|
|
|
|
|
|
5[0-46-9] |
143
|
|
|
|
|
|
|
)| |
144
|
|
|
|
|
|
|
6(?: |
145
|
|
|
|
|
|
|
0[1-9]| |
146
|
|
|
|
|
|
|
[2-9]\\d |
147
|
|
|
|
|
|
|
)| |
148
|
|
|
|
|
|
|
9(?: |
149
|
|
|
|
|
|
|
[05-9]\\d| |
150
|
|
|
|
|
|
|
2[0-5]| |
151
|
|
|
|
|
|
|
49 |
152
|
|
|
|
|
|
|
) |
153
|
|
|
|
|
|
|
) |
154
|
|
|
|
|
|
|
)\\d{4}| |
155
|
|
|
|
|
|
|
52[34][2-9]1[02-9]\\d{4}| |
156
|
|
|
|
|
|
|
5(?: |
157
|
|
|
|
|
|
|
00| |
158
|
|
|
|
|
|
|
2[125-9]| |
159
|
|
|
|
|
|
|
33| |
160
|
|
|
|
|
|
|
44| |
161
|
|
|
|
|
|
|
66| |
162
|
|
|
|
|
|
|
77| |
163
|
|
|
|
|
|
|
88 |
164
|
|
|
|
|
|
|
)[2-9]\\d{6} |
165
|
|
|
|
|
|
|
', |
166
|
|
|
|
|
|
|
'specialrate' => '(900[2-9]\\d{6})', |
167
|
|
|
|
|
|
|
'toll_free' => ' |
168
|
|
|
|
|
|
|
8(?: |
169
|
|
|
|
|
|
|
00| |
170
|
|
|
|
|
|
|
33| |
171
|
|
|
|
|
|
|
44| |
172
|
|
|
|
|
|
|
55| |
173
|
|
|
|
|
|
|
66| |
174
|
|
|
|
|
|
|
77| |
175
|
|
|
|
|
|
|
88 |
176
|
|
|
|
|
|
|
)[2-9]\\d{6} |
177
|
|
|
|
|
|
|
', |
178
|
|
|
|
|
|
|
'voip' => '' |
179
|
|
|
|
|
|
|
}; |
180
|
2
|
|
|
2
|
|
298
|
use Number::Phone::NANP::Data; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
368
|
|
181
|
|
|
|
|
|
|
sub areaname { |
182
|
|
|
|
|
|
|
# uncoverable subroutine - no data for most NANP countries |
183
|
|
|
|
|
|
|
# uncoverable statement |
184
|
0
|
|
|
0
|
1
|
0
|
Number::Phone::NANP::Data::_areaname('1'.shift()->{number}); } |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
sub new { |
187
|
13
|
|
|
13
|
1
|
37
|
my $class = shift; |
188
|
13
|
|
|
|
|
28
|
my $number = shift; |
189
|
13
|
|
|
|
|
93
|
$number =~ s/(^\+1|\D)//g; |
190
|
13
|
|
|
|
|
76
|
my $self = bless({ country_code => '1', number => $number, formatters => $formatters, validators => $validators, }, $class); |
191
|
13
|
100
|
|
|
|
77
|
return $self->is_valid() ? $self : undef; |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
1; |