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::SN; |
20
|
2
|
|
|
2
|
|
1268
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
267
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
26
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
51
|
|
23
|
2
|
|
|
2
|
|
17
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
53
|
|
24
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
17
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174404; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
30
|
|
|
|
|
|
|
'leading_digits' => '8', |
31
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})' |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
35
|
|
|
|
|
|
|
'leading_digits' => '[379]', |
36
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})' |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
]; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $validators = { |
41
|
|
|
|
|
|
|
'fixed_line' => ' |
42
|
|
|
|
|
|
|
3(?: |
43
|
|
|
|
|
|
|
0(?: |
44
|
|
|
|
|
|
|
1[0-2]| |
45
|
|
|
|
|
|
|
80 |
46
|
|
|
|
|
|
|
)| |
47
|
|
|
|
|
|
|
282| |
48
|
|
|
|
|
|
|
3(?: |
49
|
|
|
|
|
|
|
8[1-9]| |
50
|
|
|
|
|
|
|
9[3-9] |
51
|
|
|
|
|
|
|
)| |
52
|
|
|
|
|
|
|
611 |
53
|
|
|
|
|
|
|
)\\d{5} |
54
|
|
|
|
|
|
|
', |
55
|
|
|
|
|
|
|
'geographic' => ' |
56
|
|
|
|
|
|
|
3(?: |
57
|
|
|
|
|
|
|
0(?: |
58
|
|
|
|
|
|
|
1[0-2]| |
59
|
|
|
|
|
|
|
80 |
60
|
|
|
|
|
|
|
)| |
61
|
|
|
|
|
|
|
282| |
62
|
|
|
|
|
|
|
3(?: |
63
|
|
|
|
|
|
|
8[1-9]| |
64
|
|
|
|
|
|
|
9[3-9] |
65
|
|
|
|
|
|
|
)| |
66
|
|
|
|
|
|
|
611 |
67
|
|
|
|
|
|
|
)\\d{5} |
68
|
|
|
|
|
|
|
', |
69
|
|
|
|
|
|
|
'mobile' => ' |
70
|
|
|
|
|
|
|
7(?: |
71
|
|
|
|
|
|
|
(?: |
72
|
|
|
|
|
|
|
[06-8]\\d| |
73
|
|
|
|
|
|
|
21| |
74
|
|
|
|
|
|
|
90 |
75
|
|
|
|
|
|
|
)\\d| |
76
|
|
|
|
|
|
|
5(?: |
77
|
|
|
|
|
|
|
01| |
78
|
|
|
|
|
|
|
[19]0| |
79
|
|
|
|
|
|
|
25| |
80
|
|
|
|
|
|
|
[38]3| |
81
|
|
|
|
|
|
|
[4-7]\\d |
82
|
|
|
|
|
|
|
) |
83
|
|
|
|
|
|
|
)\\d{5} |
84
|
|
|
|
|
|
|
', |
85
|
|
|
|
|
|
|
'pager' => '', |
86
|
|
|
|
|
|
|
'personal_number' => '', |
87
|
|
|
|
|
|
|
'specialrate' => '(81[02468]\\d{6})|(88[4689]\\d{6})', |
88
|
|
|
|
|
|
|
'toll_free' => '800\\d{6}', |
89
|
|
|
|
|
|
|
'voip' => ' |
90
|
|
|
|
|
|
|
(?: |
91
|
|
|
|
|
|
|
3(?: |
92
|
|
|
|
|
|
|
392| |
93
|
|
|
|
|
|
|
9[01]\\d |
94
|
|
|
|
|
|
|
)\\d| |
95
|
|
|
|
|
|
|
93(?: |
96
|
|
|
|
|
|
|
3[13]0| |
97
|
|
|
|
|
|
|
929 |
98
|
|
|
|
|
|
|
) |
99
|
|
|
|
|
|
|
)\\d{4} |
100
|
|
|
|
|
|
|
' |
101
|
|
|
|
|
|
|
}; |
102
|
|
|
|
|
|
|
my %areanames = (); |
103
|
|
|
|
|
|
|
$areanames{en} = {"2213395", "Outside\ Dakar", |
104
|
|
|
|
|
|
|
"2213393", "Outside\ Dakar", |
105
|
|
|
|
|
|
|
"2213397", "Outside\ Dakar", |
106
|
|
|
|
|
|
|
"2213396", "Outside\ Dakar", |
107
|
|
|
|
|
|
|
"2213394", "Outside\ Dakar", |
108
|
|
|
|
|
|
|
"221338", "Dakar", |
109
|
|
|
|
|
|
|
"2213398", "Outside\ Dakar", |
110
|
|
|
|
|
|
|
"2213399", "Outside\ Dakar",}; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub new { |
113
|
19
|
|
|
19
|
1
|
45
|
my $class = shift; |
114
|
19
|
|
|
|
|
39
|
my $number = shift; |
115
|
19
|
|
|
|
|
128
|
$number =~ s/(^\+221|\D)//g; |
116
|
19
|
|
|
|
|
124
|
my $self = bless({ country_code => '221', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
117
|
19
|
100
|
|
|
|
106
|
return $self->is_valid() ? $self : undef; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
1; |