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::LT; |
20
|
2
|
|
|
2
|
|
1188
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
216
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
20
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
49
|
|
23
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
50
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
20
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174404; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => '52[0-7]', |
31
|
|
|
|
|
|
|
'national_rule' => '(8-$1)', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{4})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
36
|
|
|
|
|
|
|
'leading_digits' => '[7-9]', |
37
|
|
|
|
|
|
|
'national_rule' => '8 $1', |
38
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{2})(\\d{3})' |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
'format' => '$1 $2', |
42
|
|
|
|
|
|
|
'leading_digits' => ' |
43
|
|
|
|
|
|
|
37| |
44
|
|
|
|
|
|
|
4(?: |
45
|
|
|
|
|
|
|
[15]| |
46
|
|
|
|
|
|
|
6[1-8] |
47
|
|
|
|
|
|
|
) |
48
|
|
|
|
|
|
|
', |
49
|
|
|
|
|
|
|
'national_rule' => '(8-$1)', |
50
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{6})' |
51
|
|
|
|
|
|
|
}, |
52
|
|
|
|
|
|
|
{ |
53
|
|
|
|
|
|
|
'format' => '$1 $2', |
54
|
|
|
|
|
|
|
'leading_digits' => '[3-6]', |
55
|
|
|
|
|
|
|
'national_rule' => '(8-$1)', |
56
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{5})' |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
]; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $validators = { |
61
|
|
|
|
|
|
|
'fixed_line' => ' |
62
|
|
|
|
|
|
|
(?: |
63
|
|
|
|
|
|
|
3[1478]| |
64
|
|
|
|
|
|
|
4[124-6]| |
65
|
|
|
|
|
|
|
52 |
66
|
|
|
|
|
|
|
)\\d{6} |
67
|
|
|
|
|
|
|
', |
68
|
|
|
|
|
|
|
'geographic' => ' |
69
|
|
|
|
|
|
|
(?: |
70
|
|
|
|
|
|
|
3[1478]| |
71
|
|
|
|
|
|
|
4[124-6]| |
72
|
|
|
|
|
|
|
52 |
73
|
|
|
|
|
|
|
)\\d{6} |
74
|
|
|
|
|
|
|
', |
75
|
|
|
|
|
|
|
'mobile' => '6\\d{7}', |
76
|
|
|
|
|
|
|
'pager' => '', |
77
|
|
|
|
|
|
|
'personal_number' => '70[05]\\d{5}', |
78
|
|
|
|
|
|
|
'specialrate' => '(808\\d{5})|( |
79
|
|
|
|
|
|
|
9(?: |
80
|
|
|
|
|
|
|
0[0239]| |
81
|
|
|
|
|
|
|
10 |
82
|
|
|
|
|
|
|
)\\d{5} |
83
|
|
|
|
|
|
|
)|(70[67]\\d{5})', |
84
|
|
|
|
|
|
|
'toll_free' => '80[02]\\d{5}', |
85
|
|
|
|
|
|
|
'voip' => '[89]01\\d{5}' |
86
|
|
|
|
|
|
|
}; |
87
|
|
|
|
|
|
|
my %areanames = (); |
88
|
|
|
|
|
|
|
$areanames{en} = {"370451", "Pasvalys", |
89
|
|
|
|
|
|
|
"370450", "Biržai", |
90
|
|
|
|
|
|
|
"370445", "Kretinga", |
91
|
|
|
|
|
|
|
"370460", "Palanga", |
92
|
|
|
|
|
|
|
"370444", "Telšiai", |
93
|
|
|
|
|
|
|
"370469", "Neringa", |
94
|
|
|
|
|
|
|
"370459", "Kupiškis", |
95
|
|
|
|
|
|
|
"370385", "Zarasai", |
96
|
|
|
|
|
|
|
"370458", "Rokiškis", |
97
|
|
|
|
|
|
|
"370525", "Vilnius", |
98
|
|
|
|
|
|
|
"370524", "Vilnius", |
99
|
|
|
|
|
|
|
"37037", "Kaunas", |
100
|
|
|
|
|
|
|
"370345", "Šakiai", |
101
|
|
|
|
|
|
|
"370383", "Molėtai", |
102
|
|
|
|
|
|
|
"370425", "Akmenė", |
103
|
|
|
|
|
|
|
"370318", "Lazdijai", |
104
|
|
|
|
|
|
|
"370443", "Mažeikiai", |
105
|
|
|
|
|
|
|
"370343", "Marijampolė", |
106
|
|
|
|
|
|
|
"370310", "Varėna", |
107
|
|
|
|
|
|
|
"370319", "Birštonas\/Prienai", |
108
|
|
|
|
|
|
|
"370523", "Vilnius", |
109
|
|
|
|
|
|
|
"370380", "Šalčininkai", |
110
|
|
|
|
|
|
|
"370381", "Anykščiai", |
111
|
|
|
|
|
|
|
"370387", "Švenčionys", |
112
|
|
|
|
|
|
|
"370449", "Šilalė", |
113
|
|
|
|
|
|
|
"370382", "Širvintos", |
114
|
|
|
|
|
|
|
"370440", "Skuodas", |
115
|
|
|
|
|
|
|
"370528", "Trakai", |
116
|
|
|
|
|
|
|
"370441", "Šilutė", |
117
|
|
|
|
|
|
|
"370447", "Jurbarkas", |
118
|
|
|
|
|
|
|
"370389", "Utena", |
119
|
|
|
|
|
|
|
"37045", "Panevėžys", |
120
|
|
|
|
|
|
|
"370340", "Ukmergė", |
121
|
|
|
|
|
|
|
"37046", "Klaipėda", |
122
|
|
|
|
|
|
|
"370347", "Kėdainiai", |
123
|
|
|
|
|
|
|
"370342", "Vilkaviškis", |
124
|
|
|
|
|
|
|
"370313", "Druskininkai", |
125
|
|
|
|
|
|
|
"370448", "Plungė", |
126
|
|
|
|
|
|
|
"370521", "Vilnius", |
127
|
|
|
|
|
|
|
"370520", "Vilnius", |
128
|
|
|
|
|
|
|
"370522", "Vilnius", |
129
|
|
|
|
|
|
|
"370426", "Joniškis", |
130
|
|
|
|
|
|
|
"370349", "Jonava", |
131
|
|
|
|
|
|
|
"370527", "Vilnius", |
132
|
|
|
|
|
|
|
"370346", "Kaišiadorys", |
133
|
|
|
|
|
|
|
"370421", "Pakruojis", |
134
|
|
|
|
|
|
|
"370526", "Vilnius", |
135
|
|
|
|
|
|
|
"370427", "Kelmė", |
136
|
|
|
|
|
|
|
"370422", "Radviliškis", |
137
|
|
|
|
|
|
|
"370386", "Ignalina\/Visaginas", |
138
|
|
|
|
|
|
|
"370315", "Alytus", |
139
|
|
|
|
|
|
|
"370428", "Raseiniai", |
140
|
|
|
|
|
|
|
"37041", "Šiauliai", |
141
|
|
|
|
|
|
|
"370446", "Tauragė",}; |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
sub new { |
144
|
25
|
|
|
25
|
1
|
54
|
my $class = shift; |
145
|
25
|
|
|
|
|
44
|
my $number = shift; |
146
|
25
|
|
|
|
|
173
|
$number =~ s/(^\+370|\D)//g; |
147
|
25
|
|
|
|
|
148
|
my $self = bless({ country_code => '370', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
148
|
25
|
100
|
|
|
|
135
|
return $self if ($self->is_valid()); |
149
|
1
|
|
|
|
|
7
|
$number =~ s/^(?:[08])//; |
150
|
1
|
|
|
|
|
12
|
$self = bless({ country_code => '370', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
151
|
1
|
50
|
|
|
|
6
|
return $self->is_valid() ? $self : undef; |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
1; |