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