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::FI; |
20
|
3
|
|
|
3
|
|
1668
|
use base qw(Number::Phone::StubCountry); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
321
|
|
21
|
|
|
|
|
|
|
|
22
|
3
|
|
|
3
|
|
22
|
use strict; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
65
|
|
23
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
72
|
|
24
|
3
|
|
|
3
|
|
35
|
use utf8; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
18
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181420; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1', |
30
|
|
|
|
|
|
|
'intl_format' => 'NA', |
31
|
|
|
|
|
|
|
'leading_digits' => '75[12]', |
32
|
|
|
|
|
|
|
'national_rule' => '0$1', |
33
|
|
|
|
|
|
|
'pattern' => '(\\d{5})' |
34
|
|
|
|
|
|
|
}, |
35
|
|
|
|
|
|
|
{ |
36
|
|
|
|
|
|
|
'format' => '$1 $2', |
37
|
|
|
|
|
|
|
'leading_digits' => ' |
38
|
|
|
|
|
|
|
[2568][1-8]| |
39
|
|
|
|
|
|
|
3(?: |
40
|
|
|
|
|
|
|
0[1-9]| |
41
|
|
|
|
|
|
|
[1-9] |
42
|
|
|
|
|
|
|
)| |
43
|
|
|
|
|
|
|
9 |
44
|
|
|
|
|
|
|
', |
45
|
|
|
|
|
|
|
'national_rule' => '0$1', |
46
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{4,9})' |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
{ |
49
|
|
|
|
|
|
|
'format' => '$1', |
50
|
|
|
|
|
|
|
'intl_format' => 'NA', |
51
|
|
|
|
|
|
|
'leading_digits' => '11', |
52
|
|
|
|
|
|
|
'pattern' => '(\\d{6})' |
53
|
|
|
|
|
|
|
}, |
54
|
|
|
|
|
|
|
{ |
55
|
|
|
|
|
|
|
'format' => '$1 $2', |
56
|
|
|
|
|
|
|
'leading_digits' => ' |
57
|
|
|
|
|
|
|
[12]00| |
58
|
|
|
|
|
|
|
[368]| |
59
|
|
|
|
|
|
|
70[07-9] |
60
|
|
|
|
|
|
|
', |
61
|
|
|
|
|
|
|
'national_rule' => '0$1', |
62
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3,7})' |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
'format' => '$1 $2', |
66
|
|
|
|
|
|
|
'leading_digits' => ' |
67
|
|
|
|
|
|
|
[1245]| |
68
|
|
|
|
|
|
|
7[135] |
69
|
|
|
|
|
|
|
', |
70
|
|
|
|
|
|
|
'national_rule' => '0$1', |
71
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{4,8})' |
72
|
|
|
|
|
|
|
}, |
73
|
|
|
|
|
|
|
{ |
74
|
|
|
|
|
|
|
'format' => '$1 $2', |
75
|
|
|
|
|
|
|
'leading_digits' => '7', |
76
|
|
|
|
|
|
|
'national_rule' => '0$1', |
77
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{6,10})' |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
]; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
my $validators = { |
82
|
|
|
|
|
|
|
'fixed_line' => ' |
83
|
|
|
|
|
|
|
(?: |
84
|
|
|
|
|
|
|
1[3-79][1-8]| |
85
|
|
|
|
|
|
|
[235689][1-8]\\d |
86
|
|
|
|
|
|
|
)\\d{2,6} |
87
|
|
|
|
|
|
|
', |
88
|
|
|
|
|
|
|
'geographic' => ' |
89
|
|
|
|
|
|
|
(?: |
90
|
|
|
|
|
|
|
1[3-79][1-8]| |
91
|
|
|
|
|
|
|
[235689][1-8]\\d |
92
|
|
|
|
|
|
|
)\\d{2,6} |
93
|
|
|
|
|
|
|
', |
94
|
|
|
|
|
|
|
'mobile' => ' |
95
|
|
|
|
|
|
|
4946\\d{2,6}| |
96
|
|
|
|
|
|
|
(?: |
97
|
|
|
|
|
|
|
4[0-8]| |
98
|
|
|
|
|
|
|
50 |
99
|
|
|
|
|
|
|
)\\d{4,8} |
100
|
|
|
|
|
|
|
', |
101
|
|
|
|
|
|
|
'pager' => '', |
102
|
|
|
|
|
|
|
'personal_number' => '', |
103
|
|
|
|
|
|
|
'specialrate' => '([67]00\\d{5,6})|( |
104
|
|
|
|
|
|
|
20\\d{4,8}| |
105
|
|
|
|
|
|
|
60[12]\\d{5,6}| |
106
|
|
|
|
|
|
|
7(?: |
107
|
|
|
|
|
|
|
099\\d{4,5}| |
108
|
|
|
|
|
|
|
5[03-9]\\d{3,7} |
109
|
|
|
|
|
|
|
)| |
110
|
|
|
|
|
|
|
20[2-59]\\d\\d| |
111
|
|
|
|
|
|
|
(?: |
112
|
|
|
|
|
|
|
606| |
113
|
|
|
|
|
|
|
7(?: |
114
|
|
|
|
|
|
|
0[78]| |
115
|
|
|
|
|
|
|
1| |
116
|
|
|
|
|
|
|
3\\d |
117
|
|
|
|
|
|
|
) |
118
|
|
|
|
|
|
|
)\\d{7}| |
119
|
|
|
|
|
|
|
(?: |
120
|
|
|
|
|
|
|
10| |
121
|
|
|
|
|
|
|
29| |
122
|
|
|
|
|
|
|
3[09]| |
123
|
|
|
|
|
|
|
70[1-5]\\d |
124
|
|
|
|
|
|
|
)\\d{4,8} |
125
|
|
|
|
|
|
|
)', |
126
|
|
|
|
|
|
|
'toll_free' => '800\\d{4,6}', |
127
|
|
|
|
|
|
|
'voip' => '' |
128
|
|
|
|
|
|
|
}; |
129
|
|
|
|
|
|
|
my %areanames = (); |
130
|
|
|
|
|
|
|
$areanames{sv} = {"35863", "Vasa", |
131
|
|
|
|
|
|
|
"35827", "Åbo\/Björneborg", |
132
|
|
|
|
|
|
|
"35835", "Tavastland", |
133
|
|
|
|
|
|
|
"35831", "Tavastland", |
134
|
|
|
|
|
|
|
"35838", "Tavastland", |
135
|
|
|
|
|
|
|
"35816", "Lappland", |
136
|
|
|
|
|
|
|
"35822", "Åbo\/Björneborg", |
137
|
|
|
|
|
|
|
"35883", "Uleåborg", |
138
|
|
|
|
|
|
|
"35814", "Mellersta\ Finland", |
139
|
|
|
|
|
|
|
"35853", "Kymmene", |
140
|
|
|
|
|
|
|
"35819", "Nyland", |
141
|
|
|
|
|
|
|
"35885", "Uleåborg", |
142
|
|
|
|
|
|
|
"35881", "Uleåborg", |
143
|
|
|
|
|
|
|
"35858", "Kymmene", |
144
|
|
|
|
|
|
|
"35826", "Åbo\/Björneborg", |
145
|
|
|
|
|
|
|
"35888", "Uleåborg", |
146
|
|
|
|
|
|
|
"35851", "Kymmene", |
147
|
|
|
|
|
|
|
"35855", "Kymmene", |
148
|
|
|
|
|
|
|
"35861", "Vasa", |
149
|
|
|
|
|
|
|
"35824", "Åbo\/Björneborg", |
150
|
|
|
|
|
|
|
"35865", "Vasa", |
151
|
|
|
|
|
|
|
"35833", "Tavastland", |
152
|
|
|
|
|
|
|
"35868", "Vasa", |
153
|
|
|
|
|
|
|
"35884", "Uleåborg", |
154
|
|
|
|
|
|
|
"35832", "Tavastland", |
155
|
|
|
|
|
|
|
"35866", "Vasa", |
156
|
|
|
|
|
|
|
"35813", "Norra\ Karelen", |
157
|
|
|
|
|
|
|
"35854", "Kymmene", |
158
|
|
|
|
|
|
|
"35825", "Åbo\/Björneborg", |
159
|
|
|
|
|
|
|
"35864", "Vasa", |
160
|
|
|
|
|
|
|
"35821", "Åbo\/Björneborg", |
161
|
|
|
|
|
|
|
"35837", "Tavastland", |
162
|
|
|
|
|
|
|
"35886", "Uleåborg", |
163
|
|
|
|
|
|
|
"3589", "Helsingfors", |
164
|
|
|
|
|
|
|
"35856", "Kymmene", |
165
|
|
|
|
|
|
|
"35828", "Åbo\/Björneborg", |
166
|
|
|
|
|
|
|
"35882", "Uleåborg", |
167
|
|
|
|
|
|
|
"35823", "Åbo\/Björneborg", |
168
|
|
|
|
|
|
|
"35867", "Vasa", |
169
|
|
|
|
|
|
|
"35834", "Tavastland", |
170
|
|
|
|
|
|
|
"35852", "Kymmene", |
171
|
|
|
|
|
|
|
"35887", "Uleåborg", |
172
|
|
|
|
|
|
|
"35836", "Tavastland", |
173
|
|
|
|
|
|
|
"35862", "Vasa", |
174
|
|
|
|
|
|
|
"35815", "St\ Michel", |
175
|
|
|
|
|
|
|
"35857", "Kymmene",}; |
176
|
|
|
|
|
|
|
$areanames{fi} = {"35814", "Keski\-Suomi", |
177
|
|
|
|
|
|
|
"35816", "Lappi", |
178
|
|
|
|
|
|
|
"35813", "Pohjois\-Karjala",}; |
179
|
|
|
|
|
|
|
$areanames{en} = {"35816", "Lapland", |
180
|
|
|
|
|
|
|
"35838", "Häme", |
181
|
|
|
|
|
|
|
"35827", "Turku\/Pori", |
182
|
|
|
|
|
|
|
"35863", "Vaasa", |
183
|
|
|
|
|
|
|
"35835", "Häme", |
184
|
|
|
|
|
|
|
"35831", "Häme", |
185
|
|
|
|
|
|
|
"35814", "Central\ Finland", |
186
|
|
|
|
|
|
|
"35853", "Kymi", |
187
|
|
|
|
|
|
|
"35819", "Uusimaa", |
188
|
|
|
|
|
|
|
"35822", "Turku\/Pori", |
189
|
|
|
|
|
|
|
"35883", "Oulu", |
190
|
|
|
|
|
|
|
"35817", "Kuopio", |
191
|
|
|
|
|
|
|
"35888", "Oulu", |
192
|
|
|
|
|
|
|
"35851", "Kymi", |
193
|
|
|
|
|
|
|
"35855", "Kymi", |
194
|
|
|
|
|
|
|
"35885", "Oulu", |
195
|
|
|
|
|
|
|
"35881", "Oulu", |
196
|
|
|
|
|
|
|
"35858", "Kymi", |
197
|
|
|
|
|
|
|
"35826", "Turku\/Pori", |
198
|
|
|
|
|
|
|
"35868", "Vaasa", |
199
|
|
|
|
|
|
|
"35824", "Turku\/Pori", |
200
|
|
|
|
|
|
|
"35861", "Vaasa", |
201
|
|
|
|
|
|
|
"35865", "Vaasa", |
202
|
|
|
|
|
|
|
"35833", "Häme", |
203
|
|
|
|
|
|
|
"35813", "North\ Karelia", |
204
|
|
|
|
|
|
|
"35854", "Kymi", |
205
|
|
|
|
|
|
|
"35884", "Oulu", |
206
|
|
|
|
|
|
|
"35866", "Vaasa", |
207
|
|
|
|
|
|
|
"35832", "Häme", |
208
|
|
|
|
|
|
|
"3589", "Helsinki", |
209
|
|
|
|
|
|
|
"35856", "Kymi", |
210
|
|
|
|
|
|
|
"35828", "Turku\/Pori", |
211
|
|
|
|
|
|
|
"35825", "Turku\/Pori", |
212
|
|
|
|
|
|
|
"35821", "Turku\/Pori", |
213
|
|
|
|
|
|
|
"35864", "Vaasa", |
214
|
|
|
|
|
|
|
"35837", "Häme", |
215
|
|
|
|
|
|
|
"35886", "Oulu", |
216
|
|
|
|
|
|
|
"35852", "Kymi", |
217
|
|
|
|
|
|
|
"35882", "Oulu", |
218
|
|
|
|
|
|
|
"35867", "Vaasa", |
219
|
|
|
|
|
|
|
"35823", "Turku\/Pori", |
220
|
|
|
|
|
|
|
"35834", "Häme", |
221
|
|
|
|
|
|
|
"35815", "Mikkeli", |
222
|
|
|
|
|
|
|
"35857", "Kymi", |
223
|
|
|
|
|
|
|
"35887", "Oulu", |
224
|
|
|
|
|
|
|
"35862", "Vaasa", |
225
|
|
|
|
|
|
|
"35836", "Häme",}; |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
sub new { |
228
|
52
|
|
|
52
|
1
|
111
|
my $class = shift; |
229
|
52
|
|
|
|
|
84
|
my $number = shift; |
230
|
52
|
|
|
|
|
313
|
$number =~ s/(^\+358|\D)//g; |
231
|
52
|
|
|
|
|
276
|
my $self = bless({ country_code => '358', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
232
|
52
|
100
|
|
|
|
246
|
return $self if ($self->is_valid()); |
233
|
6
|
|
|
|
|
16
|
$number =~ s/^(?:0)//; |
234
|
6
|
|
|
|
|
57
|
$self = bless({ country_code => '358', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
235
|
6
|
50
|
|
|
|
22
|
return $self->is_valid() ? $self : undef; |
236
|
|
|
|
|
|
|
} |
237
|
|
|
|
|
|
|
1; |