phonelib 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/data/extended_data.dat +0 -0
  3. data/data/libphonenumber/README.md +3 -3
  4. data/data/libphonenumber/codereview.settings +1 -1
  5. data/data/libphonenumber/cpp/CMakeLists.txt +6 -1
  6. data/data/libphonenumber/cpp/README +3 -3
  7. data/data/libphonenumber/cpp/src/phonenumbers/asyoutypeformatter.cc +7 -0
  8. data/data/libphonenumber/cpp/src/phonenumbers/base/logging.h +4 -0
  9. data/data/libphonenumber/cpp/src/phonenumbers/lite_metadata.cc +8830 -8807
  10. data/data/libphonenumber/cpp/src/phonenumbers/metadata.cc +11576 -11552
  11. data/data/libphonenumber/cpp/test/phonenumbers/asyoutypeformatter_test.cc +2 -2
  12. data/data/libphonenumber/cpp/test/phonenumbers/geocoding/area_code_map_test.cc +4 -4
  13. data/data/libphonenumber/cpp/test/phonenumbers/geocoding/geocoding_test_program.cc +1 -0
  14. data/data/libphonenumber/cpp/test/phonenumbers/geocoding/phonenumber_offline_geocoder_test.cc +4 -4
  15. data/data/libphonenumber/cpp/test/phonenumbers/phonenumberutil_test.cc +1 -1
  16. data/data/libphonenumber/debian/control +3 -3
  17. data/data/libphonenumber/debian/copyright +1 -1
  18. data/data/libphonenumber/debian/watch +1 -1
  19. data/data/libphonenumber/java/carrier/pom.xml +1 -1
  20. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/225_en +0 -0
  21. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/233_en +0 -0
  22. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/677_en +0 -0
  23. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/973_en +0 -0
  24. data/data/libphonenumber/java/demo/war/phonenumberparser.jsp +1 -1
  25. data/data/libphonenumber/java/geocoder/pom.xml +1 -1
  26. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1418_en +0 -0
  27. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1438_en +0 -0
  28. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1450_en +0 -0
  29. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1514_en +0 -0
  30. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1819_en +0 -0
  31. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/64_en +0 -0
  32. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/86_en +0 -0
  33. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/86_zh +0 -0
  34. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/config +0 -0
  35. data/data/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/timezones/data/map_data +0 -0
  36. data/data/libphonenumber/java/internal/prefixmapper/pom.xml +1 -1
  37. data/data/libphonenumber/java/libphonenumber/pom.xml +1 -1
  38. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java +5 -0
  39. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AR +0 -0
  40. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BH +0 -0
  41. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BY +0 -0
  42. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CI +0 -0
  43. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CN +0 -0
  44. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GH +0 -0
  45. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KR +0 -0
  46. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KW +0 -0
  47. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LU +0 -0
  48. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ME +0 -0
  49. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NZ +0 -0
  50. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SB +0 -0
  51. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_WS +0 -0
  52. data/data/libphonenumber/java/libphonenumber/test/com/google/i18n/phonenumbers/AsYouTypeFormatterTest.java +2 -2
  53. data/data/libphonenumber/java/release_notes.txt +11 -1
  54. data/data/libphonenumber/javascript/README +5 -3
  55. data/data/libphonenumber/javascript/i18n/phonenumbers/asyoutypeformatter.js +5 -0
  56. data/data/libphonenumber/javascript/i18n/phonenumbers/asyoutypeformatter_test.js +2 -2
  57. data/data/libphonenumber/javascript/i18n/phonenumbers/demo-compiled.js +115 -115
  58. data/data/libphonenumber/javascript/i18n/phonenumbers/demo.html +1 -1
  59. data/data/libphonenumber/javascript/i18n/phonenumbers/metadata.js +38 -32
  60. data/data/libphonenumber/javascript/i18n/phonenumbers/metadatalite.js +37 -31
  61. data/data/libphonenumber/javascript/i18n/phonenumbers/phonemetadata.pb.js +401 -241
  62. data/data/libphonenumber/javascript/i18n/phonenumbers/phonenumber.pb.js +66 -50
  63. data/data/libphonenumber/resources/PhoneNumberMetadata.xml +196 -95
  64. data/data/libphonenumber/resources/carrier/en/225.txt +1 -0
  65. data/data/libphonenumber/resources/carrier/en/233.txt +3 -1
  66. data/data/libphonenumber/resources/carrier/en/27.txt +1 -1
  67. data/data/libphonenumber/resources/carrier/en/677.txt +1 -0
  68. data/data/libphonenumber/resources/carrier/en/679.txt +2 -2
  69. data/data/libphonenumber/resources/carrier/en/973.txt +1 -0
  70. data/data/libphonenumber/resources/geocoding/en/1.txt +5 -5
  71. data/data/libphonenumber/resources/geocoding/en/64.txt +124 -0
  72. data/data/libphonenumber/resources/geocoding/en/86.txt +1 -3
  73. data/data/libphonenumber/resources/geocoding/zh/86.txt +1 -3
  74. data/data/libphonenumber/resources/timezones/map_data.txt +195 -101
  75. data/data/libphonenumber/tools/java/data/webapp/index.html +1 -1
  76. data/data/libphonenumber/tools/java/java-build/src/com/google/i18n/phonenumbers/BuildMetadataJsonFromXml.java +8 -0
  77. data/data/phone_data.dat +0 -0
  78. data/lib/phonelib/version.rb +1 -1
  79. metadata +4 -2
