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