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::TR; |
20
|
2
|
|
|
2
|
|
1405
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
271
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
20
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
162
|
|
23
|
2
|
|
|
2
|
|
39
|
use warnings; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
63
|
|
24
|
2
|
|
|
2
|
|
13
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
17
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181422; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'intl_format' => 'NA', |
31
|
|
|
|
|
|
|
'leading_digits' => '444', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d)(\\d{3})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
512| |
38
|
|
|
|
|
|
|
8[01589]| |
39
|
|
|
|
|
|
|
90 |
40
|
|
|
|
|
|
|
', |
41
|
|
|
|
|
|
|
'national_rule' => '0$1', |
42
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{4})' |
43
|
|
|
|
|
|
|
}, |
44
|
|
|
|
|
|
|
{ |
45
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
46
|
|
|
|
|
|
|
'leading_digits' => ' |
47
|
|
|
|
|
|
|
5(?: |
48
|
|
|
|
|
|
|
[0-59]| |
49
|
|
|
|
|
|
|
6161 |
50
|
|
|
|
|
|
|
) |
51
|
|
|
|
|
|
|
', |
52
|
|
|
|
|
|
|
'national_rule' => '0$1', |
53
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})' |
54
|
|
|
|
|
|
|
}, |
55
|
|
|
|
|
|
|
{ |
56
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
57
|
|
|
|
|
|
|
'leading_digits' => ' |
58
|
|
|
|
|
|
|
[24][1-8]| |
59
|
|
|
|
|
|
|
3[1-9] |
60
|
|
|
|
|
|
|
', |
61
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
62
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})' |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
66
|
|
|
|
|
|
|
'leading_digits' => '80', |
67
|
|
|
|
|
|
|
'national_rule' => '0$1', |
68
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{6,7})' |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
]; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
my $validators = { |
73
|
|
|
|
|
|
|
'fixed_line' => ' |
74
|
|
|
|
|
|
|
(?: |
75
|
|
|
|
|
|
|
2(?: |
76
|
|
|
|
|
|
|
[13][26]| |
77
|
|
|
|
|
|
|
[28][2468]| |
78
|
|
|
|
|
|
|
[45][268]| |
79
|
|
|
|
|
|
|
[67][246] |
80
|
|
|
|
|
|
|
)| |
81
|
|
|
|
|
|
|
3(?: |
82
|
|
|
|
|
|
|
[13][28]| |
83
|
|
|
|
|
|
|
[24-6][2468]| |
84
|
|
|
|
|
|
|
[78][02468]| |
85
|
|
|
|
|
|
|
92 |
86
|
|
|
|
|
|
|
)| |
87
|
|
|
|
|
|
|
4(?: |
88
|
|
|
|
|
|
|
[16][246]| |
89
|
|
|
|
|
|
|
[23578][2468]| |
90
|
|
|
|
|
|
|
4[26] |
91
|
|
|
|
|
|
|
) |
92
|
|
|
|
|
|
|
)\\d{7} |
93
|
|
|
|
|
|
|
', |
94
|
|
|
|
|
|
|
'geographic' => ' |
95
|
|
|
|
|
|
|
(?: |
96
|
|
|
|
|
|
|
2(?: |
97
|
|
|
|
|
|
|
[13][26]| |
98
|
|
|
|
|
|
|
[28][2468]| |
99
|
|
|
|
|
|
|
[45][268]| |
100
|
|
|
|
|
|
|
[67][246] |
101
|
|
|
|
|
|
|
)| |
102
|
|
|
|
|
|
|
3(?: |
103
|
|
|
|
|
|
|
[13][28]| |
104
|
|
|
|
|
|
|
[24-6][2468]| |
105
|
|
|
|
|
|
|
[78][02468]| |
106
|
|
|
|
|
|
|
92 |
107
|
|
|
|
|
|
|
)| |
108
|
|
|
|
|
|
|
4(?: |
109
|
|
|
|
|
|
|
[16][246]| |
110
|
|
|
|
|
|
|
[23578][2468]| |
111
|
|
|
|
|
|
|
4[26] |
112
|
|
|
|
|
|
|
) |
113
|
|
|
|
|
|
|
)\\d{7} |
114
|
|
|
|
|
|
|
', |
115
|
|
|
|
|
|
|
'mobile' => ' |
116
|
|
|
|
|
|
|
56161\\d{5}| |
117
|
|
|
|
|
|
|
5(?: |
118
|
|
|
|
|
|
|
0[15-7]| |
119
|
|
|
|
|
|
|
1[06]| |
120
|
|
|
|
|
|
|
24| |
121
|
|
|
|
|
|
|
[34]\\d| |
122
|
|
|
|
|
|
|
5[1-59]| |
123
|
|
|
|
|
|
|
9[46] |
124
|
|
|
|
|
|
|
)\\d{7} |
125
|
|
|
|
|
|
|
', |
126
|
|
|
|
|
|
|
'pager' => '512\\d{7}', |
127
|
|
|
|
|
|
|
'personal_number' => ' |
128
|
|
|
|
|
|
|
592(?: |
129
|
|
|
|
|
|
|
21[12]| |
130
|
|
|
|
|
|
|
461 |
131
|
|
|
|
|
|
|
)\\d{4} |
132
|
|
|
|
|
|
|
', |
133
|
|
|
|
|
|
|
'specialrate' => '( |
134
|
|
|
|
|
|
|
(?: |
135
|
|
|
|
|
|
|
8[89]8| |
136
|
|
|
|
|
|
|
900 |
137
|
|
|
|
|
|
|
)\\d{7} |
138
|
|
|
|
|
|
|
)|(444\\d{4})', |
139
|
|
|
|
|
|
|
'toll_free' => ' |
140
|
|
|
|
|
|
|
8(?: |
141
|
|
|
|
|
|
|
00\\d{7}(?: |
142
|
|
|
|
|
|
|
\\d{2,3} |
143
|
|
|
|
|
|
|
)?| |
144
|
|
|
|
|
|
|
11\\d{7} |
145
|
|
|
|
|
|
|
) |
146
|
|
|
|
|
|
|
', |
147
|
|
|
|
|
|
|
'voip' => '850\\d{7}' |
148
|
|
|
|
|
|
|
}; |
149
|
|
|
|
|
|
|
my %areanames = (); |
150
|
|
|
|
|
|
|
$areanames{tr} = {"90378", "Bartın", |
151
|
|
|
|
|
|
|
"90262", "Kocaeli\ \(İzmit\)", |
152
|
|
|
|
|
|
|
"90424", "Elazığ", |
153
|
|
|
|
|
|
|
"90384", "Nevşehir", |
154
|
|
|
|
|
|
|
"90412", "Diyarbakır", |
155
|
|
|
|
|
|
|
"90476", "Iğdır", |
156
|
|
|
|
|
|
|
"90282", "Tekirdağ", |
157
|
|
|
|
|
|
|
"90386", "Kırşehir", |
158
|
|
|
|
|
|
|
"90426", "Bingöl", |
159
|
|
|
|
|
|
|
"90370", "Karabük", |
160
|
|
|
|
|
|
|
"90364", "Çorum", |
161
|
|
|
|
|
|
|
"9039", "Kuzey\ Kıbrıs", |
162
|
|
|
|
|
|
|
"90252", "Muğla", |
163
|
|
|
|
|
|
|
"90264", "Sakarya\ \(Adapazarı\)", |
164
|
|
|
|
|
|
|
"90286", "Çanakkale", |
165
|
|
|
|
|
|
|
"90256", "Aydın", |
166
|
|
|
|
|
|
|
"90414", "Şanlıurfa", |
167
|
|
|
|
|
|
|
"90232", "İzmir", |
168
|
|
|
|
|
|
|
"90266", "Balıkesir", |
169
|
|
|
|
|
|
|
"90318", "Kırıkkale", |
170
|
|
|
|
|
|
|
"90472", "Ağrı", |
171
|
|
|
|
|
|
|
"90416", "Adıyaman", |
172
|
|
|
|
|
|
|
"90436", "Muş", |
173
|
|
|
|
|
|
|
"90344", "Kahramanmaraş", |
174
|
|
|
|
|
|
|
"90372", "Zonguldak", |
175
|
|
|
|
|
|
|
"90276", "Uşak", |
176
|
|
|
|
|
|
|
"90212", "Istanbul\ \(Avrupa\)", |
177
|
|
|
|
|
|
|
"90288", "Kırklareli", |
178
|
|
|
|
|
|
|
"90274", "Kütahya", |
179
|
|
|
|
|
|
|
"90222", "Eskisehir", |
180
|
|
|
|
|
|
|
"90486", "Şırnak", |
181
|
|
|
|
|
|
|
"90456", "Gümüşhane", |
182
|
|
|
|
|
|
|
"90428", "Tunceli", |
183
|
|
|
|
|
|
|
"90388", "Niğde", |
184
|
|
|
|
|
|
|
"90324", "Mersin", |
185
|
|
|
|
|
|
|
"90484", "Siirt", |
186
|
|
|
|
|
|
|
"90380", "Düzce", |
187
|
|
|
|
|
|
|
"90376", "Çankırı",}; |
188
|
|
|
|
|
|
|
$areanames{en} = {"90352", "Kayseri", |
189
|
|
|
|
|
|
|
"90256", "Aydin", |
190
|
|
|
|
|
|
|
"90228", "Bilecik", |
191
|
|
|
|
|
|
|
"90414", "Sanliurfa", |
192
|
|
|
|
|
|
|
"90348", "Kilis", |
193
|
|
|
|
|
|
|
"90446", "Erzincan", |
194
|
|
|
|
|
|
|
"90264", "Sakarya", |
195
|
|
|
|
|
|
|
"90382", "Aksaray", |
196
|
|
|
|
|
|
|
"90422", "Malatya", |
197
|
|
|
|
|
|
|
"90286", "Canakkale", |
198
|
|
|
|
|
|
|
"90416", "Adiyaman", |
199
|
|
|
|
|
|
|
"90438", "Hakkari", |
200
|
|
|
|
|
|
|
"90472", "Agri", |
201
|
|
|
|
|
|
|
"90284", "Edirne", |
202
|
|
|
|
|
|
|
"90266", "Balikesir", |
203
|
|
|
|
|
|
|
"90232", "Izmir", |
204
|
|
|
|
|
|
|
"90318", "Kirikkale", |
205
|
|
|
|
|
|
|
"90362", "Samsun", |
206
|
|
|
|
|
|
|
"90354", "Yozgat", |
207
|
|
|
|
|
|
|
"90476", "Igdir", |
208
|
|
|
|
|
|
|
"90412", "Diyarbakir", |
209
|
|
|
|
|
|
|
"90366", "Kastamonu", |
210
|
|
|
|
|
|
|
"90332", "Konya", |
211
|
|
|
|
|
|
|
"90236", "Manisa", |
212
|
|
|
|
|
|
|
"90262", "Kocaeli", |
213
|
|
|
|
|
|
|
"90378", "Bartin", |
214
|
|
|
|
|
|
|
"90384", "Nevsehir", |
215
|
|
|
|
|
|
|
"90424", "Elazig", |
216
|
|
|
|
|
|
|
"90474", "Kars", |
217
|
|
|
|
|
|
|
"90248", "Burdur", |
218
|
|
|
|
|
|
|
"9039", "Northern\ Cyprus", |
219
|
|
|
|
|
|
|
"90252", "Mugla", |
220
|
|
|
|
|
|
|
"90488", "Batman", |
221
|
|
|
|
|
|
|
"90356", "Tokat", |
222
|
|
|
|
|
|
|
"90328", "Osmaniye", |
223
|
|
|
|
|
|
|
"90282", "Tekirdag", |
224
|
|
|
|
|
|
|
"90458", "Bayburt", |
225
|
|
|
|
|
|
|
"90386", "Kirsehir", |
226
|
|
|
|
|
|
|
"90426", "Bingol", |
227
|
|
|
|
|
|
|
"90370", "Karabuk", |
228
|
|
|
|
|
|
|
"90364", "Corum", |
229
|
|
|
|
|
|
|
"90442", "Erzurum", |
230
|
|
|
|
|
|
|
"90374", "Bolu", |
231
|
|
|
|
|
|
|
"90456", "Gumushane", |
232
|
|
|
|
|
|
|
"90428", "Tuniceli", |
233
|
|
|
|
|
|
|
"90388", "Nigde", |
234
|
|
|
|
|
|
|
"90222", "Esksehir", |
235
|
|
|
|
|
|
|
"90486", "Sirnak", |
236
|
|
|
|
|
|
|
"90326", "Hatay", |
237
|
|
|
|
|
|
|
"90358", "Amasya", |
238
|
|
|
|
|
|
|
"90464", "Rize", |
239
|
|
|
|
|
|
|
"90246", "Isparta", |
240
|
|
|
|
|
|
|
"90342", "Gaziantep", |
241
|
|
|
|
|
|
|
"90454", "Giresun", |
242
|
|
|
|
|
|
|
"90380", "Duzce", |
243
|
|
|
|
|
|
|
"90272", "Afyon", |
244
|
|
|
|
|
|
|
"90376", "Cankiri", |
245
|
|
|
|
|
|
|
"90312", "Ankara", |
246
|
|
|
|
|
|
|
"90368", "Sinop", |
247
|
|
|
|
|
|
|
"90216", "Istanbul\ \(Anatolia\)", |
248
|
|
|
|
|
|
|
"90466", "Artvin", |
249
|
|
|
|
|
|
|
"90432", "Van", |
250
|
|
|
|
|
|
|
"90478", "Ardahan", |
251
|
|
|
|
|
|
|
"90484", "Stirt", |
252
|
|
|
|
|
|
|
"90324", "Icel", |
253
|
|
|
|
|
|
|
"90212", "Istanbul\ \(Europe\)", |
254
|
|
|
|
|
|
|
"90338", "Karaman", |
255
|
|
|
|
|
|
|
"90372", "Zongdulak", |
256
|
|
|
|
|
|
|
"90276", "Usak", |
257
|
|
|
|
|
|
|
"90224", "Bursa", |
258
|
|
|
|
|
|
|
"90344", "K\.\ Maras", |
259
|
|
|
|
|
|
|
"90436", "Mus", |
260
|
|
|
|
|
|
|
"90462", "Trabzon", |
261
|
|
|
|
|
|
|
"90452", "Ordu", |
262
|
|
|
|
|
|
|
"90288", "Kirklareli", |
263
|
|
|
|
|
|
|
"90274", "Kutahya", |
264
|
|
|
|
|
|
|
"90346", "Sivas", |
265
|
|
|
|
|
|
|
"90242", "Antalya", |
266
|
|
|
|
|
|
|
"90434", "Bitlis", |
267
|
|
|
|
|
|
|
"90322", "Adana", |
268
|
|
|
|
|
|
|
"90482", "Mardin", |
269
|
|
|
|
|
|
|
"90258", "Denizli", |
270
|
|
|
|
|
|
|
"90226", "Yalova",}; |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
sub new { |
273
|
25
|
|
|
25
|
1
|
64
|
my $class = shift; |
274
|
25
|
|
|
|
|
55
|
my $number = shift; |
275
|
25
|
|
|
|
|
196
|
$number =~ s/(^\+90|\D)//g; |
276
|
25
|
|
|
|
|
173
|
my $self = bless({ country_code => '90', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
277
|
25
|
100
|
|
|
|
144
|
return $self if ($self->is_valid()); |
278
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
279
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '90', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
280
|
1
|
50
|
|
|
|
11
|
return $self->is_valid() ? $self : undef; |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
1; |