@@ -35,7 +35,7 @@ goog.require('goog.proto2.Message');
35
35
  * @extends {goog.proto2.Message}
36
36
  */
37
37
  i18n.phonenumbers.PhoneNumber = function() {
38
- goog.proto2.Message.apply(this);
38
+ goog.proto2.Message.call(this);
39
39
  };
40
40
  goog.inherits(i18n.phonenumbers.PhoneNumber, goog.proto2.Message);
41
41
 
@@ -468,53 +468,69 @@ i18n.phonenumbers.PhoneNumber.CountryCodeSource = {
468
468
  };
469
469
 
470
470
 
471
- goog.proto2.Message.set$Metadata(i18n.phonenumbers.PhoneNumber, {
472
- 0: {
473
- name: 'PhoneNumber',
474
- fullName: 'i18n.phonenumbers.PhoneNumber'
475
- },
476
- 1: {
477
- name: 'country_code',
478
- required: true,
479
- fieldType: goog.proto2.Message.FieldType.INT32,
480
- type: Number
481
- },
482
- 2: {
483
- name: 'national_number',
484
- required: true,
485
- fieldType: goog.proto2.Message.FieldType.UINT64,
486
- type: Number
487
- },
488
- 3: {
489
- name: 'extension',
490
- fieldType: goog.proto2.Message.FieldType.STRING,
491
- type: String
492
- },
493
- 4: {
494
- name: 'italian_leading_zero',
495
- fieldType: goog.proto2.Message.FieldType.BOOL,
496
- type: Boolean
497
- },
498
- 8: {
499
- name: 'number_of_leading_zeros',
500
- fieldType: goog.proto2.Message.FieldType.INT32,
501
- defaultValue: 1,
502
- type: Number
503
- },
504
- 5: {
505
- name: 'raw_input',
506
- fieldType: goog.proto2.Message.FieldType.STRING,
507
- type: String
508
- },
509
- 6: {
510
- name: 'country_code_source',
511
- fieldType: goog.proto2.Message.FieldType.ENUM,
512
- defaultValue: i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN,
513
- type: i18n.phonenumbers.PhoneNumber.CountryCodeSource
514
- },
515
- 7: {
516
- name: 'preferred_domestic_carrier_code',
517
- fieldType: goog.proto2.Message.FieldType.STRING,
518
- type: String
471
+ /** @override */
472
+ i18n.phonenumbers.PhoneNumber.prototype.getDescriptor = function() {
473
+ if (!i18n.phonenumbers.PhoneNumber.descriptor_) {
474
+ // The descriptor is created lazily when we instantiate a new instance.
475
+ var descriptorObj = {
476
+ 0: {
477
+ name: 'PhoneNumber',
478
+ fullName: 'i18n.phonenumbers.PhoneNumber'
479
+ },
480
+ 1: {
481
+ name: 'country_code',
482
+ required: true,
483
+ fieldType: goog.proto2.Message.FieldType.INT32,
484
+ type: Number
485
+ },
486
+ 2: {
487
+ name: 'national_number',
488
+ required: true,
489
+ fieldType: goog.proto2.Message.FieldType.UINT64,
490
+ type: Number
491
+ },
492
+ 3: {
493
+ name: 'extension',
494
+ fieldType: goog.proto2.Message.FieldType.STRING,
495
+ type: String
496
+ },
497
+ 4: {
498
+ name: 'italian_leading_zero',
499
+ fieldType: goog.proto2.Message.FieldType.BOOL,
500
+ type: Boolean
501
+ },
502
+ 8: {
503
+ name: 'number_of_leading_zeros',
504
+ fieldType: goog.proto2.Message.FieldType.INT32,
505
+ defaultValue: 1,
506
+ type: Number
507
+ },
508
+ 5: {
509
+ name: 'raw_input',
510
+ fieldType: goog.proto2.Message.FieldType.STRING,
511
+ type: String
512
+ },
513
+ 6: {
514
+ name: 'country_code_source',
515
+ fieldType: goog.proto2.Message.FieldType.ENUM,
516
+ defaultValue: i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN,
517
+ type: i18n.phonenumbers.PhoneNumber.CountryCodeSource
518
+ },
519
+ 7: {
520
+ name: 'preferred_domestic_carrier_code',
521
+ fieldType: goog.proto2.Message.FieldType.STRING,
522
+ type: String
523
+ }
524
+ };
525
+ i18n.phonenumbers.PhoneNumber.descriptor_ =
526
+ goog.proto2.Message.createDescriptor(
527
+ i18n.phonenumbers.PhoneNumber, descriptorObj);
519
528
  }
520
- });
529
+ return i18n.phonenumbers.PhoneNumber.descriptor_;
530
+ };
531
+
532
+
533
+ // Export getDescriptor static function robust to minification.
534
+ i18n.phonenumbers.PhoneNumber['ctor'] = i18n.phonenumbers.PhoneNumber;
535
+ i18n.phonenumbers.PhoneNumber['ctor'].getDescriptor =
536
+ i18n.phonenumbers.PhoneNumber.prototype.getDescriptor;
@@ -688,8 +688,8 @@
688
688
  -->
689
689
  <territory id="AR" countryCode="54" internationalPrefix="00" nationalPrefix="0"
690
690
  nationalPrefixForParsing="
691
- 0?(?:
692
- (11|
691
+ 0?(?:(
692
+ 11|
693
693
  2(?:
694
694
  2(?:
695
695
  02?|
@@ -741,7 +741,7 @@
741
741
  8[2578]
742
742
  )|
743
743
  4(?:
744
- 0[124-9]|
744
+ 0[0-24-9]|
745
745
  [12]|
746
746
  3[5-8]?|
747
747
  4[24-7]|
@@ -762,12 +762,12 @@
762
762
  )|
763
763
  6[24]|
764
764
  7(?:
765
+ [069]|
765
766
  1[1568]|
766
767
  2[15]|
767
768
  3[145]|
768
769
  4[13]|
769
770
  5[14-8]|
770
- [069]|
771
771
  7[2-57]|
772
772
  8[126]
773
773
  )|
@@ -783,8 +783,7 @@
783
783
  9[124]
784
784
  )
785
785
  )
786
- )?15
787
- )?"
786
+ )?15)?"
788
787
  nationalPrefixTransformRule="9$1" nationalPrefixFormattingRule="$NP$FG"
