phony 2.20.14 → 2.20.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phony/config.rb +25 -26
- data/lib/phony/countries/argentina.rb +311 -314
- data/lib/phony/countries/austria.rb +71 -72
- data/lib/phony/countries/bangladesh.rb +27 -28
- data/lib/phony/countries/belarus.rb +110 -111
- data/lib/phony/countries/brazil.rb +92 -92
- data/lib/phony/countries/cambodia.rb +9 -9
- data/lib/phony/countries/china.rb +22 -21
- data/lib/phony/countries/croatia.rb +6 -5
- data/lib/phony/countries/georgia.rb +84 -84
- data/lib/phony/countries/germany.rb +4067 -4068
- data/lib/phony/countries/guinea.rb +8 -8
- data/lib/phony/countries/india.rb +31 -34
- data/lib/phony/countries/indonesia.rb +57 -46
- data/lib/phony/countries/ireland.rb +4 -5
- data/lib/phony/countries/italy.rb +54 -53
- data/lib/phony/countries/japan.rb +456 -456
- data/lib/phony/countries/kyrgyzstan.rb +109 -109
- data/lib/phony/countries/latvia.rb +34 -34
- data/lib/phony/countries/libya.rb +106 -106
- data/lib/phony/countries/malaysia.rb +12 -12
- data/lib/phony/countries/moldova.rb +42 -42
- data/lib/phony/countries/montenegro.rb +24 -20
- data/lib/phony/countries/myanmar.rb +39 -39
- data/lib/phony/countries/namibia.rb +35 -29
- data/lib/phony/countries/nepal.rb +60 -62
- data/lib/phony/countries/netherlands.rb +13 -13
- data/lib/phony/countries/pakistan.rb +134 -110
- data/lib/phony/countries/paraguay.rb +135 -135
- data/lib/phony/countries/russia_kazakhstan_abkhasia_south_ossetia.rb +125 -128
- data/lib/phony/countries/saudi_arabia.rb +5 -5
- data/lib/phony/countries/serbia.rb +47 -39
- data/lib/phony/countries/somalia.rb +18 -18
- data/lib/phony/countries/south_korea.rb +16 -13
- data/lib/phony/countries/sweden.rb +28 -28
- data/lib/phony/countries/taiwan.rb +20 -19
- data/lib/phony/countries/tajikistan.rb +70 -70
- data/lib/phony/countries/turkmenistan.rb +65 -65
- data/lib/phony/countries/ukraine.rb +607 -607
- data/lib/phony/countries/united_kingdom.rb +66 -66
- data/lib/phony/countries/uruguay.rb +40 -41
- data/lib/phony/countries/vietnam.rb +18 -17
- data/lib/phony/countries/zimbabwe.rb +31 -31
- data/lib/phony/countries.rb +440 -443
- data/lib/phony/country.rb +42 -44
- data/lib/phony/country_codes.rb +61 -60
- data/lib/phony/dsl.rb +23 -26
- data/lib/phony/local_splitters/fixed.rb +20 -29
- data/lib/phony/local_splitters/regex.rb +28 -31
- data/lib/phony/national_code.rb +7 -10
- data/lib/phony/national_splitters/default.rb +9 -11
- data/lib/phony/national_splitters/dsl.rb +8 -18
- data/lib/phony/national_splitters/fixed.rb +11 -14
- data/lib/phony/national_splitters/none.rb +7 -11
- data/lib/phony/national_splitters/regex.rb +13 -17
- data/lib/phony/national_splitters/variable.rb +36 -38
- data/lib/phony/trunk_code.rb +16 -18
- data/lib/phony/vanity.rb +12 -13
- data/lib/phony.rb +84 -84
- metadata +5 -39
- data/spec/functional/config_spec.rb +0 -44
- data/spec/functional/plausibility_spec.rb +0 -689
- data/spec/lib/phony/countries_spec.rb +0 -1460
- data/spec/lib/phony/country_codes_spec.rb +0 -227
- data/spec/lib/phony/country_spec.rb +0 -104
- data/spec/lib/phony/dsl_spec.rb +0 -28
- data/spec/lib/phony/local_splitters/fixed_spec.rb +0 -56
- data/spec/lib/phony/local_splitters/regex_spec.rb +0 -94
- data/spec/lib/phony/national_code_spec.rb +0 -61
- data/spec/lib/phony/national_splitters/default_spec.rb +0 -34
- data/spec/lib/phony/national_splitters/fixed_spec.rb +0 -45
- data/spec/lib/phony/national_splitters/none_spec.rb +0 -28
- data/spec/lib/phony/national_splitters/regex_spec.rb +0 -23
- data/spec/lib/phony/national_splitters/variable_spec.rb +0 -35
- data/spec/lib/phony/trunk_code_spec.rb +0 -85
- data/spec/lib/phony/vanity_spec.rb +0 -30
- data/spec/lib/phony_spec.rb +0 -70
@@ -5,43 +5,51 @@
|
|
5
5
|
|
6
6
|
Phony.define do
|
7
7
|
country '381',
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
8
|
+
trunk('0') |
|
9
|
+
one_of(%w[800]) >> split(3, 2) | # freephone
|
10
|
+
one_of(%w[808]) >> split(3, 2) | # payphone
|
11
|
+
one_of(%w[677 678]) >> matched_split(
|
12
|
+
/\A\d{4}\z/ => [3],
|
13
|
+
/\A\d+\z/ => [3, 3]
|
14
|
+
) |
|
15
|
+
one_of(%w[230]) >> matched_split(
|
16
|
+
/\A\d{4}\z/ => [4],
|
17
|
+
/\A\d+\z/ => [3, 2]
|
18
|
+
) |
|
19
|
+
one_of(%w[11 21]) >> matched_split(
|
20
|
+
/\A\d{6}\z/ => [3, 3],
|
21
|
+
/\A\d+\z/ => [3, 4]
|
22
|
+
) |
|
23
|
+
one_of(%w[26 31 35]) >> split(3, 3) |
|
24
|
+
one_of(%w[10 12 13 14 15 16 17 18 19 20 22 23 24 25 27 30 32 33 34 36 37]) >> matched_split(
|
25
|
+
/\A\d{5}\z/ => [3, 2],
|
26
|
+
/\A\d+\z/ => [3, 3]
|
27
|
+
) |
|
28
|
+
one_of(%w[72]) >> split(3, 3) | # ISP
|
29
|
+
one_of(%w[60 61 68 69]) >> matched_split(
|
30
|
+
/\A\d{3}\z/ => [3],
|
31
|
+
/\A\d{6}\z/ => [3, 3],
|
32
|
+
/\A\d{7}\z/ => [3, 4],
|
33
|
+
/\A\d+\z/ => [3, 3, 4]
|
34
|
+
) | # mobile, voicemail (mobile)
|
35
|
+
one_of(%w[66 63]) >> matched_split(
|
36
|
+
/\A\d{3}\z/ => [3],
|
37
|
+
/\A\d{6}\z/ => [3, 3],
|
38
|
+
/\A\d{7}\z/ => [3, 4],
|
39
|
+
/\A\d+\z/ => [3, 3, 4]
|
40
|
+
) | # mobile, voicemail (mobile)
|
41
|
+
one_of(%w[62 64 65]) >> matched_split(
|
42
|
+
/\A\d{2}\z/ => [2],
|
43
|
+
/\A\d{3}\z/ => [3],
|
44
|
+
/\A\d{6}\z/ => [3, 3],
|
45
|
+
/\A\d{7}\z/ => [3, 4],
|
46
|
+
/\A\d+\z/ => [3, 3, 4]
|
47
|
+
) | # mobile, voicemail (mobile)
|
48
|
+
one_of(%w[70]) >> split(3, 3) | # universal access
|
49
|
+
one_of(%w[42 78]) >> split(3, 3) | # premium rate
|
50
|
+
one_of(%w[9]) >> split(3, 4) | # premium rate
|
51
|
+
fixed(2) >> matched_split(
|
52
|
+
/\A\d{5}\z/ => [3, 2],
|
53
|
+
/\A\d+\z/ => [3, 3]
|
54
|
+
)
|
47
55
|
end
|
@@ -5,22 +5,22 @@ Phony.define do
|
|
5
5
|
# https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=SO
|
6
6
|
# https://en.wikipedia.org/wiki/Telecommunications_in_Somaliland#Telesom
|
7
7
|
country '252',
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
8
|
+
one_of('88216') >> split(3) | # Thuraya Satellite Telecommunications Company
|
9
|
+
one_of(%w[1034 1043]) >> split(3, 2) | # Hortel
|
10
|
+
one_of(%w[1313]) >> split(3) | # Telcom Somalia
|
11
|
+
one_of(%w[160 161 162 163 164 165 166 167 168]) >> split(2, 2) | # Hortel
|
12
|
+
one_of(%w[200 203 211 212 213 313]) >> split(3) | # Telcom Somalia
|
13
|
+
one_of(%w[201 204 208 210 214]) >> split(2, 2) | # Telcom Somalia
|
14
|
+
one_of(%w[500 501 502 503 504 505 506 507 508 509]) >> split(3, 2) | # mobile NationLink Telecom
|
15
|
+
one_of(%w[523 525 526]) >> split(2, 2) | # Netco
|
16
|
+
match(/\A(61|62|63|64|65|66|67|68|69|90)\d{7}\z/) >> split(3, 4) | # mobile Hormuud, Somtel Mogadishu, Telesom, Hormuud, Somtel, Somtel Puntland, Nationlink Mogadishu, Nationlink Mogadishu, Nationlink, Golis
|
17
|
+
one_of(%w[642 643 644 648 649]) >> split(2, 2) | # Galcom
|
18
|
+
one_of(%w[33 51 52 54 55 56 57 58 59 68 71 76 78 79 88]) >> split(3, 2) |
|
19
|
+
match(/\A(67)\d{5}\z/) >> split(3, 2) | # Golis Telecom Somalia
|
20
|
+
one_of(%w[15 40 42 45 46 60 61 90 91]) >> split(3, 3) | # mobile Somafone, Hortel
|
21
|
+
one_of(%w[18]) >> split(3, 2) | # Hortel
|
22
|
+
one_of(%w[27 28 29 62 63 87]) >> split(2, 2) | # Telcom Somalia, Emir Set
|
23
|
+
one_of(%w[67 69]) >> split(4, 3) | # mobile NationLink Telecom
|
24
|
+
one_of('1') >> split(3, 3) |
|
25
|
+
fixed(1) >> split(3, 3)
|
26
26
|
end
|
@@ -6,24 +6,27 @@
|
|
6
6
|
# https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=KR
|
7
7
|
#
|
8
8
|
|
9
|
-
# TODO 4-digit services, like "unreasonable infringement of livelihood report" number :)
|
9
|
+
# TODO: 4-digit services, like "unreasonable infringement of livelihood report" number :)
|
10
10
|
#
|
11
11
|
|
12
|
-
special = %w
|
13
|
-
|
12
|
+
special = %w[100 101 105 106 107 108 109 111 112 113 114 115 116 117 118 119 120 121 122 123 125 127 128 129 131 132
|
13
|
+
134 141 182 188]
|
14
|
+
# NOTE: was:
|
14
15
|
# mobile = ('10'..'19').to_a
|
15
16
|
# but this was not frozen so easily.
|
16
|
-
mobile = %w
|
17
|
+
mobile = %w[10 11 12 13 14 15 16 17 18 19]
|
17
18
|
|
18
19
|
Phony.define do
|
19
20
|
country '82',
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
trunk('0') |
|
22
|
+
match(/^(#{special.join("|")})$/) >> split(3, 3) | # Special actually don't need to be split – but better err.
|
23
|
+
one_of(*mobile) >> split(4, 4) |
|
24
|
+
one_of('2') >> matched_split(
|
25
|
+
/\A\d{7}\z/ => [3, 4],
|
26
|
+
/\A\d{8}\z/ => [4, 4]
|
27
|
+
) | # Seoul, also includes "services".
|
28
|
+
fixed(2) >> matched_split(
|
29
|
+
/\A\d{7}\z/ => [3, 4],
|
30
|
+
/\A\d{8}\z/ => [4, 4]
|
31
|
+
) # Rest of cities
|
29
32
|
end
|
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
|
12
12
|
ndcs = [
|
13
|
-
|
13
|
+
# '7', # Non-geographic - conflicts with mobile
|
14
14
|
'8', # Stockholm
|
15
15
|
'10', # VOIP
|
16
16
|
'11', # Norrköping
|
@@ -34,47 +34,47 @@ ndcs = [
|
|
34
34
|
'60', # Sundsvall-Timrå
|
35
35
|
'63', # Östersund
|
36
36
|
'90', # Umeå
|
37
|
-
'77'
|
37
|
+
'77' # Dalarna
|
38
38
|
]
|
39
39
|
mobile = [
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
40
|
+
'70', # Mobile
|
41
|
+
'71', # Telematics
|
42
|
+
'72', # Mobile
|
43
|
+
'73', # Mobile
|
44
|
+
'74', # Pagers
|
45
|
+
'76', # Mobile
|
46
|
+
'79' # Mobile
|
47
47
|
]
|
48
48
|
services = [
|
49
|
-
|
50
|
-
|
51
|
-
'11414'
|
49
|
+
'112', # Emergency Service
|
50
|
+
'1177', # Health Care Advice
|
51
|
+
'11414' # Police
|
52
52
|
]
|
53
53
|
service_ndcs = [
|
54
54
|
'99', # Premium Rate
|
55
55
|
'900', # Premium Rate
|
56
56
|
'939', # Premium Rate
|
57
|
-
'944'
|
57
|
+
'944' # Premium Rate
|
58
58
|
]
|
59
59
|
three_digit_service = [
|
60
60
|
'116', # Psychological Help (116 xxx)
|
61
|
-
'118'
|
61
|
+
'118' # Number enquiries (118 xxx)
|
62
62
|
]
|
63
63
|
|
64
64
|
Phony.define do
|
65
65
|
country '46',
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
66
|
+
trunk('0') |
|
67
|
+
match(/^(#{services.join('|')})$/) >> split(0) |
|
68
|
+
one_of(service_ndcs) >> split(3, 3) |
|
69
|
+
match(/^(#{three_digit_service.join('|')})\d{3}$/) >> split(3) |
|
70
|
+
one_of(ndcs + mobile) >> matched_split(
|
71
|
+
/^\d{5}$/ => [3, 2],
|
72
|
+
/^\d{6}$/ => [2, 2, 2],
|
73
|
+
/^\d{7}$/ => [3, 2, 2],
|
74
|
+
/^\d{8}$/ => [3, 2, 3]
|
75
|
+
) |
|
76
|
+
fixed(3) >> matched_split(
|
77
|
+
/^\d{5}$/ => [3, 2],
|
78
|
+
/^\d{6}$/ => [2, 2, 2]
|
79
|
+
)
|
80
80
|
end
|
@@ -6,23 +6,24 @@
|
|
6
6
|
|
7
7
|
Phony.define do
|
8
8
|
country '886',
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
9
|
+
trunk('0') |
|
10
|
+
match(/\A(826)\d{5}\z/) >> split(1, 4) | # 烏坵, start with 0826, plus 5 digits
|
11
|
+
match(/\A(836)\d{5}\z/) >> split(1, 4) | # 馬祖, start with 0836, plus 5 digits
|
12
|
+
match(/\A(82)\d{6}\z/) >> split(2, 4) | # 金門, start with 082, plus 6 digits
|
13
|
+
match(/\A(89)\d{6}\z/) >> split(2, 4) | # 臺東, start with 089, plus 6 digits
|
14
|
+
match(/\A(80\d)\d{6}\z/) >> split(3, 4) | # Toll-free number
|
15
|
+
match(/\A(8)\d{7}\z/) >> split(3, 4) | # 屏東, start with 08, plus 7 digits
|
16
|
+
match(/\A(49)\d{7}\z/) >> split(3, 4) | # 南投, start with 049, plus 7 digits
|
17
|
+
one_of(%w[4]) >> matched_split(
|
18
|
+
/\A\d{7}\z/ => [3, 4], # 彰化, start with 04, plus 7 digits
|
19
|
+
/\A\d+\z/ => [4, 4]
|
20
|
+
)| # 臺中, start with 04, plus 8 digits
|
21
|
+
match(/\A(37)\d{6}\z/) >> split(2, 4) | # 苗栗, start with 037, plus 6 digits
|
22
|
+
match(/\A(3)\d{7}\z/) >> split(3, 4) | # 桃園 新竹 花蓮 宜蘭, start with 03, plus 7 digits
|
23
|
+
match(/\A(5)\d{7}\z/) >> split(3, 4) | # 嘉義 雲林, start with 05, plus 7 digits
|
24
|
+
match(/\A(6)\d{7}\z/) >> split(3, 4) | # 臺南 澎湖, start with 06, plus 7 digits
|
25
|
+
match(/\A(7)\d{7}\z/) >> split(3, 4) | # 高雄, start with 07, plus 7 digits
|
26
|
+
match(/\A(2)\d{8}\z/) >> split(4, 4) | # 臺北, start with 02, plus 8 digits
|
27
|
+
match(/\A(9\d\d)\d{6}\z/) >> split(3, 3) | # mobile phone, start with 09, plus 8 digits, but local usually show 4-3-3.
|
28
|
+
fixed(2) >> split(4, 4) # fallback unknown
|
28
29
|
end
|
@@ -2,78 +2,78 @@
|
|
2
2
|
|
3
3
|
# Tajikistan (Republic of)
|
4
4
|
|
5
|
-
ndcs_with_6_subscriber_digits = %w
|
5
|
+
ndcs_with_6_subscriber_digits = %w[372]
|
6
6
|
|
7
|
-
ndcs_with_5_subscriber_digits = %w
|
8
|
-
3130
|
9
|
-
3131
|
10
|
-
3132
|
11
|
-
3133
|
12
|
-
3134
|
13
|
-
3135
|
14
|
-
3136
|
15
|
-
3137
|
16
|
-
3138
|
17
|
-
3139
|
18
|
-
3141
|
19
|
-
3153
|
20
|
-
3154
|
21
|
-
3155
|
22
|
-
3156
|
23
|
-
3222
|
24
|
-
3240
|
25
|
-
3242
|
26
|
-
3243
|
27
|
-
3245
|
28
|
-
3246
|
29
|
-
3247
|
30
|
-
3248
|
31
|
-
3249
|
32
|
-
3250
|
33
|
-
3251
|
34
|
-
3252
|
35
|
-
3311
|
36
|
-
3312
|
37
|
-
3314
|
38
|
-
3315
|
39
|
-
3316
|
40
|
-
3318
|
41
|
-
3322
|
42
|
-
3422
|
43
|
-
3441
|
44
|
-
3442
|
45
|
-
3443
|
46
|
-
3445
|
47
|
-
3451
|
48
|
-
3452
|
49
|
-
3453
|
50
|
-
3454
|
51
|
-
3455
|
52
|
-
3456
|
53
|
-
3462
|
54
|
-
3464
|
55
|
-
3465
|
56
|
-
3467
|
57
|
-
3475
|
58
|
-
3479
|
59
|
-
3522
|
60
|
-
3551
|
61
|
-
3552
|
62
|
-
3553
|
63
|
-
3554
|
64
|
-
3555
|
65
|
-
3556
|
66
|
-
|
7
|
+
ndcs_with_5_subscriber_digits = %w[
|
8
|
+
3130
|
9
|
+
3131
|
10
|
+
3132
|
11
|
+
3133
|
12
|
+
3134
|
13
|
+
3135
|
14
|
+
3136
|
15
|
+
3137
|
16
|
+
3138
|
17
|
+
3139
|
18
|
+
3141
|
19
|
+
3153
|
20
|
+
3154
|
21
|
+
3155
|
22
|
+
3156
|
23
|
+
3222
|
24
|
+
3240
|
25
|
+
3242
|
26
|
+
3243
|
27
|
+
3245
|
28
|
+
3246
|
29
|
+
3247
|
30
|
+
3248
|
31
|
+
3249
|
32
|
+
3250
|
33
|
+
3251
|
34
|
+
3252
|
35
|
+
3311
|
36
|
+
3312
|
37
|
+
3314
|
38
|
+
3315
|
39
|
+
3316
|
40
|
+
3318
|
41
|
+
3322
|
42
|
+
3422
|
43
|
+
3441
|
44
|
+
3442
|
45
|
+
3443
|
46
|
+
3445
|
47
|
+
3451
|
48
|
+
3452
|
49
|
+
3453
|
50
|
+
3454
|
51
|
+
3455
|
52
|
+
3456
|
53
|
+
3462
|
54
|
+
3464
|
55
|
+
3465
|
56
|
+
3467
|
57
|
+
3475
|
58
|
+
3479
|
59
|
+
3522
|
60
|
+
3551
|
61
|
+
3552
|
62
|
+
3553
|
63
|
+
3554
|
64
|
+
3555
|
65
|
+
3556
|
66
|
+
]
|
67
67
|
|
68
|
-
ndcs_with_3_subscriber_digits = %w
|
68
|
+
ndcs_with_3_subscriber_digits = %w[331700]
|
69
69
|
|
70
70
|
Phony.define do
|
71
71
|
country '992',
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
end
|
72
|
+
trunk('8') |
|
73
|
+
one_of(ndcs_with_3_subscriber_digits) >> split(3) |
|
74
|
+
one_of(ndcs_with_5_subscriber_digits) >> split(3, 2) |
|
75
|
+
one_of(ndcs_with_6_subscriber_digits) >> split(3, 3) |
|
76
|
+
match(/\A(505|9\d\d)\d+\z/) >> split(3, 3) | # mobile
|
77
|
+
one_of(%w[446 474 487]) >> split(3, 3) | # wireless geographic
|
78
|
+
fixed(3) >> split(3, 3)
|
79
|
+
end
|
@@ -4,73 +4,73 @@
|
|
4
4
|
# https://www.numberingplans.com/?page=dialling&sub=areacodes
|
5
5
|
# https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=TM
|
6
6
|
|
7
|
-
ndcs_with_6_subscriber_digits = %w
|
7
|
+
ndcs_with_6_subscriber_digits = %w[12]
|
8
8
|
|
9
|
-
ndcs_with_5_subscriber_digits = %w
|
10
|
-
131
|
11
|
-
132
|
12
|
-
133
|
13
|
-
134
|
14
|
-
135
|
15
|
-
136
|
16
|
-
137
|
17
|
-
138
|
18
|
-
222
|
19
|
-
240
|
20
|
-
241
|
21
|
-
242
|
22
|
-
243
|
23
|
-
245
|
24
|
-
246
|
25
|
-
247
|
26
|
-
248
|
27
|
-
322
|
28
|
-
340
|
29
|
-
343
|
30
|
-
344
|
31
|
-
345
|
32
|
-
346
|
33
|
-
347
|
34
|
-
348
|
35
|
-
349
|
36
|
-
360
|
37
|
-
422
|
38
|
-
431
|
39
|
-
432
|
40
|
-
438
|
41
|
-
440
|
42
|
-
441
|
43
|
-
442
|
44
|
-
443
|
45
|
-
444
|
46
|
-
445
|
47
|
-
446
|
48
|
-
447
|
49
|
-
448
|
50
|
-
449
|
51
|
-
461
|
52
|
-
465
|
53
|
-
522
|
54
|
-
557
|
55
|
-
558
|
56
|
-
559
|
57
|
-
560
|
58
|
-
561
|
59
|
-
564
|
60
|
-
565
|
61
|
-
566
|
62
|
-
568
|
63
|
-
569
|
64
|
-
|
9
|
+
ndcs_with_5_subscriber_digits = %w[
|
10
|
+
131
|
11
|
+
132
|
12
|
+
133
|
13
|
+
134
|
14
|
+
135
|
15
|
+
136
|
16
|
+
137
|
17
|
+
138
|
18
|
+
222
|
19
|
+
240
|
20
|
+
241
|
21
|
+
242
|
22
|
+
243
|
23
|
+
245
|
24
|
+
246
|
25
|
+
247
|
26
|
+
248
|
27
|
+
322
|
28
|
+
340
|
29
|
+
343
|
30
|
+
344
|
31
|
+
345
|
32
|
+
346
|
33
|
+
347
|
34
|
+
348
|
35
|
+
349
|
36
|
+
360
|
37
|
+
422
|
38
|
+
431
|
39
|
+
432
|
40
|
+
438
|
41
|
+
440
|
42
|
+
441
|
43
|
+
442
|
44
|
+
443
|
45
|
+
444
|
46
|
+
445
|
47
|
+
446
|
48
|
+
447
|
49
|
+
448
|
50
|
+
449
|
51
|
+
461
|
52
|
+
465
|
53
|
+
522
|
54
|
+
557
|
55
|
+
558
|
56
|
+
559
|
57
|
+
560
|
58
|
+
561
|
59
|
+
564
|
60
|
+
565
|
61
|
+
566
|
62
|
+
568
|
63
|
+
569
|
64
|
+
]
|
65
65
|
|
66
|
-
ndcs_with_4_subscriber_digits = %w
|
66
|
+
ndcs_with_4_subscriber_digits = %w[1392]
|
67
67
|
|
68
68
|
Phony.define do
|
69
69
|
country '993',
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
end
|
70
|
+
trunk('8') |
|
71
|
+
one_of(ndcs_with_4_subscriber_digits) >> split(4) |
|
72
|
+
one_of(ndcs_with_5_subscriber_digits) >> split(3, 2) |
|
73
|
+
one_of(ndcs_with_6_subscriber_digits) >> split(3, 3) |
|
74
|
+
one_of('6') >> split(3, 4) | # mobile
|
75
|
+
fixed(3) >> split(3, 2)
|
76
|
+
end
|