Browse Source

JAVA/CPP/JS: libphonenumber v5.3, offlinegeocode v2.4

pull/567/head
Lara Scheidegger 13 years ago
committed by Mihaela Rosca
parent
commit
f410828411
52 changed files with 10605 additions and 10259 deletions
  1. +1
    -1
      cpp/CMakeLists.txt
  2. +9332
    -9334
      cpp/src/phonenumbers/metadata.cc
  3. +7
    -0
      cpp/src/phonenumbers/phonenumberutil.cc
  4. +2
    -2
      cpp/src/phonenumbers/shortnumberutil.cc
  5. +741
    -725
      cpp/src/phonenumbers/test_metadata.cc
  6. +12
    -0
      cpp/test/phonenumbers/phonenumberutil_test.cc
  7. +4
    -0
      cpp/test/phonenumbers/test_util.h
  8. +13
    -0
      debian/changelog
  9. +28
    -12
      java/demo/src/com/google/phonenumbers/PhoneNumberParserServlet.java
  10. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/27_en
  11. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/32_en
  12. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/32_fr
  13. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/32_nl
  14. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/86_en
  15. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/86_zh
  16. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/config
  17. +11
    -6
      java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java
  18. +1
    -2
      java/libphonenumber/src/com/google/i18n/phonenumbers/ShortNumberUtil.java
  19. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BE
  20. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BW
  21. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CL
  22. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CN
  23. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CO
  24. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EH
  25. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KW
  26. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MA
  27. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ML
  28. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NG
  29. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PL
  30. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SY
  31. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZA
  32. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZM
  33. +6
    -2
      java/libphonenumber/test/com/google/i18n/phonenumbers/CountryCodeToRegionCodeMapForTesting.java
  34. +8
    -0
      java/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java
  35. +1
    -0
      java/libphonenumber/test/com/google/i18n/phonenumbers/RegionCode.java
  36. BIN
      java/libphonenumber/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_AE
  37. +10
    -0
      java/release_notes.txt
  38. +73
    -46
      javascript/i18n/phonenumbers/demo.html
  39. +28
    -28
      javascript/i18n/phonenumbers/metadata.js
  40. +15
    -0
      javascript/i18n/phonenumbers/metadatafortesting.js
  41. +28
    -28
      javascript/i18n/phonenumbers/metadatalite.js
  42. +7
    -0
      javascript/i18n/phonenumbers/phonenumberutil.js
  43. +13
    -0
      javascript/i18n/phonenumbers/phonenumberutil_test.js
  44. +1
    -0
      javascript/i18n/phonenumbers/regioncodefortesting.js
  45. +75
    -69
      resources/PhoneNumberMetaData.xml
  46. +15
    -1
      resources/PhoneNumberMetaDataForTesting.xml
  47. +2
    -1
      resources/geocoding/en/27.txt
  48. +57
    -0
      resources/geocoding/en/32.txt
  49. +0
    -1
      resources/geocoding/en/86.txt
  50. +57
    -0
      resources/geocoding/fr/32.txt
  51. +57
    -0
      resources/geocoding/nl/32.txt
  52. +0
    -1
      resources/geocoding/zh/86.txt

+ 1
- 1
cpp/CMakeLists.txt View File

@ -18,7 +18,7 @@ cmake_minimum_required (VERSION 2.8)
project (libphonenumber)
set (libphonenumber_VERSION_MAJOR 5)
set (libphonenumber_VERSION_MINOR 2)
set (libphonenumber_VERSION_MINOR 3)
# Helper functions dealing with finding libraries and programs this library
# depends on.


+ 9332
- 9334
cpp/src/phonenumbers/metadata.cc
File diff suppressed because it is too large
View File


+ 7
- 0
cpp/src/phonenumbers/phonenumberutil.cc View File