789
788
  mobileNumberPortableRegion="true">
790
789
  <references>
@@ -792,6 +791,8 @@
792
791
  <!-- On the following link, click on Indicativos Interurbanos to access detailed
793
792
  information. -->
794
793
  <sourceUrl>http://www.cnc.gov.ar/infotecnica/numeracion/Index.asp</sourceUrl>
794
+ <!-- Download XLS spreadsheet from "Númeración Geográfica" link on following page: -->
795
+ <sourceUrl>http://www.cnc.gob.ar/asignaciones-a-la-fecha_p445</sourceUrl>
795
796
  <sourceUrl>http://en.wikipedia.org/wiki/+54</sourceUrl>
796
797
  </references>
797
798
  <availableFormats>
@@ -823,14 +824,40 @@
823
824
  <intlFormat>$1 $2 $3-$4</intlFormat>
824
825
  </numberFormat>
825
826
  <numberFormat pattern="(9)(\d{3})(\d{3})(\d{4})">
826
- <!-- Some 4-digit area codes actually are caught by this rule. Preference is given however
827
- to the 3-digit area codes, since they are considerably larger communities. -->
827
+ <!-- The regular expressions below were generated semi-automatically from data extracted
828
+ from the XLS spreadsheet downloaded from the "Númeración Geográfica" link cited
829
+ above. Each pattern captures all 3-3-4 prefixes for its length, but may also capture
830
+ some 4-2-4 cases.
831
+
832
+ In cases where a range contains both 3-3-4 and 4-2-4 prefixes, the most commonly used
833
+ one should be considered the default.
834
+ * If there are more distinct 4-2-4 prefixes, then the regular expression should
835
+ INCLUDE only the explicitly mentioned 3-3-4 prefixes.
836
+ * If there are more distinct 3-3-4 prefixes, then the regular expression should
837
+ EXCLUDE only the explicitly mentioned 4-2-4 prefixes.
838
+ This should help maximize the chances of new ranges automatically being assigned to
839
+ the right form.
840
+
841
+ In the final (most specific) regular expression, the few remaining ambiguous cases
842
+ are decided by comparing usage counts. Any manual edits to these expressions not
843
+ reflected in the XLS spreadsheet must be clearly called out below:
844
+
845
+ Added Manually as 3-3-4 format:
846
+ * 2981 (General Roca, Río Negro) : Numbers found online suggest 3-3-4
847
+
848
+ See also:
849
+ https://github.com/googlei18n/libphonenumber/issues/611
850
+ https://github.com/googlei18n/libphonenumber/issues/559
851
+ -->
852
+ <!-- Do NOT copy this into the section below. Removing the leading '9' will make it match
853
+ only 2 digits and the first <leadingDigits> section must always match 3 digits. -->
828
854
  <leadingDigits>
829
855
  9(?:
830
856
  2[234689]|
831
857
  3[3-8]
832
858
  )
833
859
  </leadingDigits>
