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
|
|
1342
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
329
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
52
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
64
|
|
23
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
59
|
|
24
|
2
|
|
|
2
|
|
17
|
use utf8; |
|
2
|
|
|
|
|
24
|
|
|
2
|
|
|
|
|
21
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
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} = {"90266", "Balıkesir", |
151
|
|
|
|
|
|
|
"90370", "Karabük", |
152
|
|
|
|
|
|
|
"90262", "Kocaeli\ \(İzmit\)", |
153
|
|
|
|
|
|
|
"90364", "Çorum", |
154
|
|
|
|
|
|
|
"9039", "Kuzey\ Kıbrıs", |
155
|
|
|
|
|
|
|
"90380", "Düzce", |
156
|
|
|
|
|
|
|
"90232", "İzmir", |
157
|
|
|
|
|
|
|
"90484", "Siirt", |
158
|
|
|
|
|
|
|
"90378", "Bartın", |
159
|
|
|
|
|
|
|
"90286", "Çanakkale", |
160
|
|
|
|
|
|
|
"90426", "Bingöl", |
161
|
|
|
|
|
|
|
"90384", "Nevşehir", |
162
|
|
|
|
|
|
|
"90282", "Tekirdağ", |
163
|
|
|
|
|
|
|
"90388", "Niğde", |
164
|
|
|
|
|
|
|
"90252", "Muğla", |
165
|
|
|
|
|
|
|
"90412", "Diyarbakır", |
166
|
|
|
|
|
|
|
"90276", "Uşak", |
167
|
|
|
|
|
|
|
"90256", "Aydın", |
168
|
|
|
|
|
|
|
"90416", "Adıyaman", |
169
|
|
|
|
|
|
|
"90436", "Muş", |
170
|
|
|
|
|
|
|
"90264", "Sakarya\ \(Adapazarı\)", |
171
|
|
|
|
|
|
|
"90376", "Çankırı", |
172
|
|
|
|
|
|
|
"90472", "Ağrı", |
173
|
|
|
|
|
|
|
"90288", "Kırklareli", |
174
|
|
|
|
|
|
|
"90456", "Gümüşhane", |
175
|
|
|
|
|
|
|
"90414", "Şanlıurfa", |
176
|
|
|
|
|
|
|
"90212", "Istanbul\ \(Avrupa\)", |
177
|
|
|
|
|
|
|
"90372", "Zonguldak", |
178
|
|
|
|
|
|
|
"90428", "Tunceli", |
179
|
|
|
|
|
|
|
"90476", "Iğdır", |
180
|
|
|
|
|
|
|
"90274", "Kütahya", |
181
|
|
|
|
|
|
|
"90386", "Kırşehir", |
182
|
|
|
|
|
|
|
"90424", "Elazığ", |
183
|
|
|
|
|
|
|
"90318", "Kırıkkale", |
184
|
|
|
|
|
|
|
"90324", "Mersin", |
185
|
|
|
|
|
|
|
"90344", "Kahramanmaraş", |
186
|
|
|
|
|
|
|
"90486", "Şırnak", |
187
|
|
|
|
|
|
|
"90222", "Eskisehir",}; |
188
|
|
|
|
|
|
|
$areanames{en} = {"90282", "Tekirdag", |
189
|
|
|
|
|
|
|
"90224", "Bursa", |
190
|
|
|
|
|
|
|
"90358", "Amasya", |
191
|
|
|
|
|
|
|
"90446", "Erzincan", |
192
|
|
|
|
|
|
|
"90322", "Adana", |
193
|
|
|
|
|
|
|
"90384", "Nevsehir", |
194
|
|
|
|
|
|
|
"90478", "Ardahan", |
195
|
|
|
|
|
|
|
"90342", "Gaziantep", |
196
|
|
|
|
|
|
|
"90426", "Bingol", |
197
|
|
|
|
|
|
|
"90286", "Canakkale", |
198
|
|
|
|
|
|
|
"90458", "Bayburt", |
199
|
|
|
|
|
|
|
"90442", "Erzurum", |
200
|
|
|
|
|
|
|
"90378", "Bartin", |
201
|
|
|
|
|
|
|
"90326", "Hatay", |
202
|
|
|
|
|
|
|
"90346", "Sivas", |
203
|
|
|
|
|
|
|
"90422", "Malatya", |
204
|
|
|
|
|
|
|
"90484", "Stirt", |
205
|
|
|
|
|
|
|
"90272", "Afyon", |
206
|
|
|
|
|
|
|
"90312", "Ankara", |
207
|
|
|
|
|
|
|
"90454", "Giresun", |
208
|
|
|
|
|
|
|
"90416", "Adiyaman", |
209
|
|
|
|
|
|
|
"90374", "Bolu", |
210
|
|
|
|
|
|
|
"90256", "Aydin", |
211
|
|
|
|
|
|
|
"90488", "Batman", |
212
|
|
|
|
|
|
|
"90354", "Yozgat", |
213
|
|
|
|
|
|
|
"90276", "Usak", |
214
|
|
|
|
|
|
|
"90228", "Bilecik", |
215
|
|
|
|
|
|
|
"90248", "Burdur", |
216
|
|
|
|
|
|
|
"90412", "Diyarbakir", |
217
|
|
|
|
|
|
|
"90388", "Nigde", |
218
|
|
|
|
|
|
|
"90252", "Mugla", |
219
|
|
|
|
|
|
|
"90474", "Kars", |
220
|
|
|
|
|
|
|
"90364", "Corum", |
221
|
|
|
|
|
|
|
"90262", "Kocaeli", |
222
|
|
|
|
|
|
|
"90438", "Hakkari", |
223
|
|
|
|
|
|
|
"90370", "Karabuk", |
224
|
|
|
|
|
|
|
"90464", "Rize", |
225
|
|
|
|
|
|
|
"90266", "Balikesir", |
226
|
|
|
|
|
|
|
"90338", "Karaman", |
227
|
|
|
|
|
|
|
"90232", "Izmir", |
228
|
|
|
|
|
|
|
"90380", "Duzce", |
229
|
|
|
|
|
|
|
"90368", "Sinop", |
230
|
|
|
|
|
|
|
"90236", "Manisa", |
231
|
|
|
|
|
|
|
"9039", "Northern\ Cyprus", |
232
|
|
|
|
|
|
|
"90434", "Bitlis", |
233
|
|
|
|
|
|
|
"90452", "Ordu", |
234
|
|
|
|
|
|
|
"90356", "Tokat", |
235
|
|
|
|
|
|
|
"90274", "Kutahya", |
236
|
|
|
|
|
|
|
"90428", "Tuniceli", |
237
|
|
|
|
|
|
|
"90476", "Igdir", |
238
|
|
|
|
|
|
|
"90212", "Istanbul\ \(Europe\)", |
239
|
|
|
|
|
|
|
"90372", "Zongdulak", |
240
|
|
|
|
|
|
|
"90456", "Gumushane", |
241
|
|
|
|
|
|
|
"90414", "Sanliurfa", |
242
|
|
|
|
|
|
|
"90352", "Kayseri", |
243
|
|
|
|
|
|
|
"90288", "Kirklareli", |
244
|
|
|
|
|
|
|
"90472", "Agri", |
245
|
|
|
|
|
|
|
"90348", "Kilis", |
246
|
|
|
|
|
|
|
"90328", "Osmaniye", |
247
|
|
|
|
|
|
|
"90216", "Istanbul\ \(Anatolia\)", |
248
|
|
|
|
|
|
|
"90376", "Cankiri", |
249
|
|
|
|
|
|
|
"90242", "Antalya", |
250
|
|
|
|
|
|
|
"90222", "Esksehir", |
251
|
|
|
|
|
|
|
"90284", "Edirne", |
252
|
|
|
|
|
|
|
"90344", "K\.\ Maras", |
253
|
|
|
|
|
|
|
"90486", "Sirnak", |
254
|
|
|
|
|
|
|
"90258", "Denizli", |
255
|
|
|
|
|
|
|
"90324", "Icel", |
256
|
|
|
|
|
|
|
"90382", "Aksaray", |
257
|
|
|
|
|
|
|
"90246", "Isparta", |
258
|
|
|
|
|
|
|
"90226", "Yalova", |
259
|
|
|
|
|
|
|
"90318", "Kirikkale", |
260
|
|
|
|
|
|
|
"90482", "Mardin", |
261
|
|
|
|
|
|
|
"90424", "Elazig", |
262
|
|
|
|
|
|
|
"90386", "Kirsehir", |
263
|
|
|
|
|
|
|
"90332", "Konya", |
264
|
|
|
|
|
|
|
"90436", "Mus", |
265
|
|
|
|
|
|
|
"90432", "Van", |
266
|
|
|
|
|
|
|
"90466", "Artvin", |
267
|
|
|
|
|
|
|
"90362", "Samsun", |
268
|
|
|
|
|
|
|
"90264", "Sakarya", |
269
|
|
|
|
|
|
|
"90462", "Trabzon", |
270
|
|
|
|
|
|
|
"90366", "Kastamonu",}; |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
sub new { |
273
|
25
|
|
|
25
|
1
|
60
|
my $class = shift; |
274
|
25
|
|
|
|
|
86
|
my $number = shift; |
275
|
25
|
|
|
|
|
192
|
$number =~ s/(^\+90|\D)//g; |
276
|
25
|
|
|
|
|
165
|
my $self = bless({ country_code => '90', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
277
|
25
|
100
|
|
|
|
127
|
return $self if ($self->is_valid()); |
278
|
1
|
|
|
|
|
8
|
$number =~ s/^(?:0)//; |
279
|
1
|
|
|
|
|
13
|
$self = bless({ country_code => '90', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
280
|
1
|
50
|
|
|
|
6
|
return $self->is_valid() ? $self : undef; |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
1; |