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
|
|
1143
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
249
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
21
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
46
|
|
23
|
2
|
|
|
2
|
|
17
|
use warnings; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
51
|
|
24
|
2
|
|
|
2
|
|
13
|
use utf8; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
15
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
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} = {"370349", "Jonava", |
89
|
|
|
|
|
|
|
"37037", "Kaunas", |
90
|
|
|
|
|
|
|
"370340", "Ukmergė", |
91
|
|
|
|
|
|
|
"370381", "Anykščiai", |
92
|
|
|
|
|
|
|
"370346", "Kaišiadorys", |
93
|
|
|
|
|
|
|
"370343", "Marijampolė", |
94
|
|
|
|
|
|
|
"370422", "Radviliškis", |
95
|
|
|
|
|
|
|
"370459", "Kupiškis", |
96
|
|
|
|
|
|
|
"370450", "Biržai", |
97
|
|
|
|
|
|
|
"370385", "Zarasai", |
98
|
|
|
|
|
|
|
"370458", "Rokiškis", |
99
|
|
|
|
|
|
|
"370383", "Molėtai", |
100
|
|
|
|
|
|
|
"370386", "Ignalina\/Visaginas", |
101
|
|
|
|
|
|
|
"370345", "Šakiai", |
102
|
|
|
|
|
|
|
"370451", "Pasvalys", |
103
|
|
|
|
|
|
|
"370427", "Kelmė", |
104
|
|
|
|
|
|
|
"370389", "Utena", |
105
|
|
|
|
|
|
|
"370380", "Šalčininkai", |
106
|
|
|
|
|
|
|
"370382", "Širvintos", |
107
|
|
|
|
|
|
|
"370425", "Akmenė", |
108
|
|
|
|
|
|
|
"370347", "Kėdainiai", |
109
|
|
|
|
|
|
|
"370421", "Pakruojis", |
110
|
|
|
|
|
|
|
"370387", "Švenčionys", |
111
|
|
|
|
|
|
|
"370428", "Raseiniai", |
112
|
|
|
|
|
|
|
"370426", "Joniškis", |
113
|
|
|
|
|
|
|
"370342", "Vilkaviškis", |
114
|
|
|
|
|
|
|
"370469", "Neringa", |
115
|
|
|
|
|
|
|
"370460", "Palanga", |
116
|
|
|
|
|
|
|
"370315", "Alytus", |
117
|
|
|
|
|
|
|
"37045", "Panevėžys", |
118
|
|
|
|
|
|
|
"370522", "Vilnius", |
119
|
|
|
|
|
|
|
"370447", "Jurbarkas", |
120
|
|
|
|
|
|
|
"370318", "Lazdijai", |
121
|
|
|
|
|
|
|
"370527", "Vilnius", |
122
|
|
|
|
|
|
|
"370310", "Varėna", |
123
|
|
|
|
|
|
|
"370319", "Birštonas\/Prienai", |
124
|
|
|
|
|
|
|
"370313", "Druskininkai", |
125
|
|
|
|
|
|
|
"370440", "Skuodas", |
126
|
|
|
|
|
|
|
"370521", "Vilnius", |
127
|
|
|
|
|
|
|
"370449", "Šilalė", |
128
|
|
|
|
|
|
|
"370524", "Vilnius", |
129
|
|
|
|
|
|
|
"370448", "Plungė", |
130
|
|
|
|
|
|
|
"370525", "Vilnius", |
131
|
|
|
|
|
|
|
"370446", "Tauragė", |
132
|
|
|
|
|
|
|
"370443", "Mažeikiai", |
133
|
|
|
|
|
|
|
"37046", "Klaipėda", |
134
|
|
|
|
|
|
|
"370526", "Vilnius", |
135
|
|
|
|
|
|
|
"370523", "Vilnius", |
136
|
|
|
|
|
|
|
"370445", "Kretinga", |
137
|
|
|
|
|
|
|
"37041", "Šiauliai", |
138
|
|
|
|
|
|
|
"370444", "Telšiai", |
139
|
|
|
|
|
|
|
"370528", "Trakai", |
140
|
|
|
|
|
|
|
"370441", "Šilutė", |
141
|
|
|
|
|
|
|
"370520", "Vilnius",}; |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
sub new { |
144
|
25
|
|
|
25
|
1
|
59
|
my $class = shift; |
145
|
25
|
|
|
|
|
50
|
my $number = shift; |
146
|
25
|
|
|
|
|
157
|
$number =~ s/(^\+370|\D)//g; |
147
|
25
|
|
|
|
|
153
|
my $self = bless({ country_code => '370', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
148
|
25
|
100
|
|
|
|
121
|
return $self if ($self->is_valid()); |
149
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:[08])//; |
150
|
1
|
|
|
|
|
12
|
$self = bless({ country_code => '370', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
151
|
1
|
50
|
|
|
|
7
|
return $self->is_valid() ? $self : undef; |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
1; |