860
+ <!-- If modified, copy this expression into the section below, minus the leading '9' -->
834
861
  <leadingDigits>
835
862
  9(?:
836
863
  2(?:
@@ -843,7 +870,7 @@
843
870
  )|
844
871
  3(?:
845
872
  36|
846
- 4[12358]|
873
+ 4[1-358]|
847
874
  5[138]|
848
875
  6[24]|
849
876
  7[069]|
@@ -851,37 +878,67 @@
851
878
  )
852
879
  )
853
880
  </leadingDigits>
854
- <!-- We exclude here several 294X four-digit area codes: 2940, 2942, 2945, 2946 and 2948,
855
- 298[23], and several 38[3578]X four-digit area codes. -->
881
+ <!-- Note that some patterns appear as both 3 and 4 digit area codes. In these cases
882
+ (to avoid going to 6 digits of discrimination) we simply pick the one with the
883
+ most uses. Patterns excluded from this expression will be treated as 4-2-4:
884
+ - XXXX (usage count as 3-digit code:usage count as 4-digit code)
885
+ - 2646 (7:15) - excluded
886
+ - 3435 (39:63) - excluded
887
+ - 3436 (16:54) - excluded
888
+ - 3454 (90:48)
889
+ - 3455 (13:94) - excluded
890
+ - 3456 (3:93) - excluded
891
+ - 3584 (143:65)
892
+ - 3585 (21:42) - excluded
893
+ - 3854 (115:73)
894
+ - 3855 (76:40)
895
+ - 3856 (19:44) - excluded
896
+ - 3876 (56:99) - excluded
897
+ - 3885 (120:45)
898
+ - 3886 (3:137) - excluded
899
+ -->
900
+ <!-- If modified, copy this expression into the section below, minus the leading '9' -->
856
901
  <leadingDigits>
857
902
  9(?:
858
903
  2(?:
859
- 2[013]|
860
- 3[067]|
904
+ 2(?:
905
+ 0[013-9]|
906
+ [13]
907
+ )|
908
+ 3(?:
909
+ 0[013-9]|
910
+ [67]
911
+ )|
861
912
  49|
862
- 6[01346]|
863
- 80|
913
+ 6(?:
914
+ [0136]|
915
+ 4[0-59]
916
+ )|
917
+ 8|
864
918
  9(?:
865
- [179]|
866
- 4[13479]|
867
- 8[014-9]
919
+ [19]|
920
+ 44|
921
+ 7[013-9]|
922
+ 8[14]
868
923
  )
869
924
  )|
870
925
  3(?:
871
926
  36|
872
- 4[12358]|
927
+ 4(?:
928
+ [12]|
929
+ [358]4
930
+ )|
873
931
  5(?:
874
- [18]|
875
- 3[014-689]
932
+ 1|
933
+ 3[0-24-689]|
934
+ 8[46]
876
935
  )|
877
- 6[24]|
936
+ 6|
878
937
  7[069]|
879
938
  8(?:
880
939
  [01]|
881
- 3[013469]|
882
- 5[0-39]|
883
- 7[0-2459]|
884
- 8[0-49]
940
+ 34|
941
+ [578][45]
885
942
  )
886
943
  )
887
944
  )
@@ -902,6 +959,7 @@
902
959
  </numberFormat>
903
960
  <!-- These patterns are a copy of the mobile patterns with the leading 9 removed. -->
904
961
  <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
962
+ <!-- Never modify this manually, always copy from above and remove leading '9' -->
905
963
  <leadingDigits>
906
964
  2(?:
907
965
  2[013]|
@@ -913,43 +971,54 @@
913
971
  )|
914
972
  3(?:
915
973
  36|
916
- 4[12358]|
974
+ 4[1-358]|
917
975
  5[138]|
918
976
  6[24]|
919
977
  7[069]|
920
978
  8[013578]
921
979
  )
922
980
  </leadingDigits>
923
- <!-- We exclude here several 294X four-digit area codes: 2940, 2942, 2945, 2946 and 2948,
924
- 298[23], and several 38[3578]X four-digit area codes. -->
981
+ <!-- Never modify this manually, always copy from above and remove leading '9' -->
925
982
  <leadingDigits>
926
983
  2(?:
927
- 2[013]|
928
- 3[067]|
984
+ 2(?:
985
+ 0[013-9]|
986
+ [13]
987
+ )|
988
+ 3(?:
989
+ 0[013-9]|
990
+ [67]
991
+ )|
929
992
  49|
930
- 6[01346]|
931
- 80|
993
+ 6(?:
994
+ [0136]|
995
+ 4[0-59]
996
+ )|
997
+ 8|
932
998
  9(?:
933
- [179]|
934
- 4[13479]|
935
- 8[014-9]
999
+ [19]|
1000
+ 44|
1001
+ 7[013-9]|
1002
+ 8[14]
936
1003
  )
937
1004
  )|