@ -1053,6 +1053,12 @@ void PhoneNumberUtil::FormatNumberForMobileDialing(
// In Peru, numbers cannot be dialled using E164 format from a mobile phone
// for Movistar. Instead they must be dialled in national format.
Format(number_no_extension, NATIONAL, formatted_number);
} else if ((region_code == "AE") &&
(calling_from == "AE") && (number_type == UAN)) {
// In the United Arab Emirates, numbers with the prefix 600 (UAN numbers)
// cannot be dialled using E164 format. Instead they must be dialled in
// national format.
Format(number_no_extension, NATIONAL, formatted_number);
} else if ((region_code == "BR") && (calling_from == "BR") &&
((number_type == FIXED_LINE) || (number_type == MOBILE) ||
(number_type == FIXED_LINE_OR_MOBILE))) {
@ -1130,6 +1136,7 @@ void PhoneNumberUtil::FormatOutOfCountryCallingNumber(
GetMetadataForRegion(calling_from);
const string& international_prefix =
metadata_calling_from->international_prefix();
// For regions that have multiple international prefixes, the international
// format of the number is returned, unless there is a preferred international
// prefix.


+ 2
- 2
cpp/src/phonenumbers/shortnumberutil.cc View File

@ -67,8 +67,8 @@ bool ShortNumberUtil::MatchesEmergencyNumberHelper(const string& number,
const scoped_ptr<RegExpInput> normalized_number_input(
regexp_factory->CreateInput(extracted_number));
// In Brazil, it is impossible to append additional digits to an emergency
// number to dial the number.
// In Brazil, emergency numbers don't work when additional digits are
// appended.
return (!allow_prefix_match || region_code == "BR")
? emergency_number_pattern->FullMatch(extracted_number)
: emergency_number_pattern->Consume(normalized_number_input.get());


+ 741
- 725
cpp/src/phonenumbers/test_metadata.cc
File diff suppressed because it is too large
View File


+ 12
- 0
cpp/test/phonenumbers/phonenumberutil_test.cc View File

@ -883,6 +883,7 @@ TEST_F(PhoneNumberUtilTest, FormatWithCarrierCode) {
// Here the international rule is used, so no carrier code should be present.
phone_util_.Format(ar_number, PhoneNumberUtil::E164, &formatted_number);
EXPECT_EQ("+5491234125678", formatted_number);
// We don't support this for the US so there should be no change.
PhoneNumber us_number;
us_number.set_country_code(1);
@ -1010,6 +1011,17 @@ TEST_F(PhoneNumberUtilTest, FormatNumberForMobileDialing) {
phone_util_.FormatNumberForMobileDialing(
test_number, RegionCode::JP(), true, &formatted_number);
EXPECT_EQ("+800 1234 5678", formatted_number);
// UAE numbers beginning with 600 (classified as UAN) need to be dialled
// without +971 locally.
test_number.set_country_code(971);
test_number.set_national_number(600123456ULL);
phone_util_.FormatNumberForMobileDialing(
test_number, RegionCode::JP(), false, &formatted_number);
EXPECT_EQ("+971600123456", formatted_number);
phone_util_.FormatNumberForMobileDialing(
test_number, RegionCode::AE(), true, &formatted_number);
EXPECT_EQ("600123456", formatted_number);
}
TEST_F(PhoneNumberUtilTest, FormatByPattern) {


+ 4
- 0
cpp/test/phonenumbers/test_util.h View File

@ -53,6 +53,10 @@ class RegionCode {
return "AD";
}
static const char* AE() {
return "AE";
}
static const char* AO() {
return "AO";
}


+ 13
- 0
debian/changelog View File

@ -1,3 +1,16 @@
libphonenumber (5.3) lucid; urgency=low
* Code changes:
- Handling UAN numbers in Argentina better when dialling them locally from a
mobile
* Metadata changes:
- Updated metadata for region code(s):
BE, BW, CL, CN, CO, EH, KW, MA, ML, NG, PL, SY, ZA, ZM
- New geocoding data for country calling code(s): 32 (en, fr, nl)
- Updated geocoding data for country calling code(s): 27 (en), 86
(en, zh)
-- Lara Rennie <lararennie@google.com> Tue, 08 Jan 2013 16:49:27 +0100
libphonenumber (5.2.2) lucid; urgency=low
* Metadata changes:


+ 28
- 12
java/demo/src/com/google/phonenumbers/PhoneNumberParserServlet.java View File

@ -181,21 +181,33 @@ public class PhoneNumberParserServlet extends HttpServlet {
output.append("</TABLE>");
output.append("</DIV>");
boolean isPossible = phoneUtil.isPossibleNumber(number);
boolean isNumberValid = phoneUtil.isValidNumber(number);
output.append("<DIV>");
output.append("<TABLE border=1>");
output.append("<TR><TD colspan=2>Validation Results</TD></TR>");
appendLine("Result from isValidNumber()", Boolean.toString(isNumberValid), output);
appendLine(
"Result from isValidNumberForRegion()",
Boolean.toString(phoneUtil.isValidNumberForRegion(number, defaultCountry)),
output);
String region = phoneUtil.getRegionCodeForNumber(number);
appendLine("Phone Number region", region == null ? "" : region, output);
appendLine("Result from isPossibleNumber()",
Boolean.toString(phoneUtil.isPossibleNumber(number)), output);
appendLine("Result from getNumberType()", phoneUtil.getNumberType(number).toString(), output);
appendLine("Result from isPossibleNumber()", Boolean.toString(isPossible), output);
if (!isPossible) {
appendLine("Result from isPossibleNumberWithReason()",
phoneUtil.isPossibleNumberWithReason(number).toString(), output);
output.append("<TR><TD colspan=2>Note: numbers that are not possible have type " +
"UNKNOWN, an unknown region, and are considered invalid.</TD></TR>");
} else {
appendLine("Result from isValidNumber()", Boolean.toString(isNumberValid), output);
if (isNumberValid) {
if (!defaultCountry.isEmpty() && defaultCountry != "ZZ") {
appendLine(
"Result from isValidNumberForRegion()",
Boolean.toString(phoneUtil.isValidNumberForRegion(number, defaultCountry)),
output);
}
}
String region = phoneUtil.getRegionCodeForNumber(number);
appendLine("Phone Number region", region == null ? "" : region, output);
appendLine("Result from getNumberType()",
phoneUtil.getNumberType(number).toString(), output);
}
output.append("</TABLE>");
output.append("</DIV>");
@ -207,15 +219,19 @@ public class PhoneNumberParserServlet extends HttpServlet {
output);
appendLine("Original format",
phoneUtil.formatInOriginalFormat(number, defaultCountry), output);
appendLine("National format", phoneUtil.format(number, PhoneNumberFormat.NATIONAL), output);
appendLine(
"International format",
isNumberValid ? phoneUtil.format(number, PhoneNumberFormat.INTERNATIONAL) : "invalid",
output);
appendLine("National format", phoneUtil.format(number, PhoneNumberFormat.NATIONAL), output);
appendLine(
"Out-of-country format from US",
isNumberValid ? phoneUtil.formatOutOfCountryCallingNumber(number, "US") : "invalid",
output);
appendLine(
"Out-of-country format from CH",
isNumberValid ? phoneUtil.formatOutOfCountryCallingNumber(number, "CH") : "invalid",
output);
output.append("</TABLE>");
output.append("</DIV>");
@ -238,7 +254,7 @@ public class PhoneNumberParserServlet extends HttpServlet {
output.append("<TABLE border=1>");
output.append("<TR><TD colspan=2>PhoneNumberOfflineGeocoder Results</TD></TR>");
appendLine(
"Location",
"Location",
PhoneNumberOfflineGeocoder.getInstance().getDescriptionForNumber(
number, new Locale(languageCode, regionCode)),
output);


BIN
java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/27_en View File


BIN
java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/32_en View File


BIN
java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/32_fr View File


BIN
java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/32_nl View File


BIN
java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/86_en View File


BIN
java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/86_zh View File


BIN
java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/config View File


+ 11
- 6
java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java View File

@ -1220,6 +1220,11 @@ public class PhoneNumberUtil {
// In Peru, numbers cannot be dialled using E164 format from a mobile phone for Movistar.
// Instead they must be dialled in national format.
formattedNumber = format(numberNoExt, PhoneNumberFormat.NATIONAL);
} else if (regionCode.equals("AE") && regionCallingFrom.equals("AE") &&
numberType == PhoneNumberType.UAN) {
// In the United Arab Emirates, numbers with the prefix 600 (UAN numbers) cannot be dialled
// using E164 format. Instead they must be dialled in national format.
formattedNumber = format(numberNoExt, PhoneNumberFormat.NATIONAL);
} else if (regionCode.equals("BR") && regionCallingFrom.equals("BR") &&
((numberType == PhoneNumberType.FIXED_LINE) || (numberType == PhoneNumberType.MOBILE) ||
(numberType == PhoneNumberType.FIXED_LINE_OR_MOBILE))) {
@ -1279,12 +1284,12 @@ public class PhoneNumberUtil {
return countryCallingCode + " " + format(number, PhoneNumberFormat.NATIONAL);
}
} else if (countryCallingCode == getCountryCodeForValidRegion(regionCallingFrom)) {
// If regions share a country calling code, the country calling code need not be dialled.
// This also applies when dialling within a region, so this if clause covers both these cases.
// Technically this is the case for dialling from La Reunion to other overseas departments of
// France (French Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover this
// edge case for now and for those cases return the version including country calling code.
// Details here: http://www.petitfute.com/voyage/225-info-pratiques-reunion
// If regions share a country calling code, the country calling code need not be dialled.
// This also applies when dialling within a region, so this if clause covers both these cases.
// Technically this is the case for dialling from La Reunion to other overseas departments of
// France (French Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover this
// edge case for now and for those cases return the version including country calling code.
// Details here: http://www.petitfute.com/voyage/225-info-pratiques-reunion
return format(number, PhoneNumberFormat.NATIONAL);
}
// Metadata cannot be null because we checked 'isValidRegionCode()' above.


+ 1
- 2
java/libphonenumber/src/com/google/i18n/phonenumbers/ShortNumberUtil.java View File

@ -84,8 +84,7 @@ public class ShortNumberUtil {
Pattern emergencyNumberPattern =
Pattern.compile(metadata.getEmergency().getNationalNumberPattern());
String normalizedNumber = PhoneNumberUtil.normalizeDigitsOnly(number);
// In Brazil, it is impossible to append additional digits to an emergency number to dial the
// number.
// In Brazil, emergency numbers don't work when additional digits are appended.
return (!allowPrefixMatch || regionCode.equals("BR"))
? emergencyNumberPattern.matcher(normalizedNumber).matches()
: emergencyNumberPattern.matcher(normalizedNumber).lookingAt();


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BE View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BW View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CL View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CN View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CO View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EH View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KW View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MA View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ML View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NG View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PL View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SY View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZA View File


BIN
java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZM View File


+ 6
- 2
java/libphonenumber/test/com/google/i18n/phonenumbers/CountryCodeToRegionCodeMapForTesting.java View File

@ -31,10 +31,10 @@ public class CountryCodeToRegionCodeMapForTesting {
// countries sharing a calling code, such as the NANPA countries, the one
// indicated with "isMainCountryForCode" in the metadata should be first.
static Map<Integer, List<String>> getCountryCodeToRegionCodeMap() {
// The capacity is set to 25 as there are 19 different country codes,
// The capacity is set to 26 as there are 20 different country codes,
// and this offers a load factor of roughly 0.75.
Map<Integer, List<String>> countryCodeToRegionCodeMap =
new HashMap<Integer, List<String>>(25);
new HashMap<Integer, List<String>>(26);
ArrayList<String> listWithRegionCode;
@ -112,6 +112,10 @@ public class CountryCodeToRegionCodeMapForTesting {
listWithRegionCode.add("001");
countryCodeToRegionCodeMap.put(800, listWithRegionCode);
listWithRegionCode = new ArrayList<String>(1);
listWithRegionCode.add("AE");
countryCodeToRegionCodeMap.put(971, listWithRegionCode);
listWithRegionCode = new ArrayList<String>(1);
listWithRegionCode.add("001");
countryCodeToRegionCodeMap.put(979, listWithRegionCode);


+ 8
- 0
java/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java View File

@ -41,6 +41,8 @@ public class PhoneNumberUtilTest extends TestMetadataTestCase {
// any risk of accidental changes to mutable static state affecting many tests.
private static final PhoneNumber ALPHA_NUMERIC_NUMBER =
new PhoneNumber().setCountryCode(1).setNationalNumber(80074935247L);
private static final PhoneNumber AE_UAN =
new PhoneNumber().setCountryCode(971).setNationalNumber(600123456L);
private static final PhoneNumber AR_MOBILE =
new PhoneNumber().setCountryCode(54).setNationalNumber(91187654321L);
private static final PhoneNumber AR_NUMBER =
@ -725,6 +727,12 @@ public class PhoneNumberUtilTest extends TestMetadataTestCase {
phoneUtil.formatNumberForMobileDialing(INTERNATIONAL_TOLL_FREE, RegionCode.JP, false));
assertEquals("+800 1234 5678",
phoneUtil.formatNumberForMobileDialing(INTERNATIONAL_TOLL_FREE, RegionCode.JP, true));
// UAE numbers beginning with 600 (classified as UAN) need to be dialled without +971 locally.
assertEquals("+971600123456",
phoneUtil.formatNumberForMobileDialing(AE_UAN, RegionCode.JP, false));
assertEquals("600123456",
phoneUtil.formatNumberForMobileDialing(AE_UAN, RegionCode.AE, false));
}
public void testFormatByPattern() {


+ 1
- 0
java/libphonenumber/test/com/google/i18n/phonenumbers/RegionCode.java View File

@ -23,6 +23,7 @@ final class RegionCode {
// Region code for global networks (e.g. +800 numbers).
static final String UN001 = "001";
static final String AD = "AD";
static final String AE = "AE";
static final String AO = "AO";
static final String AQ = "AQ";
static final String AR = "AR";


BIN
java/libphonenumber/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_AE View File


+ 10
- 0
java/release_notes.txt View File

@ -1,3 +1,13 @@
Jan 08, 2013: libphonenumber-5.3
* Code changes:
- Handling UAN numbers in Argentina better when dialling them locally from a
mobile
* Metadata changes:
- Updated metadata for region code(s):
BE, BW, CL, CN, CO, EH, KW, MA, ML, NG, PL, SY, ZA, ZM
- New geocoding data for country calling code(s): 32 (en, fr, nl)
- Updated geocoding data for country calling code(s): 27 (en), 86 (en, zh)
Dec 06, 2012: libphonenumber-5.2.2
* Metadata changes:
- New metadata for region code(s): EH


+ 73
- 46
javascript/i18n/phonenumbers/demo.html View File

@ -50,51 +50,74 @@ function phoneNumberParser() {
output.append(goog.json.serialize(new goog.proto2.ObjectSerializer(
goog.proto2.ObjectSerializer.KeyOption.NAME).serialize(number)));
output.append('\n\n****Validation Results:****');
var isNumberValid = phoneUtil.isValidNumber(number);
output.append('\nResult from isValidNumber(): ');
output.append(isNumberValid);
output.append('\nResult from isValidNumberForRegion(): ');
output.append(phoneUtil.isValidNumberForRegion(number, regionCode));
output.append('\nPhone Number region: ');
output.append(phoneUtil.getRegionCodeForNumber(number));
var isPossible = phoneUtil.isPossibleNumber(number);
output.append('\nResult from isPossibleNumber(): ');
output.append(phoneUtil.isPossibleNumber(number));
output.append('\nResult from getNumberType(): ');
var PNT = i18n.phonenumbers.PhoneNumberType;
switch (phoneUtil.getNumberType(number)) {
case PNT.FIXED_LINE:
output.append('FIXED_LINE');
break;
case PNT.MOBILE:
output.append('MOBILE');
break;
case PNT.FIXED_LINE_OR_MOBILE:
output.append('FIXED_LINE_OR_MOBILE');
break;
case PNT.TOLL_FREE:
output.append('TOLL_FREE');
break;
case PNT.PREMIUM_RATE:
output.append('PREMIUM_RATE');
break;
case PNT.SHARED_COST:
output.append('SHARED_COST');
break;
case PNT.VOIP:
output.append('VOIP');
break;
case PNT.PERSONAL_NUMBER:
output.append('PERSONAL_NUMBER');
break;
case PNT.PAGER:
output.append('PAGER');
break;
case PNT.UAN:
output.append('UAN');
break;
case PNT.UNKNOWN:
output.append('UNKNOWN');
break;
output.append(isPossible);
if (!isPossible) {
output.append('\nResult from isPossibleNumberWithReason(): ');
var PNV = i18n.phonenumbers.PhoneNumberUtil.ValidationResult;
switch (phoneUtil.isPossibleNumberWithReason(number)) {
case PNV.INVALID_COUNTRY_CODE:
output.append('INVALID_COUNTRY_CODE');
break;
case PNV.TOO_SHORT:
output.append('TOO_SHORT');
break;
case PNV.TOO_LONG:
output.append('TOO_LONG');
break;
}
// IS_POSSIBLE shouldn't happen, since we only call this if _not_
// possible.
output.append('\nNote: numbers that are not possible have type ' +
'UNKNOWN, an unknown region, and are considered invalid.');
} else {
var isNumberValid = phoneUtil.isValidNumber(number);
output.append('\nResult from isValidNumber(): ');
output.append(isNumberValid);
if (isNumberValid && regionCode && regionCode != 'ZZ') {
output.append('\nResult from isValidNumberForRegion(): ');
output.append(phoneUtil.isValidNumberForRegion(number, regionCode));
}
output.append('\nPhone Number region: ');
output.append(phoneUtil.getRegionCodeForNumber(number));
output.append('\nResult from getNumberType(): ');
var PNT = i18n.phonenumbers.PhoneNumberType;
switch (phoneUtil.getNumberType(number)) {
case PNT.FIXED_LINE:
output.append('FIXED_LINE');
break;
case PNT.MOBILE:
output.append('MOBILE');
break;
case PNT.FIXED_LINE_OR_MOBILE:
output.append('FIXED_LINE_OR_MOBILE');
break;
case PNT.TOLL_FREE:
output.append('TOLL_FREE');
break;
case PNT.PREMIUM_RATE:
output.append('PREMIUM_RATE');
break;
case PNT.SHARED_COST:
output.append('SHARED_COST');
break;
case PNT.VOIP:
output.append('VOIP');
break;
case PNT.PERSONAL_NUMBER:
output.append('PERSONAL_NUMBER');
break;
case PNT.PAGER:
output.append('PAGER');
break;
case PNT.UAN:
output.append('UAN');
break;
case PNT.UNKNOWN:
output.append('UNKNOWN');
break;
}
}
var PNF = i18n.phonenumbers.PhoneNumberFormat;
output.append('\n\n****Formatting Results:**** ');
@ -104,16 +127,20 @@ function phoneNumberParser() {
'invalid');
output.append('\nOriginal format: ');
output.append(phoneUtil.formatInOriginalFormat(number, regionCode));
output.append('\nNational format: ');
output.append(phoneUtil.format(number, PNF.NATIONAL));
output.append('\nInternational format: ');
output.append(isNumberValid ?
phoneUtil.format(number, PNF.INTERNATIONAL) :
'invalid');
output.append('\nNational format: ');
output.append(phoneUtil.format(number, PNF.NATIONAL));
output.append('\nOut-of-country format from US: ');
output.append(isNumberValid ?
phoneUtil.formatOutOfCountryCallingNumber(number, 'US') :
'invalid');
output.append('\nOut-of-country format from Switzerland: ');
output.append(isNumberValid ?
phoneUtil.formatOutOfCountryCallingNumber(number, 'CH') :
'invalid');
if (carrierCode.length > 0) {
output.append('\nNational format with carrier code: ');
output.append(phoneUtil.formatNationalNumberWithCarrierCode(number,


+ 28
- 28
javascript/i18n/phonenumbers/metadata.js View File

@ -649,11 +649,11 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,[,,"NA","NA"]
]
,"BE":[,[,,"[1-9]\\d{7,8}","\\d{8,9}"]
,[,,"(?:1[0-69]|[23][2-8]|[49][23]|5\\d|6[013-57-9]|7[18])\\d{6}|8(?:0[1-9]|[1-69]\\d)\\d{5}","\\d{8}",,,"12345678"]
,[,,"(?:1[0-69]|[23][2-8]|[49][23]|5\\d|6[013-57-9]|71)\\d{6}|8(?:0[1-9]|[1-79]\\d)\\d{5}","\\d{8}",,,"12345678"]
,[,,"4(?:[679]\\d|8[3-9])\\d{6}","\\d{9}",,,"470123456"]
,[,,"800\\d{5}","\\d{8}",,,"80012345"]
,[,,"(?:90|7[07])\\d{6}","\\d{8}",,,"90123456"]
,[,,"87\\d{6}","\\d{8}",,,"87123456"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,"BE",32,"00","0",,,"0",,,,[[,"(4[6-9]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4[6-9]"]
@ -667,7 +667,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,,[,,"NA","NA"]
,,,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"78\\d{6}","\\d{8}",,,"78123456"]
,,[,,"1(?:0[01]|12)","\\d{3}",,,"112"]
,[,,"NA","NA"]
]
@ -912,7 +912,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"BW":[,[,,"[2-79]\\d{6,7}","\\d{7,8}"]
,[,,"(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0235-9]|55|6\\d|7[01]|9[0-57])|4(?:6[03]|7[1267]|9[0-5])|5(?:3[0389]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[067]))\\d{4}","\\d{7}",,,"2401234"]
,[,,"7(?:[1-35]\\d{6}|[46][0-7]\\d{5})","\\d{8}",,,"71123456"]
,[,,"7(?:[1-35]\\d{6}|[46][0-7]\\d{5}|7[01]\\d{5})","\\d{8}",,,"71123456"]
,[,,"NA","NA"]
,[,,"90\\d{5}","\\d{7}",,,"9012345"]
,[,,"NA","NA"]
@ -1109,7 +1109,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,[,,"NA","NA"]
]
,"CL":[,[,,"(?:[2-9]|600|123)\\d{7,8}","\\d{6,11}"]
,[,,"(?:22|32|41|58)\\d{7}|(?:3[3-5]|4[235]|5[1-357]|6[13-57]|7[1-35])\\d{6,7}","\\d{6,9}",,,"221234567"]
,[,,"(?:[23]2|41|58)\\d{7}|(?:3[3-5]|4[235]|5[1-357]|6[13-57]|7[1-35])\\d{6,7}","\\d{6,9}",,,"221234567"]
,[,,"9[5-9]\\d{7}","\\d{8,9}",,,"961234567"]
,[,,"800\\d{6}|1230\\d{7}","\\d{9,11}",,,"800123456"]
,[,,"NA","NA"]
@ -1157,7 +1157,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,[,,"NA","NA"]
]
,"CN":[,[,,"[1-79]\\d{7,11}|8[0-357-9]\\d{6,9}","\\d{4,12}"]
,[,,"21\\d{8,10}|(?:10|2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898)\\d{8}|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[3-9]|5[2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5\\d|6[1-6]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))\\d{7}|80(?:29|6[03578]|7[018]|81)\\d{4}","\\d{4,12}",,,"1012345678"]
,[,,"21\\d{8,10}|(?:10|2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898)\\d{8}|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[3-9]|5[2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))\\d{7}|80(?:29|6[03578]|7[018]|81)\\d{4}","\\d{4,12}",,,"1012345678"]
,[,,"1(?:3\\d|4[57]|[58][0-35-9])\\d{8}","\\d{11}",,,"13123456789"]
,[,,"(?:10)?800\\d{7}","\\d{10,12}",,,"8001234567"]
,[,,"16[08]\\d{5}","\\d{8}",,,"16812345"]
@ -1174,9 +1174,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,"0$1","$CC $1",1]
,[,"([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]"]
,"0$1","$CC $1",1]
,[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898"]
,[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898"]
,"0$1","$CC $1",1]
,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5|6[1-6]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"]
,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"]
,"0$1","$CC $1",1]
,[,"(1[3-58]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["1[3-58]"]
,"","$CC $1",0]
@ -1191,9 +1191,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,"0$1","$CC $1",1]
,[,"([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]","10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]"]
,"0$1","$CC $1",1]
,[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898","3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898"]
,[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898","3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898"]
,"0$1","$CC $1",1]
,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5|6[1-6]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])","3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5|6[1-6]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"]
,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])","3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"]
,"0$1","$CC $1",1]
,[,"(1[3-58]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["1[3-58]","1[3-58]"]
,"","$CC $1",0]
@ -1208,7 +1208,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"CO":[,[,,"(?:[13]\\d{0,3}|[24-8])\\d{7}","\\d{7,11}"]
,[,,"[124-8][2-9]\\d{6}","\\d{8}",,,"12345678"]
,[,,"3(?:0[0-24]|1[0-8]|2[01])\\d{7}","\\d{10}",,,"3211234567"]
,[,,"3(?:0[0-24]|1\\d|2[01])\\d{7}","\\d{10}",,,"3211234567"]
,[,,"1800\\d{7}","\\d{11}",,,"18001234567"]
,[,,"19(?:0[01]|4[78])\\d{7}","\\d{11}",,,"19001234567"]
,[,,"NA","NA"]
@ -1556,7 +1556,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"EH":[,[,,"[5689]\\d{8}","\\d{9}"]
,[,,"528[89]\\d{5}","\\d{9}",,,"528812345"]
,[,,"6(?:0[0-6]|[14-7]\\d|2[236-9]|3[03458]|8[01]|99)\\d{6}","\\d{9}",,,"650123456"]
,[,,"6(?:0[0-6]|[14-7]\\d|2[2-46-9]|3[03458]|8[01]|99)\\d{6}","\\d{9}",,,"650123456"]
,[,,"80\\d{7}","\\d{9}",,,"801234567"]
,[,,"89\\d{7}","\\d{9}",,,"891234567"]
,[,,"NA","NA"]
@ -2667,7 +2667,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"KW":[,[,,"[12569]\\d{6,7}","\\d{7,8}"]
,[,,"(?:18\\d|2(?:[23]\\d{2}|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7])))\\d{4}","\\d{7,8}",,,"22345678"]
,[,,"(?:5(?:0[0-25-9]|11|5\\d)|6(?:0[034679]|5[015-9]|6\\d|7[067]|9[069])|9(?:0[09]|4[049]|6[69]|[79]\\d))\\d{5}","\\d{8}",,,"50012345"]
,[,,"(?:5(?:0[0-35-9]|11|5\\d)|6(?:0[034679]|5[015-9]|6\\d|7[067]|9[069])|9(?:0[09]|4[049]|6[69]|[79]\\d))\\d{5}","\\d{8}",,,"50012345"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"NA","NA"]
@ -2939,7 +2939,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"MA":[,[,,"[5689]\\d{8}","\\d{9}"]
,[,,"5(?:2(?:(?:[015-7]\\d|2[2-9]|3[2-57]|4[2-8]|8[235-7])\\d|9(?:0\\d|[89]0))|3(?:(?:[0-4]\\d|[57][2-9]|6[235-8]|9[3-9])\\d|8(?:0\\d|[89]0)))\\d{4}","\\d{9}",,,"520123456"]
,[,,"6(?:0[0-6]|[14-7]\\d|2[236-9]|3[03458]|8[01]|99)\\d{6}","\\d{9}",,,"650123456"]
,[,,"6(?:0[0-6]|[14-7]\\d|2[2-46-9]|3[03458]|8[01]|99)\\d{6}","\\d{9}",,,"650123456"]
,[,,"80\\d{7}","\\d{9}",,,"801234567"]
,[,,"89\\d{7}","\\d{9}",,,"891234567"]
,[,,"NA","NA"]
@ -3089,8 +3089,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,[,,"NA","NA"]
]
,"ML":[,[,,"[246-8]\\d{7}","\\d{8}"]
,[,,"(?:2(?:0(?:2[0-589]|7[027-9])|1(?:2[5-7]|[3-689]\\d))|442\\d)\\d{4}","\\d{8}",,,"20212345"]
,[,,"(?:6(?:[3569]\\d)|7(?:[08][1-9]|[3579][0-4]|4[014-7]|[16]\\d))\\d{5}","\\d{8}",,,"65012345"]
,[,,"(?:2(?:0(?:2[0-589]|7[027-9])|1(?:2[5-7]|[3-689]\\d))|44[239]\\d)\\d{4}","\\d{8}",,,"20212345"]
,[,,"(?:6[3569]|7\\d)\\d{6}","\\d{8}",,,"65012345"]
,[,,"800\\d{5}","\\d{8}",,,"80012345"]
,[,,"NA","NA"]
,[,,"NA","NA"]
@ -3463,7 +3463,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"NG":[,[,,"[1-69]\\d{5,8}|[78]\\d{5,13}","\\d{5,14}"]
,[,,"[12]\\d{6,7}|9\\d{7}|(?:3\\d|4[023568]|5[02368]|6[02-469]|7[4-69]|8[2-9])\\d{6}|(?:4[47]|5[14579]|6[1578]|7[0-357])\\d{5,6}|(?:78|41)\\d{5}","\\d{5,9}",,,"12345678"]
,[,,"(?:1(?:7[34]\\d|8(?:04|[124579]\\d|8[0-3])|95\\d)|287[0-7]|3(?:18[1-8]|88[0-7]|9(?:8[5-9]|6[1-5]))|4(?:28[0-2]|6(?:7[1-9]|8[02-47])|88[0-2])|5(?:2(?:7[7-9]|8\\d)|38[1-79]|48[0-7]|68[4-7])|6(?:2(?:7[7-9]|8\\d)|4(?:3[7-9]|[68][129]|7[04-69]|9[1-8])|58[0-2]|98[7-9])|7(?:38[0-7]|69[1-8]|78[2-4])|8(?:28[3-9]|38[0-2]|4(?:2[12]|3[147-9]|5[346]|7[4-9]|8[014-689]|90)|58[1-8]|78[2-9]|88[5-7])|98[07]\\d)\\d{4}|(?:70(?:[3-9]\\d|2[1-9])|8(?:0[2-9]|1[0-35-9])\\d)\\d{6}","\\d{8,10}",,,"8021234567"]
,[,,"(?:1(?:7[34]\\d|8(?:04|[124579]\\d|8[0-3])|95\\d)|287[0-7]|3(?:18[1-8]|88[0-7]|9(?:8[5-9]|6[1-5]))|4(?:28[0-2]|6(?:7[1-9]|8[02-47])|88[0-2])|5(?:2(?:7[7-9]|8\\d)|38[1-79]|48[0-7]|68[4-7])|6(?:2(?:7[7-9]|8\\d)|4(?:3[7-9]|[68][129]|7[04-69]|9[1-8])|58[0-2]|98[7-9])|7(?:38[0-7]|69[1-8]|78[2-4])|8(?:28[3-9]|38[0-2]|4(?:2[12]|3[147-9]|5[346]|7[4-9]|8[014-689]|90)|58[1-8]|78[2-9]|88[5-7])|98[07]\\d)\\d{4}|(?:70(?:[3-9]\\d|2[1-9])|8(?:0[2-9]|1\\d)\\d)\\d{6}","\\d{8,10}",,,"8021234567"]
,[,,"800\\d{7,11}","\\d{10,14}",,,"80017591759"]
,[,,"NA","NA"]
,[,,"NA","NA"]
@ -3788,7 +3788,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"PL":[,[,,"[1-58]\\d{6,8}|9\\d{8}|[67]\\d{5,8}","\\d{6,9}"]
,[,,"(?:1[2-8]|2[2-59]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-6]|8[1-7])\\d{5,7}|77\\d{4,7}|(?:89|9[145])\\d{7}","\\d{6,9}",,,"123456789"]
,[,,"(?:5[013]|6[069]|7[289]|88)\\d{7}","\\d{9}",,,"512345678"]
,[,,"(?:5[013]|6[069]|7[2389]|88)\\d{7}","\\d{9}",,,"512345678"]
,[,,"800\\d{6}","\\d{9}",,,"800123456"]
,[,,"70\\d{7}","\\d{9}",,,"701234567"]
,[,,"801\\d{6}","\\d{9}",,,"801234567"]
@ -3798,7 +3798,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,"","",0]
,[,"(\\d{2})(\\d{4,6})","$1 $2",["[124]|3[2-4]|5[24-689]|6[1-3578]|7[14-7]|8[1-7]"]
,"","",0]
,[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["39|5[013]|6[0469]|7[0289]|8[08]"]
,[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["39|5[013]|6[0469]|7[02389]|8[08]"]
,"","",0]
,[,"(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]
,"","",0]
@ -4444,7 +4444,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"SY":[,[,,"[1-59]\\d{7,8}","\\d{6,9}"]
,[,,"(?:1(?:1\\d?|4\\d|[2356])|2[1-35]|3(?:[13]\\d|4)|4[13]|5[1-3])\\d{6}","\\d{6,9}",,,"112345678"]
,[,,"9(?:22|3[1-356]|4\\d|5[024-7]|6[26-9]|88|9[0-489])\\d{6}","\\d{9}",,,"944567890"]
,[,,"9(?:22|[35][0-8]|4\\d|6[024-9]|88|9[0-489])\\d{6}","\\d{9}",,,"944567890"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"NA","NA"]
@ -5038,21 +5038,21 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,,[,,"1(?:12|5)","\\d{2,3}",,,"15"]
,[,,"NA","NA"]
]
,"ZA":[,[,,"[1-5]\\d{8}|(?:7\\d{4,8}|8[1-5789]\\d{3,7})|8[06]\\d{7}","\\d{5,9}"]
,[,,"(?:1[0-8]|2[1-478]|3[1-69]|4\\d|5[1346-8])\\d{7}","\\d{8,9}",,,"101234567"]
,[,,"(?:7[1-4689]|8[1-5789])\\d{3,7}","\\d{5,9}",,,"711234567"]
,"ZA":[,[,,"[1-79]\\d{8}|8(?:[067]\\d{7}|[1-4]\\d{3,7})","\\d{5,9}"]
,[,,"(?:1[0-8]|2[0-378]|3[1-69]|4\\d|5[1346-8])\\d{7}","\\d{9}",,,"101234567"]
,[,,"(?:6[0-5]|7[0-46-9])\\d{7}|8[1-4]\\d{3,7}","\\d{5,9}",,,"711234567"]
,[,,"80\\d{7}","\\d{9}",,,"801234567"]
,[,,"86[2-9]\\d{6}","\\d{9}",,,"862345678"]
,[,,"86[2-9]\\d{6}|90\\d{7}","\\d{9}",,,"862345678"]
,[,,"860\\d{6}","\\d{9}",,,"860123456"]
,[,,"NA","NA"]
,[,,"87\\d{7}","\\d{9}",,,"871234567"]
,"ZA",27,"00","0",,,"0",,,,[[,"(860)(\\d{3})(\\d{3})","$1 $2 $3",["860"]
,"0$1","",0]
,[,"([1-578]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[1-57]|8(?:[0-57-9]|6[1-9])"]
,[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-79]|8(?:[0-47]|6[1-9])"]
,"0$1","",0]
,[,"(\\d{2})(\\d{3,4})","$1 $2",["7|8[1-5789]"]
,[,"(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"]
,"0$1","",0]
,[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["7|8[1-5789]"]
,[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"]
,"0$1","",0]
]
,,[,,"NA","NA"]
@ -5063,7 +5063,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"ZM":[,[,,"[289]\\d{8}","\\d{9}"]
,[,,"21[1-8]\\d{6}","\\d{9}",,,"211234567"]
,[,,"9(?:5[05]|6[1-9]|7[13-9])\\d{6}","\\d{9}",,,"955123456"]
,[,,"9(?:5[05]|6\\d|7[13-9])\\d{6}","\\d{9}",,,"955123456"]
,[,,"800\\d{6}","\\d{9}",,,"800123456"]
,[,,"NA","NA"]
,[,,"NA","NA"]


+ 15
- 0
javascript/i18n/phonenumbers/metadatafortesting.js View File

@ -49,6 +49,7 @@ i18n.phonenumbers.metadata.countryCodeToRegionCodeMap = {
,375:["BY"]
,376:["AD"]
,800:["001"]
,971:["AE"]
,979:["001"]
};
@ -71,6 +72,20 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,,[,,"NA","NA"]
,[,,"NA","NA"]
]
,"AE":[,[,,"[1-9]\\d{8}","\\d{9}"]
,[,,"[1-9]\\d{8}","\\d{9}"]
,[,,"[1-9]\\d{8}","\\d{9}"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,"AE",971,"00",,,,,,,1,,,[,,"NA","NA"]
,,,[,,"NA","NA"]
,[,,"600\\d{6}","\\d{9}",,,"600123456"]
,,[,,"NA","NA"]
,[,,"NA","NA"]
]
,"AO":[,[,,"[29]\\d{8}","\\d{9}"]
,[,,"2\\d(?:[26-9]\\d|\\d[26-9])\\d{5}","\\d{9}",,,"222123456"]
,[,,"9[1-3]\\d{7}","\\d{9}",,,"923123456"]


+ 28
- 28
javascript/i18n/phonenumbers/metadatalite.js View File

@ -649,11 +649,11 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,[,,"NA","NA"]
]
,"BE":[,[,,"[1-9]\\d{7,8}","\\d{8,9}"]
,[,,"(?:1[0-69]|[23][2-8]|[49][23]|5\\d|6[013-57-9]|7[18])\\d{6}|8(?:0[1-9]|[1-69]\\d)\\d{5}","\\d{8}"]
,[,,"(?:1[0-69]|[23][2-8]|[49][23]|5\\d|6[013-57-9]|71)\\d{6}|8(?:0[1-9]|[1-79]\\d)\\d{5}","\\d{8}"]
,[,,"4(?:[679]\\d|8[3-9])\\d{6}","\\d{9}"]
,[,,"800\\d{5}","\\d{8}"]
,[,,"(?:90|7[07])\\d{6}","\\d{8}"]
,[,,"87\\d{6}","\\d{8}"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,"BE",32,"00","0",,,"0",,,,[[,"(4[6-9]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4[6-9]"]
@ -667,7 +667,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,,[,,"NA","NA"]
,,,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"78\\d{6}","\\d{8}"]
,,[,,"1(?:0[01]|12)","\\d{3}"]
,[,,"NA","NA"]
]
@ -912,7 +912,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"BW":[,[,,"[2-79]\\d{6,7}","\\d{7,8}"]
,[,,"(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0235-9]|55|6\\d|7[01]|9[0-57])|4(?:6[03]|7[1267]|9[0-5])|5(?:3[0389]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[067]))\\d{4}","\\d{7}"]
,[,,"7(?:[1-35]\\d{6}|[46][0-7]\\d{5})","\\d{8}"]
,[,,"7(?:[1-35]\\d{6}|[46][0-7]\\d{5}|7[01]\\d{5})","\\d{8}"]
,[,,"NA","NA"]
,[,,"90\\d{5}","\\d{7}"]
,[,,"NA","NA"]
@ -1109,7 +1109,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,[,,"NA","NA"]
]
,"CL":[,[,,"(?:[2-9]|600|123)\\d{7,8}","\\d{6,11}"]
,[,,"(?:22|32|41|58)\\d{7}|(?:3[3-5]|4[235]|5[1-357]|6[13-57]|7[1-35])\\d{6,7}","\\d{6,9}"]
,[,,"(?:[23]2|41|58)\\d{7}|(?:3[3-5]|4[235]|5[1-357]|6[13-57]|7[1-35])\\d{6,7}","\\d{6,9}"]
,[,,"9[5-9]\\d{7}","\\d{8,9}"]
,[,,"800\\d{6}|1230\\d{7}","\\d{9,11}"]
,[,,"NA","NA"]
@ -1157,7 +1157,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,[,,"NA","NA"]
]
,"CN":[,[,,"[1-79]\\d{7,11}|8[0-357-9]\\d{6,9}","\\d{4,12}"]
,[,,"21\\d{8,10}|(?:10|2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898)\\d{8}|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[3-9]|5[2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5\\d|6[1-6]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))\\d{7}|80(?:29|6[03578]|7[018]|81)\\d{4}","\\d{4,12}"]
,[,,"21\\d{8,10}|(?:10|2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898)\\d{8}|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[3-9]|5[2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))\\d{7}|80(?:29|6[03578]|7[018]|81)\\d{4}","\\d{4,12}"]
,[,,"1(?:3\\d|4[57]|[58][0-35-9])\\d{8}","\\d{11}"]
,[,,"(?:10)?800\\d{7}","\\d{10,12}"]
,[,,"16[08]\\d{5}","\\d{8}"]
@ -1174,9 +1174,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,"0$1","$CC $1",1]
,[,"([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]"]
,"0$1","$CC $1",1]
,[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898"]
,[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898"]
,"0$1","$CC $1",1]
,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5|6[1-6]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"]
,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"]
,"0$1","$CC $1",1]
,[,"(1[3-58]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["1[3-58]"]
,"","$CC $1",0]
@ -1191,9 +1191,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,"0$1","$CC $1",1]
,[,"([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]","10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]"]
,"0$1","$CC $1",1]
,[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898","3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898"]
,[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898","3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898"]
,"0$1","$CC $1",1]
,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5|6[1-6]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])","3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5|6[1-6]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"]
,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])","3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|[37]|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"]
,"0$1","$CC $1",1]
,[,"(1[3-58]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["1[3-58]","1[3-58]"]
,"","$CC $1",0]
@ -1208,7 +1208,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"CO":[,[,,"(?:[13]\\d{0,3}|[24-8])\\d{7}","\\d{7,11}"]
,[,,"[124-8][2-9]\\d{6}","\\d{8}"]
,[,,"3(?:0[0-24]|1[0-8]|2[01])\\d{7}","\\d{10}"]
,[,,"3(?:0[0-24]|1\\d|2[01])\\d{7}","\\d{10}"]
,[,,"1800\\d{7}","\\d{11}"]
,[,,"19(?:0[01]|4[78])\\d{7}","\\d{11}"]
,[,,"NA","NA"]
@ -1556,7 +1556,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"EH":[,[,,"[5689]\\d{8}","\\d{9}"]
,[,,"528[89]\\d{5}","\\d{9}"]
,[,,"6(?:0[0-6]|[14-7]\\d|2[236-9]|3[03458]|8[01]|99)\\d{6}","\\d{9}"]
,[,,"6(?:0[0-6]|[14-7]\\d|2[2-46-9]|3[03458]|8[01]|99)\\d{6}","\\d{9}"]
,[,,"80\\d{7}","\\d{9}"]
,[,,"89\\d{7}","\\d{9}"]
,[,,"NA","NA"]
@ -2667,7 +2667,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"KW":[,[,,"[12569]\\d{6,7}","\\d{7,8}"]
,[,,"(?:18\\d|2(?:[23]\\d{2}|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7])))\\d{4}","\\d{7,8}"]
,[,,"(?:5(?:0[0-25-9]|11|5\\d)|6(?:0[034679]|5[015-9]|6\\d|7[067]|9[069])|9(?:0[09]|4[049]|6[69]|[79]\\d))\\d{5}","\\d{8}"]
,[,,"(?:5(?:0[0-35-9]|11|5\\d)|6(?:0[034679]|5[015-9]|6\\d|7[067]|9[069])|9(?:0[09]|4[049]|6[69]|[79]\\d))\\d{5}","\\d{8}"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"NA","NA"]
@ -2939,7 +2939,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"MA":[,[,,"[5689]\\d{8}","\\d{9}"]
,[,,"5(?:2(?:(?:[015-7]\\d|2[2-9]|3[2-57]|4[2-8]|8[235-7])\\d|9(?:0\\d|[89]0))|3(?:(?:[0-4]\\d|[57][2-9]|6[235-8]|9[3-9])\\d|8(?:0\\d|[89]0)))\\d{4}","\\d{9}"]
,[,,"6(?:0[0-6]|[14-7]\\d|2[236-9]|3[03458]|8[01]|99)\\d{6}","\\d{9}"]
,[,,"6(?:0[0-6]|[14-7]\\d|2[2-46-9]|3[03458]|8[01]|99)\\d{6}","\\d{9}"]
,[,,"80\\d{7}","\\d{9}"]
,[,,"89\\d{7}","\\d{9}"]
,[,,"NA","NA"]
@ -3089,8 +3089,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,[,,"NA","NA"]
]
,"ML":[,[,,"[246-8]\\d{7}","\\d{8}"]
,[,,"(?:2(?:0(?:2[0-589]|7[027-9])|1(?:2[5-7]|[3-689]\\d))|442\\d)\\d{4}","\\d{8}"]
,[,,"(?:6(?:[3569]\\d)|7(?:[08][1-9]|[3579][0-4]|4[014-7]|[16]\\d))\\d{5}","\\d{8}"]
,[,,"(?:2(?:0(?:2[0-589]|7[027-9])|1(?:2[5-7]|[3-689]\\d))|44[239]\\d)\\d{4}","\\d{8}"]
,[,,"(?:6[3569]|7\\d)\\d{6}","\\d{8}"]
,[,,"800\\d{5}","\\d{8}"]
,[,,"NA","NA"]
,[,,"NA","NA"]
@ -3463,7 +3463,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"NG":[,[,,"[1-69]\\d{5,8}|[78]\\d{5,13}","\\d{5,14}"]
,[,,"[12]\\d{6,7}|9\\d{7}|(?:3\\d|4[023568]|5[02368]|6[02-469]|7[4-69]|8[2-9])\\d{6}|(?:4[47]|5[14579]|6[1578]|7[0-357])\\d{5,6}|(?:78|41)\\d{5}","\\d{5,9}"]
,[,,"(?:1(?:7[34]\\d|8(?:04|[124579]\\d|8[0-3])|95\\d)|287[0-7]|3(?:18[1-8]|88[0-7]|9(?:8[5-9]|6[1-5]))|4(?:28[0-2]|6(?:7[1-9]|8[02-47])|88[0-2])|5(?:2(?:7[7-9]|8\\d)|38[1-79]|48[0-7]|68[4-7])|6(?:2(?:7[7-9]|8\\d)|4(?:3[7-9]|[68][129]|7[04-69]|9[1-8])|58[0-2]|98[7-9])|7(?:38[0-7]|69[1-8]|78[2-4])|8(?:28[3-9]|38[0-2]|4(?:2[12]|3[147-9]|5[346]|7[4-9]|8[014-689]|90)|58[1-8]|78[2-9]|88[5-7])|98[07]\\d)\\d{4}|(?:70(?:[3-9]\\d|2[1-9])|8(?:0[2-9]|1[0-35-9])\\d)\\d{6}","\\d{8,10}"]
,[,,"(?:1(?:7[34]\\d|8(?:04|[124579]\\d|8[0-3])|95\\d)|287[0-7]|3(?:18[1-8]|88[0-7]|9(?:8[5-9]|6[1-5]))|4(?:28[0-2]|6(?:7[1-9]|8[02-47])|88[0-2])|5(?:2(?:7[7-9]|8\\d)|38[1-79]|48[0-7]|68[4-7])|6(?:2(?:7[7-9]|8\\d)|4(?:3[7-9]|[68][129]|7[04-69]|9[1-8])|58[0-2]|98[7-9])|7(?:38[0-7]|69[1-8]|78[2-4])|8(?:28[3-9]|38[0-2]|4(?:2[12]|3[147-9]|5[346]|7[4-9]|8[014-689]|90)|58[1-8]|78[2-9]|88[5-7])|98[07]\\d)\\d{4}|(?:70(?:[3-9]\\d|2[1-9])|8(?:0[2-9]|1\\d)\\d)\\d{6}","\\d{8,10}"]
,[,,"800\\d{7,11}","\\d{10,14}"]
,[,,"NA","NA"]
,[,,"NA","NA"]
@ -3788,7 +3788,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"PL":[,[,,"[1-58]\\d{6,8}|9\\d{8}|[67]\\d{5,8}","\\d{6,9}"]
,[,,"(?:1[2-8]|2[2-59]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-6]|8[1-7])\\d{5,7}|77\\d{4,7}|(?:89|9[145])\\d{7}","\\d{6,9}"]
,[,,"(?:5[013]|6[069]|7[289]|88)\\d{7}","\\d{9}"]
,[,,"(?:5[013]|6[069]|7[2389]|88)\\d{7}","\\d{9}"]
,[,,"800\\d{6}","\\d{9}"]
,[,,"70\\d{7}","\\d{9}"]
,[,,"801\\d{6}","\\d{9}"]
@ -3798,7 +3798,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,"","",0]
,[,"(\\d{2})(\\d{4,6})","$1 $2",["[124]|3[2-4]|5[24-689]|6[1-3578]|7[14-7]|8[1-7]"]
,"","",0]
,[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["39|5[013]|6[0469]|7[0289]|8[08]"]
,[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["39|5[013]|6[0469]|7[02389]|8[08]"]
,"","",0]
,[,"(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]
,"","",0]
@ -4444,7 +4444,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"SY":[,[,,"[1-59]\\d{7,8}","\\d{6,9}"]
,[,,"(?:1(?:1\\d?|4\\d|[2356])|2[1-35]|3(?:[13]\\d|4)|4[13]|5[1-3])\\d{6}","\\d{6,9}"]
,[,,"9(?:22|3[1-356]|4\\d|5[024-7]|6[26-9]|88|9[0-489])\\d{6}","\\d{9}"]
,[,,"9(?:22|[35][0-8]|4\\d|6[024-9]|88|9[0-489])\\d{6}","\\d{9}"]
,[,,"NA","NA"]
,[,,"NA","NA"]
,[,,"NA","NA"]
@ -5038,21 +5038,21 @@ i18n.phonenumbers.metadata.countryToMetadata = {
,,[,,"1(?:12|5)","\\d{2,3}"]
,[,,"NA","NA"]
]
,"ZA":[,[,,"[1-5]\\d{8}|(?:7\\d{4,8}|8[1-5789]\\d{3,7})|8[06]\\d{7}","\\d{5,9}"]
,[,,"(?:1[0-8]|2[1-478]|3[1-69]|4\\d|5[1346-8])\\d{7}","\\d{8,9}"]
,[,,"(?:7[1-4689]|8[1-5789])\\d{3,7}","\\d{5,9}"]
,"ZA":[,[,,"[1-79]\\d{8}|8(?:[067]\\d{7}|[1-4]\\d{3,7})","\\d{5,9}"]
,[,,"(?:1[0-8]|2[0-378]|3[1-69]|4\\d|5[1346-8])\\d{7}","\\d{9}"]
,[,,"(?:6[0-5]|7[0-46-9])\\d{7}|8[1-4]\\d{3,7}","\\d{5,9}"]
,[,,"80\\d{7}","\\d{9}"]
,[,,"86[2-9]\\d{6}","\\d{9}"]
,[,,"86[2-9]\\d{6}|90\\d{7}","\\d{9}"]
,[,,"860\\d{6}","\\d{9}"]
,[,,"NA","NA"]
,[,,"87\\d{7}","\\d{9}"]
,"ZA",27,"00","0",,,"0",,,,[[,"(860)(\\d{3})(\\d{3})","$1 $2 $3",["860"]
,"0$1","",0]
,[,"([1-578]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[1-57]|8(?:[0-57-9]|6[1-9])"]
,[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-79]|8(?:[0-47]|6[1-9])"]
,"0$1","",0]
,[,"(\\d{2})(\\d{3,4})","$1 $2",["7|8[1-5789]"]
,[,"(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"]
,"0$1","",0]
,[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["7|8[1-5789]"]
,[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"]
,"0$1","",0]
]
,,[,,"NA","NA"]
@ -5063,7 +5063,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
]
,"ZM":[,[,,"[289]\\d{8}","\\d{9}"]
,[,,"21[1-8]\\d{6}","\\d{9}"]
,[,,"9(?:5[05]|6[1-9]|7[13-9])\\d{6}","\\d{9}"]
,[,,"9(?:5[05]|6\\d|7[13-9])\\d{6}","\\d{9}"]
,[,,"800\\d{6}","\\d{9}"]
,[,,"NA","NA"]
,[,,"NA","NA"]


+ 7
- 0
javascript/i18n/phonenumbers/phonenumberutil.js View File

@ -1649,6 +1649,13 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.formatNumberForMobileDialing =
// for Movistar. Instead they must be dialled in national format.
formattedNumber = this.format(
numberNoExt, i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
} else if (regionCode == 'AE' && regionCallingFrom == 'AE' &&
(numberType == i18n.phonenumbers.PhoneNumberType.UAN)) {
// In the United Arab Emirates, numbers with the prefix 600 (UAN numbers)
// cannot be dialled using E164 format. Instead they must be dialled in
// national format.
formattedNumber = this.format(
numberNoExt, i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
} else if (regionCode == 'BR' && regionCallingFrom == 'BR' &&
((numberType == i18n.phonenumbers.PhoneNumberType.FIXED_LINE) ||
(numberType == i18n.phonenumbers.PhoneNumberType.MOBILE) ||


+ 13
- 0
javascript/i18n/phonenumbers/phonenumberutil_test.js View File

@ -45,6 +45,12 @@ ALPHA_NUMERIC_NUMBER.setCountryCode(1);
ALPHA_NUMERIC_NUMBER.setNationalNumber(80074935247);
/** @type {i18n.phonenumbers.PhoneNumber} */
var AE_UAN = new i18n.phonenumbers.PhoneNumber();
AE_UAN.setCountryCode(971);
AE_UAN.setNationalNumber(600123456);
/** @type {i18n.phonenumbers.PhoneNumber} */
var AR_MOBILE = new i18n.phonenumbers.PhoneNumber();
AR_MOBILE.setCountryCode(54);
@ -992,6 +998,13 @@ function testFormatNumberForMobileDialing() {
assertEquals('+800 1234 5678',
phoneUtil.formatNumberForMobileDialing(INTERNATIONAL_TOLL_FREE,
RegionCode.JP, true));
// UAE numbers beginning with 600 (classified as UAN) need to be dialled
// without +971 locally.
assertEquals('+971600123456',
phoneUtil.formatNumberForMobileDialing(AE_UAN, RegionCode.JP, false));
assertEquals('600123456',
phoneUtil.formatNumberForMobileDialing(AE_UAN, RegionCode.AE, false));
}
function testFormatByPattern() {


+ 1
- 0
javascript/i18n/phonenumbers/regioncodefortesting.js View File

@ -32,6 +32,7 @@ i18n.phonenumbers.RegionCode = {
// Region code for global networks (e.g. +800 numbers).
UN001: '001',
AD: 'AD',
AE: 'AE',
AO: 'AO',
AQ: 'AQ',
AR: 'AR',


+ 75
- 69
resources/PhoneNumberMetaData.xml View File

@ -2333,11 +2333,11 @@
[49][23]|
5\d|
6[013-57-9]|
7[18]
71
)\d{6}|
8(?:
0[1-9]|
[1-69]\d
[1-79]\d
)\d{5}
</nationalNumberPattern>
<possibleNumberPattern>\d{8}</possibleNumberPattern>
@ -2368,11 +2368,14 @@
<possibleNumberPattern>\d{8}</possibleNumberPattern>
<exampleNumber>90123456</exampleNumber>
</premiumRate>
<sharedCost>
<nationalNumberPattern>87\d{6}</nationalNumberPattern>
<uan>
<!-- Using this for National Rate Services, since
http://www.voipgate.com/site/news/newsflash/new-numbers-available-the-netherlands-and-austria.html
says it will be priced the same as any other national calls. -->
<nationalNumberPattern>78\d{6}</nationalNumberPattern>
<possibleNumberPattern>\d{8}</possibleNumberPattern>
<exampleNumber>87123456</exampleNumber>
</sharedCost>
<exampleNumber>78123456</exampleNumber>
</uan>
<emergency>
<nationalNumberPattern>
1(?:
@ -3390,10 +3393,12 @@
<exampleNumber>2401234</exampleNumber>
</fixedLine>
<mobile>
<!-- 77[01] has been added after numbers in use have been seen online. -->
<nationalNumberPattern>
7(?:
[1-35]\d{6}|
[46][0-7]\d{5}
[46][0-7]\d{5}|
7[01]\d{5}
)
</nationalNumberPattern>
<possibleNumberPattern>\d{8}</possibleNumberPattern>
@ -4216,8 +4221,7 @@
-->
<nationalNumberPattern>
(?:
22|
32|
[23]2|
41|
58
)\d{7}|
@ -4333,7 +4337,7 @@
</territory>
<!-- China -->
<!-- http://www.itu.int/dms_pub/itu-t/oth/02/02/T020200002B0001XLSE.xls -->
<!-- http://www.itu.int/oth/T020200002B/en -->
<territory id="CN" countryCode="86" internationalPrefix="(1[1279]\d{3})?00"
preferredInternationalPrefix="00" nationalPrefix="0"
nationalPrefixForParsing="(1[1279]\d{3})|0">
@ -4405,6 +4409,7 @@
1|
2[37]|
3[12]|
51|
7[13-79]|
9[15]
)|
@ -4441,8 +4446,8 @@
5(?:
3[03-9]|
4[36]|
5|
6[1-6]|
5[02-9]|
6[1-46]|
7[028]|
80|
9[2-46-9]
@ -4510,7 +4515,8 @@
</noInternationalDialling>
<fixedLine>
<!-- 0432 increased to 8 digits on October 24, 2009. 0791 increased to 8 digits on August
28, 2011. 0475 is the prefix for Tongliao but is not in the ITU data. -->
28, 2011. 0551 increased to 8 digits and 0565 was cancelled on Dec 8, 2012. 0475 is
the prefix for Tongliao but is not in the ITU data. -->
<nationalNumberPattern>
21\d{8,10}|
(?:
@ -4528,6 +4534,7 @@
1\d|
2[37]|
3[12]|
51|
7[13-79]|
9[15]
)|
@ -4560,8 +4567,8 @@
5(?:
3[03-9]|
4[36]|
5\d|
6[1-6]|
5[02-9]|
6[1-46]|
7[028]|
80|
9[2-46-9]
@ -4720,10 +4727,11 @@
<exampleNumber>12345678</exampleNumber>
</fixedLine>
<mobile>
<!-- Virgin Mobile Colombia have reported that they are now using the 319 prefix. -->
<nationalNumberPattern>
3(?:
0[0-24]|
1[0-8]|
1\d|
2[01]
)\d{7}
</nationalNumberPattern>
@ -6409,13 +6417,13 @@
<!-- The following sections are copied verbatim from Morocco to allow these non-geographical
numbers to be recognized as available from within Western Sahara. -->
<mobile>
<!-- Prefixes 60[1-5], 62[7-9], 63[0458] and 68[01] are from numbers found online,
<!-- Prefixes 60[1-5], 62[47-9], 63[0458] and 68[01] are from numbers found online,
bug-reports, and information provided directly by the carriers. -->
<nationalNumberPattern>
6(?:
0[0-6]|
[14-7]\d|
2[236-9]|
2[2-46-9]|
3[03458]|
8[01]|
99
@ -13885,11 +13893,13 @@
<possibleNumberPattern>\d{7,8}</possibleNumberPattern>
<exampleNumber>22345678</exampleNumber>
</fixedLine>
<!-- Note that the mobile range starting 503 is not specified in the ITU documentation, but
can be found online as of Dec 2012. -->
<mobile>
<nationalNumberPattern>
(?:
5(?:
0[0-25-9]|
0[0-35-9]|
11|
5\d
)|
@ -15293,13 +15303,13 @@
</fixedLine>
<!-- Also duplicated in Western Sahara, please ensure you update both. -->
<mobile>
<!-- Prefixes 60[1-5], 62[7-9], 63[0458] and 68[01] are from numbers found online,
<!-- Prefixes 60[1-5], 62[47-9], 63[0458] and 68[01] are from numbers found online,
bug-reports, and information provided directly by the carriers. -->
<nationalNumberPattern>
6(?:
0[0-6]|
[14-7]\d|
2[236-9]|
2[2-46-9]|
3[03458]|
8[01]|
99
@ -15900,7 +15910,7 @@
<possibleNumberPattern>\d{8}</possibleNumberPattern>
</generalDesc>
<fixedLine>
<!-- 20 70 seems a common pattern, in addition to 21 25. -->
<!-- 21 25 seems a common pattern based on online searches. -->
<nationalNumberPattern>
(?:
2(?:
@ -15913,25 +15923,20 @@
[3-689]\d
)
)|
442\d
44[239]\d
)\d{4}
</nationalNumberPattern>
<exampleNumber>20212345</exampleNumber>
</fixedLine>
<mobile>
<!-- Adding 63 and 71 from numbers found online. -->
<!-- Adding 63 from numbers found online. -->
<!-- Orange Mali have updated their numbering plan, though this is not reflected in the ITU
document (which is very stale). All mobile numbers starting with 7 are now Orange. -->
<nationalNumberPattern>
(?:
6(?:
[3569]\d
)|
7(?:
[08][1-9]|
[3579][0-4]|
4[014-7]|
[16]\d
)
)\d{5}
6[3569]|
7\d
)\d{6}
</nationalNumberPattern>
<exampleNumber>65012345</exampleNumber>
</mobile>
@ -17683,7 +17688,7 @@
</fixedLine>
<mobile>
<!-- More 81X prefixes have been added based on online numbers, including the prefix 817
from Etisalat, and 811 from Glo. Furthermore, the fixed-line prefixes owned by
from Etisalat, 814 MTN and 811 from Glo. Furthermore, the fixed-line prefixes owned by
Starcomms have apparently, according to the company, been used for mobile numbers too,
despite the ITU plan, so we list them here as well. -->
<nationalNumberPattern>
@ -17766,7 +17771,7 @@
)|
8(?:
0[2-9]|
1[0-35-9]
1\d
)\d
)\d{6}
</nationalNumberPattern>
@ -19300,7 +19305,7 @@
39|
5[013]|
6[0469]|
7[0289]|
7[02389]|
8[08]
</leadingDigits>
<format>$1 $2 $3</format>
@ -19349,7 +19354,7 @@
(?:
5[013]|
6[069]|
7[289]|
7[2389]|
88
)\d{7}
</nationalNumberPattern>
@ -21852,15 +21857,14 @@
<exampleNumber>112345678</exampleNumber>
</fixedLine>
<mobile>
<!-- Numbers have been found on the Internet for the prefixes 922, 936, 94[0168], 95[0247],
and 96[78]. -->
<!-- Numbers have been found on the Internet for the prefixes 922, 93[046-8],
95[138], and 96[05]. -->
<nationalNumberPattern>
9(?:
22|
3[1-356]|
[35][0-8]|
4\d|
5[024-7]|
6[26-9]|
6[024-9]|
88|
9[0-489]
)\d{6}
@ -24759,63 +24763,62 @@
<leadingDigits>860</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
<numberFormat pattern="([1-578]\d)(\d{3})(\d{4})">
<numberFormat pattern="(\d{2})(\d{3})(\d{4})">
<leadingDigits>
[1-57]|
[1-79]|
8(?:
[0-57-9]|
[0-47]|
6[1-9]
)
</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
<numberFormat pattern="(\d{2})(\d{3,4})">
<leadingDigits>
7|
8[1-5789]
</leadingDigits>
<leadingDigits>8[1-4]</leadingDigits>
<format>$1 $2</format>
</numberFormat>
<numberFormat pattern="(\d{2})(\d{3})(\d{2,3})">
<leadingDigits>
7|
8[1-5789]
</leadingDigits>
<leadingDigits>8[1-4]</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
</availableFormats>
<generalDesc>
<nationalNumberPattern>
[1-5]\d{8}|
(?:
7\d{4,8}|
8[1-5789]\d{3,7}
)|
8[06]\d{7}
[1-79]\d{8}|
8(?:
[067]\d{7}|
[1-4]\d{3,7}
)
</nationalNumberPattern>
<possibleNumberPattern>\d{5,9}</possibleNumberPattern>
</generalDesc>
<fixedLine>
<!-- Wikipedia is missing 020, and the 024 code it lists for Somerset West stopped being
used in 1996. -->
<nationalNumberPattern>
(?:
1[0-8]|
2[1-478]|
2[0-378]|
3[1-69]|
4\d|
5[1346-8]
)\d{7}
</nationalNumberPattern>
<possibleNumberPattern>\d{8,9}</possibleNumberPattern>
<possibleNumberPattern>\d{9}</possibleNumberPattern>
<exampleNumber>101234567</exampleNumber>
</fixedLine>
<mobile>
<!-- Wikipedia says 085 is for cellular: ITU says it is protected. Also note that we are
still supporting numbers beginning with 8 that are fewer than 9 digits since they are
in prominent places online, even though the ITU document says numbers must be 10 digits
long (including the national prefix). -->
<nationalNumberPattern>
(?:
7[1-4689]|
8[1-5789]
)\d{3,7}
6[0-5]|
7[0-46-9]
)\d{7}|
8[1-4]\d{3,7}
</nationalNumberPattern>
<possibleNumberPattern>\d{5,9}</possibleNumberPattern>
<exampleNumber>711234567</exampleNumber>
</mobile>
<tollFree>
@ -24824,7 +24827,10 @@
<exampleNumber>801234567</exampleNumber>
</tollFree>
<premiumRate>
<nationalNumberPattern>86[2-9]\d{6}</nationalNumberPattern>
<nationalNumberPattern>
86[2-9]\d{6}|
90\d{7}
</nationalNumberPattern>
<possibleNumberPattern>\d{9}</possibleNumberPattern>
<exampleNumber>862345678</exampleNumber>
</premiumRate>
@ -24885,11 +24891,11 @@
<mobile>
<!-- Adding extra prefixes 50, 6[1-57-9] and 7[13-6] since SMS messages have been
successfully delivered to these numbers, and numbers like this can be found on the
Internet. -->
Internet. Adding prefix 960 based on information received from MTN Zambia. -->
<nationalNumberPattern>
9(?:
5[05]|
6[1-9]|
6\d|
7[13-9]
)\d{6}
</nationalNumberPattern>


+ 15
- 1
resources/PhoneNumberMetaDataForTesting.xml View File

@ -25,6 +25,20 @@
<territory id="AD" countryCode="376" internationalPrefix="00">
</territory>
<!-- United Arab Emirates -->
<!-- Added since when formatting the number for mobile dialling we have special rules to handle
it. -->
<territory id="AE" countryCode="971" internationalPrefix="00">
<generalDesc>
<nationalNumberPattern>[1-9]\d{8}</nationalNumberPattern>
<possibleNumberPattern>\d{9}</possibleNumberPattern>
</generalDesc>
<uan>
<nationalNumberPattern>600\d{6}</nationalNumberPattern>
<exampleNumber>600123456</exampleNumber>
</uan>
</territory>
<!-- Angola -->
<!-- This country has been coopted to test the case of a national prefix
with a non-numeric symbol in it. -->
@ -43,7 +57,7 @@
<exampleNumber>222123456</exampleNumber>
</fixedLine>
<mobile>
<!-- Expanded the 92 prefix possibilities to matchnumbers found online. -->
<!-- Expanded the 92 prefix possibilities to match numbers found online. -->
<nationalNumberPattern>9[1-3]\d{7}</nationalNumberPattern>
<exampleNumber>923123456</exampleNumber>
</mobile>


+ 2
- 1
resources/geocoding/en/27.txt View File

@ -14,6 +14,7 @@
# Generated from:
# Internal statistical data (2011-08-05).
# 2720 prefix from the South African ITU document 2012-12-05.
2710|Johannesburg
2711|Johannesburg
@ -24,10 +25,10 @@
2716|Vereeniging
2717|Ermelo
2718|Klerksdorp
2720|Fraserberg/Leeugamka/Merweville
2721|Cape Town
2722|Malmesbury
2723|Worcester
2724|Cape Town
2727|Vredendal
2728|Hermanus
2731|Durban


+ 57
- 0
resources/geocoding/en/32.txt View File

@ -0,0 +1,57 @@
# Copyright (C) 2013 The Libphonenumber Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Data from http://detelefoon.be/zonenummers/telefoonzones-op-zonenummer,
# translated into English by wikipedia.
3210|Wavre
3211|Hasselt
3212|Tongeren
3213|Diest
3214|Herentals
3215|Mechelen
3216|Leuven
3219|Waremme
322|Brussels
323|Antwerp
324|Liège
3250|Bruges
3251|Roeselare
3252|Dendermonde
3253|Aalst
3254|Ninove
3255|Ronse
3256|Kortrijk
3257|Ypres
3258|Veurne
3259|Ostend
3260|Chimay
3261|Libramont-Chevigny
3263|Arlon
3264|La Louvière
3265|Mons
3267|Nivelles
3268|Ath
3269|Tournai
3271|Charleroi
3280|Stavelot
3281|Namur
3282|Dinant
3283|Ciney
3284|Marche-en-Famenne
3285|Huy
3286|Durbuy
3287|Verviers
3289|Genk
329|Ghent

+ 0
- 1
resources/geocoding/en/86.txt View File

@ -149,7 +149,6 @@
86562|Tongling, Anhui
86563|Xuancheng, Anhui
86564|LiuAn, Anhui
86565|Chaohu, Anhui
86566|Chizhou, Anhui
86570|Quzhou, Zhejiang
86571|Hangzhou, Zhejiang


+ 57
- 0
resources/geocoding/fr/32.txt View File

@ -0,0 +1,57 @@
# Copyright (C) 2013 The Libphonenumber Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Data from http://detelefoon.be/zonenummers/telefoonzones-op-zonenummer,
# translated into French by wikipedia.
3210|Wavre
3211|Hasselt
3212|Tongres
3213|Diest
3214|Herentals
3215|Malines
3216|Louvain
3219|Waremme
322|Bruxelles
323|Anvers
324|Liège
3250|Bruges
3251|Roulers
3252|Termonde
3253|Alost
3254|Ninove
3255|Renaix
3256|Courtrai
3257|Ypres
3258|Furnes
3259|Ostende
3260|Chimay
3261|Libramont-Chevigny
3263|Arlon
3264|La Louvière
3265|Mons
3267|Nivelles
3268|Ath
3269|Tournai
3271|Charleroi
3280|Stavelot
3281|Namur
3282|Dinant
3283|Ciney
3284|Marche-en-Famenne
3285|Huy
3286|Durbuy
3287|Verviers
3289|Genk
329|Gand

+ 57
- 0
resources/geocoding/nl/32.txt View File

@ -0,0 +1,57 @@
# Copyright (C) 2013 The Libphonenumber Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Data from http://detelefoon.be/zonenummers/telefoonzones-op-zonenummer with
# the accent re-added in La Louvière and spelling fixed for Charleroi.
3210|Waver
3211|Hasselt
3212|Tongeren
3213|Diest
3214|Herentals
3215|Mechelen
3216|Leuven
3219|Borgworm
322|Brussel
323|Antwerpen
324|Luik
3250|Brugge
3251|Roeselare
3252|Dendermonde
3253|Aalst
3254|Ninove
3255|Ronse
3256|Kortrijk
3257|Ieper
3258|Veurne
3259|Oostende
3260|Chimay
3261|Libramont-Chevigny
3263|Aarlen
3264|La Louvière
3265|Bergen
3267|Nijvel
3268|Aat
3269|Doornik
3271|Charleroi
3280|Stavelot
3281|Namen
3282|Dinant
3283|Ciney
3284|Marche-en-Famenne
3285|Hoei
3286|Durbuy
3287|Verviers
3289|Genk
329|Gent

+ 0
- 1
resources/geocoding/zh/86.txt View File

@ -148,7 +148,6 @@
86562|安徽省铜陵市
86563|安徽省宣城市
86564|安徽省六安市
86565|安徽省巢湖市
86566|安徽省池州市
86570|浙江省衢州市
86571|浙江省杭州市


Loading…
Cancel
Save