938
1005
  3(?:
939
1006
  36|
940
- 4[12358]|
1007
+ 4(?:
1008
+ [12]|
1009
+ [358]4
1010
+ )|
941
1011
  5(?:
942
- [18]|
943
- 3[0-689]
1012
+ 1|
1013
+ 3[0-24-689]|
1014
+ 8[46]
944
1015
  )|
945
- 6[24]|
1016
+ 6|
946
1017
  7[069]|
947
1018
  8(?:
948
1019
  [01]|
949
- 3[013469]|
950
- 5[0-39]|
951
- 7[0-2459]|
952
- 8[0-49]
1020
+ 34|
1021
+ [578][45]
953
1022
  )
954
1023
  )
955
1024
  </leadingDigits>
@@ -2634,7 +2703,7 @@
2634
2703
  <nationalNumberPattern>
2635
2704
  (?:
2636
2705
  1(?:
2637
- 3[13-6]|
2706
+ 3[1356]|
2638
2707
  6[0156]|
2639
2708
  7\d
2640
2709
  )\d|
@@ -2645,28 +2714,30 @@
2645
2714
  0\d|
2646
2715
  3[12]|
2647
2716
  44|
2648
- 88
2717
+ 7[7-9]
2649
2718
  )|
2650
2719
  9[69][69]
2651
2720
  )|
2652
2721
  7(?:
2653
- 7\d{2}|
2654
- 178
2722
+ 1(?:
2723
+ 11|
2724
+ 78
2725
+ )|
2726
+ 7\d{2}
2655
2727
  )
2656
2728
  )\d{4}
2657
2729
  </nationalNumberPattern>
2658
2730
  <exampleNumber>17001234</exampleNumber>
2659
2731
  </fixedLine>
2660
2732
  <!-- 31 is assigned to Royal Court, as per documents on Bahrain's own telecom site, even
2661
- though it is omitted from the ITU document. 356 was added based on numbers found
2662
- online. -->
2733
+ though it is omitted from the ITU document. -->
2663
2734
  <mobile>
2664
2735
  <nationalNumberPattern>
2665
2736
  (?:
2666
2737
  3(?:
2667
2738
  [1-4679]\d|
2668
- 5[01356]|
2669
- 8[0-48]
2739
+ 5[013569]|
2740
+ 8[0-47-9]
2670
2741
  )\d|
2671
2742
  6(?:
2672
2743
  3(?:
@@ -2676,7 +2747,8 @@
2676
2747
  )|
2677
2748
  6(?:
2678
2749
  [69]\d|
2679
- 3[03-9]
2750
+ 3[03-9]|
2751
+ 7[0-6]
2680
2752
  )
2681
2753
  )
2682
2754
  )\d{4}
@@ -3641,6 +3713,12 @@
3641
3713
  <possibleNumberPattern>\d{10}</possibleNumberPattern>
3642
3714
  <exampleNumber>9021234567</exampleNumber>
3643
3715
  </premiumRate>
3716
+ <voip>
3717
+ <!-- 249 prefix for Beltelcom's Maxiphone added based on online info. -->
3718
+ <nationalNumberPattern>249\d{6}</nationalNumberPattern>
3719
+ <possibleNumberPattern>\d{9}</possibleNumberPattern>
3720
+ <exampleNumber>249123456</exampleNumber>
3721
+ </voip>
3644
3722
  </territory>
3645
3723
 
3646
3724
  <!-- Belize -->
@@ -4174,7 +4252,7 @@
4174
4252
  4[0-24-9]|
4175
4253
  5[4-9]|
4176
4254
  6[015-79]|
4177
- 7[57]
4255
+ 7[578]
4178
4256
  )\d{6}
4179
4257
  </nationalNumberPattern>
4180
4258
  <exampleNumber>01234567</exampleNumber>
@@ -4431,9 +4509,11 @@
4431
4509
  </territory>
4432
4510
 
4433
4511
  <!-- China -->
4434
- <territory id="CN" countryCode="86" internationalPrefix="(1[1279]\d{3})?00"
4512
+ <!-- The international/national prefix patterns must not collide with valid prefixes such
4513
+ as 170, 176, 177 and 178. 179XX00 is a valid calling prefix, see: www.chahaoba.com/179 -->
4514
+ <territory id="CN" countryCode="86" internationalPrefix="(1(?:[129]\d{3}|79\d{2}))?00"
4435
4515
  preferredInternationalPrefix="00" nationalPrefix="0"
4436
- nationalPrefixForParsing="(1[1279]\d{3})|0">
4516
+ nationalPrefixForParsing="(1(?:[129]\d{3}|79\d{2}))|0">
4437
4517
  <references>
4438
4518
  <sourceUrl>http://www.itu.int/oth/T020200002B/en</sourceUrl>
4439
4519
  </references>
@@ -4573,7 +4653,7 @@
4573
4653
  91
4574
4654
  )|
4575
4655
  8(?:
4576
- 71|
4656
+ [57]1|
4577
4657
  98
4578
4658
  )
4579
4659
  </leadingDigits>
@@ -4625,7 +4705,7 @@
4625
4705
  1[236-8]|
4626
4706
  2[5-7]|
4627
4707
  3|
4628
- 5[1-9]|
4708
+ 5[4-9]|
4629
4709
  7[02-9]|
4630
4710
  8[3678]|
4631
4711
  9[1-7]
@@ -4650,12 +4730,16 @@
4650
4730
  <leadingDigits>10800</leadingDigits>
4651
4731
  <format>$1 $2 $3</format>
4652
4732
  </numberFormat>
4733
+ <numberFormat pattern="(\d{3})(\d{7,8})">
4734
+ <leadingDigits>950</leadingDigits>
4735
+ <format>$1 $2</format>
4736
+ </numberFormat>
4653
4737
  </availableFormats>
4654
4738
  <generalDesc>
4655
4739
  <nationalNumberPattern>
4656
4740
  [1-7]\d{6,11}|
4657
4741
  8[0-357-9]\d{6,9}|
4658
- 9\d{7,9}
4742
+ 9\d{7,10}
4659
4743
  </nationalNumberPattern>
4660
4744
  <possibleNumberPattern>\d{4,12}</possibleNumberPattern>
4661
4745
  </generalDesc>
@@ -4666,7 +4750,8 @@
4666
4750
  (?:
4667
4751
  10
4668
4752
  )?8
4669
- )00\d{7}
4753
+ )00\d{7}|
4754
+ 950\d{7,8}
4670
4755
  </nationalNumberPattern>
4671
4756
  <possibleNumberPattern>\d{10,12}</possibleNumberPattern>
4672
4757
  <exampleNumber>4001234567</exampleNumber>
@@ -4712,7 +4797,7 @@
4712
4797
  91
4713
4798
  )|
4714
4799
  8(?:
4715
- 71|
4800
+ [57]1|
4716
4801
  98
4717
4802
  )
4718
4803
  )(?:
@@ -4766,7 +4851,7 @@
4766
4851
  1[236-8]|
4767
4852
  2[5-7]|
4768
4853
  3\d|
4769
- 5[1-9]|
4854
+ 5[4-9]|
4770
4855
  7[02-9]|
4771
4856
  8[3678]|
4772
4857
  9[1-7]
@@ -4830,6 +4915,7 @@
4830
4915
  based on online searches. -->
4831
4916
  <nationalNumberPattern>
4832
4917
  400\d{7}|
4918
+ 950\d{7,8}|
4833
4919
  (?:
4834
4920
  10|
4835
4921
  2[0-57-9]|
@@ -4871,7 +4957,7 @@
4871
4957
  1[236-8]|
4872
4958
  2[5-7]|
4873
4959
  [37]\d|
4874
- 5[1-9]|
4960
+ 5[14-9]|
4875
4961
  8[3678]|
4876
4962
  9[1-8]
4877
4963
  )|
@@ -4884,7 +4970,7 @@
4884
4970
  )
4885
4971
  )96\d{3,4}
4886
4972
  </nationalNumberPattern>
4887
- <possibleNumberPattern>\d{7,10}</possibleNumberPattern>
4973
+ <possibleNumberPattern>\d{7,11}</possibleNumberPattern>
4888
4974
  <exampleNumber>4001234567</exampleNumber>
4889
4975
  </sharedCost>
4890
4976
  </territory>
@@ -8259,7 +8345,7 @@
8259
8345
  2[034678]\d|
8260
8346
  5(?:
8261
8347
  [047]\d|
8262
- 54|
8348
+ 5[3-6]|
8263
8349
  6[01]
8264
8350
  )
8265
8351
  )\d{6}
@@ -10599,7 +10685,7 @@
10599
10685
  numbers. It seems almost impossible to know for some of these numbers whether they are
10600
10686
  land-line or mobile, since the ranges overlap. Extra prefixes added: 7601, 768[567],
10601
10687
  7695, 8299, 8309. New prefixes were also added based on the document provided from
10602
- mobile carriers: https://code.google.com/p/libphonenumber/issues/detail?id=260 -->
10688
+ mobile carriers: https://github.com/googlei18n/libphonenumber/issues/260 -->
10603
10689
  <nationalNumberPattern>
10604
10690
  (?:
10605
10691
  7(?:
@@ -13425,7 +13511,7 @@
13425
13511
  <mobile>
13426
13512
  <nationalNumberPattern>1[0-26-9]\d{7,8}</nationalNumberPattern>
13427
13513
  <possibleNumberPattern>\d{9,10}</possibleNumberPattern>
13428
- <exampleNumber>1023456789</exampleNumber>
13514
+ <exampleNumber>1000000000</exampleNumber>
13429
13515
  </mobile>
13430
13516
  <pager>
13431
13517
  <nationalNumberPattern>15\d{7,8}</nationalNumberPattern>
@@ -13531,7 +13617,7 @@
13531
13617
  (?:
13532
13618
  5(?:
13533
13619
  [05]\d|
13534
- 1[0-6]
13620
+ 1[0-7]
13535
13621
  )|
13536
13622
  6(?:
13537
13623
  0[034679]|
@@ -13546,7 +13632,7 @@
13546
13632
  55|
13547
13633
  6[069]|
13548
13634
  [79]\d|
13549
- 8[089]
13635
+ 8[07-9]
13550
13636
  )
13551
13637
  )\d{5}
13552
13638
  </nationalNumberPattern>
@@ -14551,12 +14637,12 @@
14551
14637
  <!-- Even though 20 is listed in the fixed-line plan, other documentation clarify that it is
14552
14638
  for VOIP. Furthermore, even though the plan says that numbers beginning with 2[346-8]
14553
14639
  must be exactly 8 digits, from information found online it seems that they can actually
14554
- be 6 (but not 7) digits long. -->
14640
+ be 6 or 7 digits long. -->
14555
14641
  <nationalNumberPattern>
14556
14642
  (?:
14557
14643
  2(?:
14558
14644
  [259]\d{2,9}|
14559
- [346-8]\d{4}(?:\d{2})?
14645
+ [346-8]\d{4,6}
14560
14646
  )|
14561
14647
  (?:
14562
14648
  [3457]\d{2}|
@@ -14997,6 +15083,10 @@
14997
15083
  </territory>
14998
15084
 
14999
15085
  <!-- Montenegro -->
15086
+ <!-- According to EKIP, the detailed phone number assignments are published on their
15087
+ website (regulation:
15088
+ http://www.ekip.me/download/Law%20on%20Electronic%20Communications%20(updated)%204.9.2013%20(1)nova%20verzija.pdf
15089
+ ). Thus ITU updates always need to be combined with the information at the below ekip.me source URL. -->
15000
15090
  <territory id="ME" countryCode="382" internationalPrefix="00" nationalPrefix="0"
15001
15091
  nationalPrefixFormattingRule="$NP$FG">
15002
15092
  <references>
@@ -15006,11 +15096,11 @@
15006
15096
  </references>
15007
15097
  <availableFormats>
15008
15098
  <numberFormat pattern="(\d{2})(\d{3})(\d{3})">
15009
- <leadingDigits>[2-57-9]|6[3789]</leadingDigits>
15099
+ <leadingDigits>[2-57-9]|6[036-9]</leadingDigits>
15010
15100
  <leadingDigits>
15011
15101
  [2-57-9]|
15012
15102
  6(?:
15013
- [389]|
15103
+ [03689]|
15014
15104
  7(?:
15015
15105
  [0-8]|
15016
15106
  9[3-9]
@@ -15038,18 +15128,17 @@
15038
15128
  20[2-8]|
15039
15129
  3(?:
15040
15130
  0[2-7]|
15041
- 1[35-7]|
15042
- 2[3567]|
15131
+ [12][35-7]|
15043
15132
  3[4-7]
15044
15133
  )|
15045
15134
  4(?:
15046
- 0[237]|
15047
- 1[27]
15135
+ 0[2367]|
15136
+ 1[267]
15048
15137
  )|
15049
15138
  5(?:
15050
- 0[47]|
15051
- 1[27]|
15052
- 2[378]
15139
+ 0[467]|
15140
+ 1[267]|
15141
+ 2[367]
15053
15142
  )
15054
15143
  )\d{5}
15055
15144
  </nationalNumberPattern>
@@ -15057,11 +15146,13 @@
15057
15146
  <exampleNumber>30234567</exampleNumber>
15058
15147
  </fixedLine>
15059
15148
  <mobile>
15060
- <!-- Mobile numbers start with 632, 67, 68 or 69. -->
15149
+ <!-- Mobile numbers start with 600, 632, 661, 67, 68 or 69. -->
15061
15150
  <nationalNumberPattern>
15062
15151
  6(?:
15152
+ 00\d|
15063
15153
  32\d|
15064
15154
  [89]\d{2}|
15155
+ 61\d|
15065
15156
  7(?:
15066
15157
  [0-8]\d|
15067
15158
  9(?:
@@ -15078,19 +15169,18 @@
15078
15169
  <exampleNumber>67622901</exampleNumber>
15079
15170
  </mobile>
15080
15171
  <tollFree>
15081
- <!-- All toll free numbers have prefix 80 followed by 02 or 08. -->
15082
- <nationalNumberPattern>800[28]\d{4}</nationalNumberPattern>
15172
+ <!-- All toll free numbers have prefix 80. -->
15173
+ <nationalNumberPattern>80\d{6}</nationalNumberPattern>
15083
15174
  <possibleNumberPattern>\d{8}</possibleNumberPattern>
15084
15175
  <exampleNumber>80080002</exampleNumber>
15085
15176
  </tollFree>
15086
15177
  <premiumRate>
15087
- <!-- Numbers with prefix 88, 94 or 95 are services with additional charges. -->
15178
+ <!-- Numbers with prefix 94 or 95 are services with additional charges. -->
15088
15179
  <nationalNumberPattern>
15089
15180
  (?:
15090
- 88\d|
15091
15181
  9(?:
15092
- 4[13-8]|
15093
- 5[16-8]
15182
+ 4[1568]|
15183
+ 5[178]
15094
15184
  )
15095
15185
  )\d{5}
15096
15186
  </nationalNumberPattern>
@@ -15891,7 +15981,7 @@
15891
15981
  </nationalNumberPattern>
15892
15982
  <exampleNumber>35123456</exampleNumber>
15893
15983
  </fixedLine>
15894
- <!-- Added "49\d" in response to https://code.google.com/p/libphonenumber/issues/detail?id=529
15984
+ <!-- Added "49\d" in response to https://github.com/googlei18n/libphonenumber/issues/529
15895
15985
  which might be overly permissive, but we don't have an official documentation for this
15896
15986
  and only a small number of numbers were found online. At least 492 and 495 are valid.
15897
15987
  -->
@@ -17581,7 +17671,8 @@
17581
17671
  <!-- Pattern for fixed-line formats. -->
17582
17672
  <numberFormat pattern="([34679])(\d{3})(\d{4})">
17583
17673
  <leadingDigits>
17584
- [3467]|
17674
+ [346]|
17675
+ 7[2-57-9]|
17585
17676
  9[1-9]
17586
17677
  </leadingDigits>
17587
17678
  <format>$1-$2 $3</format>
@@ -17608,6 +17699,7 @@
17608
17699
  [69]|
17609
17700
  7[0-35-9]
17610
17701
  )|
17702
+ 70|
17611
17703
  86
17612
17704
  </leadingDigits>
17613
17705
  <format>$1 $2 $3</format>
@@ -17641,14 +17733,12 @@
17641
17733
  <possibleNumberPattern>\d{7,11}</possibleNumberPattern>
17642
17734
  </generalDesc>
17643
17735
  <fixedLine>
17644
- <!-- 07 788 was assigned to Voxbox according to
17645
- http://www.nad.org.nz/07GeographicalCodes.php -->
17646
17736
  <nationalNumberPattern>
17647
17737
  (?:
17648
17738
  3[2-79]|
17649
- [49][2-689]|
17739
+ [49][2-9]|
17650
17740
  6[235-9]|
17651
- 7[2-5789]
17741
+ 7[2-57-9]
17652
17742
  )\d{6}|
17653
17743
  24099\d{3}
17654
17744
  </nationalNumberPattern>
@@ -17694,6 +17784,11 @@
17694
17784
  <possibleNumberPattern>\d{9,11}</possibleNumberPattern>
17695
17785
  <exampleNumber>900123456</exampleNumber>
17696
17786
  </premiumRate>
17787
+ <personalNumber>
17788
+ <nationalNumberPattern>70\d{7}</nationalNumberPattern>
17789
+ <possibleNumberPattern>\d{9}</possibleNumberPattern>
17790
+ <exampleNumber>701234567</exampleNumber>
17791
+ </personalNumber>
17697
17792
  </territory>
17698
17793
 
17699
17794
  <!-- Oman -->
@@ -19744,12 +19839,15 @@
19744
19839
  <exampleNumber>40123</exampleNumber>
19745
19840
  </fixedLine>
19746
19841
  <mobile>
19842
+ <!-- The 795 prefix is not in the ITU plan (5.XII.2014), but was added because such a number
19843
+ was dialed successfully. -->
19747
19844
  <nationalNumberPattern>
19748
19845
  48\d{3}|
19749
19846
  7(?:
19847
+ 30|
19750
19848
  [46-8]\d|
19751
19849
  5[025-9]|
19752
- 9[0-4]
19850
+ 9[0-5]
19753
19851
  )\d{4}|
19754
19852
  8[4-8]\d{5}|
19755
19853
  9(?:
@@ -23763,7 +23861,6 @@
23763
23861
  <sourceUrl>http://www.itu.int/oth/T02020000B4/en</sourceUrl>
23764
23862
  </references>
23765
23863
  <availableFormats>
23766
- <!-- Should be formatted in one block, apart from the specific series below. -->
23767
23864
  <numberFormat pattern="(8\d{2})(\d{3,4})">
23768
23865
  <leadingDigits>8</leadingDigits>
23769
23866
  <format>$1 $2</format>
@@ -23772,6 +23869,10 @@
23772
23869
  <leadingDigits>7</leadingDigits>
23773
23870
  <format>$1 $2</format>
23774
23871
  </numberFormat>
23872
+ <numberFormat pattern="(\d{5})">
23873
+ <leadingDigits>[2-6]</leadingDigits>
23874
+ <format>$1</format>
23875
+ </numberFormat>
23775
23876
  </availableFormats>
23776
23877
  <generalDesc>
23777
23878
  <nationalNumberPattern>[2-8]\d{4,6}</nationalNumberPattern>