From 9b5fab1931a64f316a7976241432fbfd1c26c73c Mon Sep 17 00:00:00 2001 From: Lara Scheidegger Date: Thu, 20 Jan 2011 14:26:34 +0000 Subject: [PATCH] Metadata changes, new countries, small code changes. --- java/release_notes.txt | 20 + .../phonenumbers/BuildMetadataFromXml.java | 17 +- .../phonenumbers/src/PhoneNumberMetaData.xml | 2017 ++++++++++++++--- .../i18n/phonenumbers/PhoneNumberUtil.java | 121 +- .../data/PhoneNumberMetadataProto_AM | Bin 497 -> 499 bytes .../data/PhoneNumberMetadataProto_BH | Bin 340 -> 409 bytes .../data/PhoneNumberMetadataProto_BZ | Bin 128 -> 361 bytes .../data/PhoneNumberMetadataProto_CD | Bin 334 -> 336 bytes .../data/PhoneNumberMetadataProto_CG | Bin 243 -> 323 bytes .../data/PhoneNumberMetadataProto_CR | Bin 237 -> 351 bytes .../data/PhoneNumberMetadataProto_CU | Bin 129 -> 415 bytes .../data/PhoneNumberMetadataProto_DE | Bin 1489 -> 1615 bytes .../data/PhoneNumberMetadataProto_DJ | Bin 267 -> 250 bytes .../data/PhoneNumberMetadataProto_EC | Bin 128 -> 546 bytes .../data/PhoneNumberMetadataProto_EE | Bin 667 -> 749 bytes .../data/PhoneNumberMetadataProto_FO | Bin 122 -> 344 bytes .../data/PhoneNumberMetadataProto_GB | Bin 2644 -> 2706 bytes .../data/PhoneNumberMetadataProto_GI | Bin 122 -> 292 bytes .../data/PhoneNumberMetadataProto_GN | Bin 362 -> 363 bytes .../data/PhoneNumberMetadataProto_HN | Bin 128 -> 440 bytes .../data/PhoneNumberMetadataProto_HT | Bin 128 -> 311 bytes .../data/PhoneNumberMetadataProto_HU | Bin 461 -> 463 bytes .../data/PhoneNumberMetadataProto_IE | Bin 1053 -> 1154 bytes .../data/PhoneNumberMetadataProto_JO | Bin 517 -> 521 bytes .../data/PhoneNumberMetadataProto_JP | Bin 4357 -> 4538 bytes .../data/PhoneNumberMetadataProto_LB | Bin 471 -> 463 bytes .../data/PhoneNumberMetadataProto_LK | Bin 128 -> 371 bytes .../data/PhoneNumberMetadataProto_LR | Bin 346 -> 367 bytes .../data/PhoneNumberMetadataProto_MA | Bin 684 -> 691 bytes .../data/PhoneNumberMetadataProto_MK | Bin 464 -> 560 bytes .../data/PhoneNumberMetadataProto_MN | Bin 541 -> 666 bytes .../data/PhoneNumberMetadataProto_MR | Bin 327 -> 486 bytes .../data/PhoneNumberMetadataProto_MT | Bin 130 -> 404 bytes .../data/PhoneNumberMetadataProto_MV | Bin 129 -> 334 bytes .../data/PhoneNumberMetadataProto_NA | Bin 878 -> 804 bytes .../data/PhoneNumberMetadataProto_NU | Bin 128 -> 190 bytes .../data/PhoneNumberMetadataProto_PG | Bin 420 -> 418 bytes .../data/PhoneNumberMetadataProto_PS | Bin 128 -> 513 bytes .../data/PhoneNumberMetadataProto_SC | Bin 517 -> 603 bytes .../data/PhoneNumberMetadataProto_SD | Bin 128 -> 271 bytes .../data/PhoneNumberMetadataProto_SG | Bin 419 -> 524 bytes .../data/PhoneNumberMetadataProto_SO | Bin 310 -> 310 bytes .../data/PhoneNumberMetadataProto_SZ | Bin 424 -> 450 bytes .../data/PhoneNumberMetadataProto_VN | Bin 932 -> 930 bytes .../data/PhoneNumberMetadataProto_ZA | Bin 370 -> 473 bytes .../data/PhoneNumberMetadataProto_ZW | Bin 1531 -> 1518 bytes .../phonenumbers/PhoneNumberUtilTest.java | 81 + 47 files changed, 1841 insertions(+), 415 deletions(-) diff --git a/java/release_notes.txt b/java/release_notes.txt index 860189c63..4206e3a8b 100644 --- a/java/release_notes.txt +++ b/java/release_notes.txt @@ -1,3 +1,23 @@ +Jan 20th, 2011 +* Code improvements: + - Handle null phone-numbers when parsing by throwing a NumberParseException. + - Handle extension written with an accented "o", as per Spanish, when parsing. + - Handle U+30FC dashes as phone-number punctuation. + - Allow "ZZ" or null regions to be specified for numbers starting with a full-width "+" symbol, or + with other characters (such as whitespace) before the leading +. + - new getLengthOfNationalDestinationCode function +* Metadata changes: + - New types of numbers introduced: UAN (universal or "company" numbers) and short codes. Note that + "generalDesc" patterns do not encompass short-codes. No code-support for these has been + introduced as of yet. We are also now enabling the collection of data for information such as + area-code-optional, and no-international-dialling ranges. + - Data updates as per ITU notifications/bug fixes for the following countries: AM, BH, CD, CG, CR, + DE, DJ, EE, GB, GN, HU, IE, JO, JP, LB, LR, MA, MK, MN, MR, NA, PG, SC, SG, SO, SZ, VN, ZA, ZW + - Data added for the following countries: BZ, CU, EC, FO, GI, HN, HT, LK, MT, MV, NU, PS, SD + - Indentation fixes in reg-exes for the following countries: BG, GB + - Allow nationalPrefixForParsing to be specified for countries with no national prefix, to handle + possible carrier prefixes + Jan 3rd, 2011 * Metadata changes: - Updates to JE diff --git a/java/resources/com/google/i18n/phonenumbers/BuildMetadataFromXml.java b/java/resources/com/google/i18n/phonenumbers/BuildMetadataFromXml.java index 1f2b77b76..5c2ef7a4e 100644 --- a/java/resources/com/google/i18n/phonenumbers/BuildMetadataFromXml.java +++ b/java/resources/com/google/i18n/phonenumbers/BuildMetadataFromXml.java @@ -126,20 +126,21 @@ public class BuildMetadataFromXml { String nationalPrefix = ""; String nationalPrefixFormattingRule = ""; String carrierCodeFormattingRule = ""; + if (element.hasAttribute("nationalPrefixForParsing")) { + metadata.setNationalPrefixForParsing( + validateRE(element.getAttribute("nationalPrefixForParsing"))); + if (element.hasAttribute("nationalPrefixTransformRule")) { + metadata.setNationalPrefixTransformRule( + validateRE(element.getAttribute("nationalPrefixTransformRule"))); + } + } if (element.hasAttribute("nationalPrefix")) { nationalPrefix = element.getAttribute("nationalPrefix"); metadata.setNationalPrefix(nationalPrefix); nationalPrefixFormattingRule = validateRE(getNationalPrefixFormattingRuleFromElement(element, nationalPrefix)); - if (element.hasAttribute("nationalPrefixForParsing")) { - metadata.setNationalPrefixForParsing( - validateRE(element.getAttribute("nationalPrefixForParsing"))); - if (element.hasAttribute("nationalPrefixTransformRule")) { - metadata.setNationalPrefixTransformRule( - validateRE(element.getAttribute("nationalPrefixTransformRule"))); - } - } else { + if (!metadata.hasNationalPrefixForParsing()) { metadata.setNationalPrefixForParsing(nationalPrefix); } } diff --git a/java/resources/com/google/i18n/phonenumbers/src/PhoneNumberMetaData.xml b/java/resources/com/google/i18n/phonenumbers/src/PhoneNumberMetaData.xml index abf008a0f..fb011b205 100644 --- a/java/resources/com/google/i18n/phonenumbers/src/PhoneNumberMetaData.xml +++ b/java/resources/com/google/i18n/phonenumbers/src/PhoneNumberMetaData.xml @@ -16,28 +16,33 @@ @author: Lara Rennie MetaData on Phone Number Plan and formatting rules - Note: Territories are in alphabetical order by their IDs, which are - based on ISO 3166-1 two-letter country codes. The country names - in the comments are the official short names in English according - to ISO 3166-1. + Note: Territories are in alphabetical order by their IDs, which are based on ISO 3166-1 + two-letter country codes. The country names in the comments are the official short names + in English according to ISO 3166-1. For more information on what each element represents, see java/com/google/i18n/phonenumbers/phonemetadata.proto - Note that if you want to add validation metadata, the generalDesc - nationalNumberPattern and possibleNumberPattern must be provided. - If this is missing, then the country will be considered to have no more - specific phone-number type metadata (fixedLine, mobile etc) and hence only - basic validation rules (numbers should be between 3 and 15 digits long) - will be applied. + Note that if you want to add validation metadata, the generalDesc nationalNumberPattern and + possibleNumberPattern must be provided. If this is missing, then the country will be + considered to have no more specific phone-number type metadata (fixedLine, mobile etc) and + hence only basic validation rules (numbers should be between 3 and 15 digits long) will be + applied. + + Country code, international and national prefix information main source: + http://www.itu.int/publ/T-SP-E.164C-2010/en --> - + + + @@ -46,6 +51,8 @@ + + @@ -72,7 +79,7 @@ - ]> +]> @@ -448,7 +455,7 @@ [17]| - 9[1-49] + 9[1-469] $1 $2 @@ -490,7 +497,7 @@ (?: 77| - 9[1-49] + 9[1-469] )\d{6} \d{8} @@ -511,6 +518,14 @@ \d{8} 80112345 + + + 8[1-7]\d{2}| + 1\d{2} + + \d{3,4} + 8711 + @@ -1785,8 +1800,23 @@ - (?:2\d|[36]\d|5[1-9]|8[1-6]|9[1-7])\d{5,6}| - (?:4(?:[124-7]\d|3[1-6])|7(?:0[1-9]|[1-9]\d))\d{4,5} + (?: + 2\d| + [36]\d| + 5[1-9]| + 8[1-6]| + 9[1-7] + )\d{5,6}| + (?: + 4(?: + [124-7]\d| + 3[1-6] + )| + 7(?: + 0[1-9]| + [1-9]\d + ) + )\d{4,5} \d{7,8} 2123456 @@ -1823,6 +1853,7 @@ + @@ -1830,7 +1861,7 @@ - [1367]\d{7} + [136-9]\d{7} \d{8} + + + (?: + 87| + 9[014578] + )\d{6} + + 90123456 + + + 84\d{6} + 84123456 + @@ -2527,8 +2577,51 @@ - + + + + + + [2-8] + + $1-$2 + + + 0 + $1-$2-$3-$4 + + + + + [2-8]\d{6}| + 0\d{10} + + \d{7}(?:\d{4})? + + + [234578][02]\d{5} + \d{7} + 2221234 + + + + 6(?: + [01]\d| + 2[0-5]| + [67][01])\d{4} + + \d{7} + 6221234 + + + + 0800\d{7} + \d{11} + 08001234123 + @@ -2695,7 +2788,7 @@ (?: - 8[0149]| + 8[0-2489]| 9[7-9] )\d{7} @@ -2734,29 +2827,32 @@ - - $1 $2 + + [02] + $1 $2 $3 + + + 8 + $1 $2 $3 - [24-68]\d{6} - \d{7} + [028]\d{8} + \d{9} - - - (?: - 2[1-589]| - 8\d - )\d{5} - - 2123456 + 222[1-589]\d{5} + 222123456 - [4-6]\d{6} - 5012345 + 0[14-6]\d{7} + 061234567 + + + 800\d{6} + 800123456 + @@ -3453,27 +3549,87 @@ - + + + 2| + 8[389] + $1 $2 + + [89]0 + $1-$2-$3 + - [28]\d{7} - \d{8} + [289]\d{7,9} + \d{8,10} 2[24-7]\d{6} + \d{8} 22123456 - 8[38]\d{6} + 8[389]\d{6} + \d{8} 83123456 + + 800\d{7} + \d{10} + 8001234567 + + + + 90[059]\d{7} + \d{10} + 9001234567 + + + nationalPrefix="0" nationalPrefixFormattingRule="($NP$FG)"> + + + 7 + $1 $2 + + + [2-4] + $1 $2 + + + 5 + $1 $2 + + + + [2-57]\d{5,7} + \d{4,8} + + + + (?: + 2[1-4]\d{5,6}| + 3(?: + 1\d{6}| + [23]\d{4,6})| + 4(?: + [125]\d{5,6}| + [36]\d{6}| + [78]\d{4,6})| + 7\d{6,7}) + + 71234567 + + + 5\d{7} + \d{8} + 51234567 + @@ -3610,7 +3766,7 @@ - + @@ -3771,32 +3927,43 @@ stricter for numbers starting with 49, to try and remove the country code if the number begins with 49 whenever possible. --> - (?: - 4[0-8]| - [1-35-9]\d - )\d{4,12}| - 49(?: - 4[1-8]| - [0-35-7]\d - )\d{2,7} + [1-35-9]\d{3,13}| + 4(?: + [0-8]\d{4,12}| + 9(?: + 4[1-8]| + [0-35-7]\d + )\d{2,7} + ) \d{2,14} + - (?: - [246]\d{2}| - 3[02-9]\d| - 5(?: - 0[2-8]| - [38][0-8]| - [124-6]\d| - [79][0-7] - )| - [789](?: - [1-9]\d| - 0[2-9] - ) + [246]\d{5,13}| + 3(?: + [03-9]\d{4,11}| + 2\d{9} + )| + 5(?: + 0[2-8]| + [38][0-8]| + [124-6]\d| + [79][0-7] + )\d{3,10}| + 7(?: + 0[2-8]| + [1-9]\d + )\d{3,10}| + 8(?: + 0[2-9]| + [1-9]\d + )\d{3,10}| + 9(?: + 0[6-9]| + [1-9]\d )\d{3,10} 30123456 @@ -3812,13 +3979,25 @@ [0-57-9]| 6\d )\d{7}| - 6[02]\d{7,8}| - 63\d{7} + 6(?: + [02]\d{7,8}| + 3\d{7} + ) ) \d{10,11} 15123456789 + + + 16(?: + 4\d{1,10}| + [89]\d{1,11} + ) + + \d{4,14} + 16412345 + 800\d{7,9} \d{10,12} @@ -3854,35 +4033,26 @@ - + $1 $2 $3 - [2-8]\d{5} + [1-8]\d{5} \d{6} - + (?: - 25| - 3[0-6]| - 42 + 1[05]| + [2-5]\d )\d{4} 251234 - - - (?: - [5-7]\d| - 8[0-7] - )\d{4} - + [6-8]\d{5} 601234 @@ -4117,17 +4287,72 @@ + + + + + nationalPrefix="0" nationalPrefixFormattingRule="($NP$FG)"> + + + [2-7] + $1 $2-$3 + + + [2-7] + $1-$2-$3 + + + [89] + $1 $2 $3 + + + [89] + $1 $2 $3 + + + 1 + $1 $2 $3 + + + 1 + $1 $2 $3 + + + + [2-9]\d{7}|1\d{9,10} + \d{7,11} + + + [2-7][2-7]\d{6} + \d{7,8} + 22123456 + + + [89]\d{7} + \d{8} + 99123456 + + + 1800\d{6,7} + \d{10,11} + 18001234567 + + + - [34679]| + [3679]| + 4[3-8]| 5(?: [0-2]| 5[0-478]| @@ -4135,7 +4360,8 @@ ) - [34679]| + [3679]| + 4[3-8]| 5(?: [02]| 1(?: @@ -4151,13 +4377,18 @@ $1 $2 + + 70 + $1 $2 $3 + 800 8000 $1 $2 $3 - + + 40| 5| 8(?: 00| @@ -4165,6 +4396,7 @@ ) + 40| 5| 8(?: 00[1-9]| @@ -4181,17 +4413,26 @@ \d{6,10} + + 800[2-9]\d{3} + \d{7} + 8002123 + + (?: 3[23589]| - 4[3-8]| + 4(?: + 0\d| + [3-8] + )| 6\d| 7[1-9]| 88 )\d{5} - \d{7} + \d{7,8} 3212345 @@ -4233,10 +4474,17 @@ 9001234 - 70\d{5} - \d{7} - 7012345 + + 70[0-2]?\d{5} + \d{7,8} + 70012345 + + 1[1-9]\d + \d{3} + 112 + @@ -4673,7 +4921,69 @@ - + + + + [2-9]\d{5} + \d{6} + + + + (?: + 20| + [3-4]\d| + 8[19] + )\d{4} + + 201234 + + + + (?: + 2[1-9]| + 5\d| + 7[1-79] + )\d{4} + + 211234 + + + 80[257-9]\d{3} + 802123 + + + + 90(?: + [1345][15-7]| + 2[125-7]| + 99 + )\d{2} + + 901123 + + + + (?: + 6[0-36]| + 88 + )\d{4} + + 601234 + + + + + 1(?: + 1[248]| + 4[124]\d| + 71\d| + 8[7-9]\d + ) + + \d{3,4} + 211234 + @@ -4940,31 +5250,324 @@ \d{7,10} \d{4,10} - + + + + 2\d[2-9]\d{7}| + 1(?: + 1\d| + \d1 + )[2-9]\d{6}| + 1(?: + [248][02-9]\d[2-9]\d{4,5}| + (?: + 3(?: + [02-79]\d| + 8[0-69] + )| + 5(?: + [04-9]\d| + 2[0-35-9]| + 3[0-8] + )| + 6(?: + [02-8]\d| + 9[0-689] + )| + 7(?: + [02-5789]\d| + 6[0-79] + )| + 9(?: + [0235-9]\d| + 4[0-5789] + ) + )[2-9]\d{4,5}| + (?: + 387(?: + 3[2-9]| + [24-9]\d + )| + 5(?: + 24(?: + 2[2-9]| + [3-9]\d + )| + 39(?: + [4-6][2-9]| + [237-9]\d + ) + )| + 697(?: + [347][2-9]| + [25689]\d + )| + 768(?: + [347][2-9]| + [25679]\d + )| + 946(?: + 7[2-9]| + [2-689]\d + ) + )\d{3,4} + ) + + \d{9,10} + 1332456789 + + - - 1(?:1[3-8]|[2-69]1)\d{7}| - 1(?:2(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-4789]|7[013-9]|9\d)| - 3(?:0\d|[25][02-9]|3[02-579]|[468][0-46-9]|7[1235679]|9[24578])| - 4(?:0[03-9]|2[02-5789]|[37]\d|4[02-69]|5[0-8]|[69][0-79]|8[02-5789])| - 5(?:0[1235-9]|2[024-9]|3[015689]|4[02-9]|5[03-9]|6\d|7[0-35-9]|8[0-468]|9[0-5789])| - 6(?:0[034689]|2[0-35689]|3[013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|8[013-9]|9[0124578])| - 7(?:0[0246-9]|2\d|3[023678]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])| - 8(?:0[35-9]|2[1-5789]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\d|8[02-9]|9[02569])| - 9(?:0[02-589]|2[02-689]|3[1-5789]|4[2-9]|5[0-579]|6[234789]|7[0124578]|8\d|9[2-57]))\d{6}| - 1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-4789]|8[345])))| - 3(?:638[2-5]|647[23]|8(?:47[04-9]|64[015789]))| - 4(?:044[1-7]|20(?:2[23]|8\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[123]))| - 5(?:24(?:3[2-79]|6\d)|276\d|6(?:26[06-9]|686))| - 6(?:06(?:4\d|7[4-79])|295[567]|35[34]\d|47(?:24|61)|59(?:5[08]|6[67]|74)|955[0-4])| - 7(?:26(?:6[13-9]|7[0-7])|442\d|50(?:2[0-3]|[3-68]2|76))| - 8(?:27[56]\d|37(?:5[2-5]|8[239])|84(?:3[2-58]))| - 9(?:0(?:0(?:6[1-8]|85)|52\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\d{3}| + + + 2(?: + 0[01378]| + 3[0189]| + 4[017]| + 8[0-46-9]| + 9[012] + )\d{7}| + 1(?: + (?:1 + (?:3[0-48]| + [46][0-4]| + 5[012789]| + 7[0-39]| + 8[01349] + )| + 21[0-7]| + 31[0-8]| + [459]1\d| + 61[01246-9] + ) + )\d{6}| + 1(?: + 2(?: + 0[024-9]| + 2[3-9]| + 3[3-79]| + 4[1-689]| + [58][02-9]| + 6[0-4789]| + 7[013-9]| + 9\d + )| + 3(?: + 0\d| + [25][02-9]| + 3[02-579]| + [468][0-46-9]| + 7[1235679]| + 9[24578] + )| + 4(?: + 0[03-9]| + [28][02-5789]| + [37]\d| + 4[02-69]| + 5[0-8]| + [69][0-79] + )| + 5(?: + 0[1235-9]| + 2[024-9]| + 3[015689]| + 4[02-9]| + 5[03-9]| + 6\d| + 7[0-35-9]| + 8[0-468]| + 9[0-5789] + )| + 6(?: + 0[034689]| + 2[0-35689]| + [38][013-9]| + 4[1-467]| + 5[0-69]| + 6[13-9]| + 7[0-8]| + 9[0124578] + )| + 7(?: + 0[0246-9]| + 2\d| + 3[023678]| + 4[03-9]| + 5[0-46-9]| + 6[013-9]| + 7[0-35-9]| + 8[024-9]| + 9[02-9] + )| + 8(?: + 0[35-9]| + 2[1-5789]| + 3[02-578]| + 4[0-578]| + 5[124-9]| + 6[2-69]| + 7\d| + 8[02-9]| + 9[02569] + )| + 9(?: + 0[02-589]| + 2[02-689]| + 3[1-5789]| + 4[2-9]| + 5[0-579]| + 6[234789]| + 7[0124578]| + 8\d| + 9[2-57] + ) + )\d{6}| + 1(?: + 2(?: + 0(?: + 46[1-4]| + 87[2-9] + )| + 545[1-79]| + 76(?: + 2\d| + 3[1-8]| + 6[1-6] + )| + 9(?: + 7(?: + 2[0-4]| + 3[2-5] + )| + 8(?: + 2[2-8]| + 7[0-4789]| + 8[345] + ) + ) + )| + 3(?: + 638[2-5]| + 647[23]| + 8(?: + 47[04-9]| + 64[015789] + ) + )| + 4(?: + 044[1-7]| + 20(?: + 2[23]| + 8\d + )| + 6(?: + 0(?: + 30| + 5[2-57]| + 6[1-8]| + 7[2-8] + )| + 140 + )| + 8(?: + 052| + 87[123] + ) + )| + 5(?: + 24(?: + 3[2-79]| + 6\d + )| + 276\d| + 6(?: + 26[06-9]| + 686 + ) + )| + 6(?: + 06(?: + 4\d| + 7[4-79] + )| + 295[567]| + 35[34]\d| + 47(?: + 24| + 61 + )| + 59(?: + 5[08]| + 6[67]| + 74 + )| + 955[0-4] + )| + 7(?: + 26(?: + 6[13-9]| + 7[0-7] + )| + 442\d| + 50(?: + 2[0-3]| + [3-68]2| + 76 + ) + )| + 8(?: + 27[56]\d| + 37(?: + 5[2-5]| + 8[239] + )| + 84(?: + 3[2-58] + ) + )| + 9(?: + 0(?: + 0(?: + 6[1-8]| + 85 + )| + 52\d + )| + 3583| + 4(?: + 66[1-8]| + 9(?: + 2[01]| + 81 + ) + )| + 63(?: + 23| + 3[1-4] + )| + 9561 + ) + )\d{3}| 176888[234678]\d{2}| 16977[23]\d{3}| - 2(?:0[01378]|3[0189]|4[017]|8[0-46-9]|9[012])\d{7}| - (?:3[0347]|55)\d{8} + (?: + 3[0347]| + 55 + )\d{8} + 1212345678 @@ -5075,6 +5678,16 @@ \d{10} 5612345678 + + + (?: + 3[0347]| + 55 + )\d{8} + + \d{10} + 5512345678 + @@ -5407,6 +6020,71 @@ + + + [2568]\d{7} + \d{8} + + + + 2(?: + 00\d| + 16[0-7]| + 22[2457] + )\d{4} + + 20012345 + + + + (?: + 5[4-8]| + 60 + )\d{6} + + 57123456 + + + 80\d{6} + 80123456 + + + 8[1-689]\d{6} + 88123456 + + + 87\d{6} + 87123456 + + + + 1(?: + 00| + 1(?: + 2| + 6(?: + 00[06]| + 11[17] + )| + 8\d{2} + )| + 23| + 4(?: + 1| + 7[014] + )| + 5[015]| + 9[0349] + )| + 8(?: + 00| + 4[0-2]| + 8\d + ) + + \d{3,6} + 116123 + @@ -5530,7 +6208,7 @@ 3[3467]| 5[2457-9] )| - [2457]\d{2}| + [24578]\d{2}| 3(?: [14]0| 35 @@ -5922,8 +6600,67 @@ - + + + + + + $1-$2 + + + + [237-9]\d{7} + \d{8} + + + + 2(?: + 2(?: + 0[019]| + 1[1-36]| + [23]\d| + 4[056]| + 5[57]| + 9[01] + )| + 4(?: + 2|3-59]| + 3[13-689]| + 4[0-68]| + 5[1-35] + )| + 5(?: + 4[3-5]| + 5\d| + 6[56]| + 74 + )| + 6(?: + 4[0-378]| + [56]\d| + [78][0-8]| + 9[01] + )| + 7(?: + 6[46-9]| + 7[02-9]| + 8[34] + )| + 8(?: + 79| + 8[0-35789]| + 9[1-57-9] + ) + )\d{4} + + 22123456 + + + [37-9]\d{7} + 91234567 + @@ -6028,8 +6765,58 @@ - + + + + + + $1 $2 $3 + + + + [2-489]\d{7} + \d{8} + + + + + 2(?: + [24]\d| + 5[1-5]| + 94 + )\d{5} + + 22453300 + + + + (?: + 3[4-9]| + 4\d + )\d{6} + + 34101234 + + + + 8\d{7} + \d{8} + 80012345 + + + + 98[89]\d{5} + \d{8} + 98901234 + + + 1\d{2} + \d{3} + 114 + @@ -6079,8 +6866,8 @@ (?: - [237]0| - 31 + [27]0| + 3[01] )\d{7} \d{9} @@ -6285,7 +7072,7 @@ $1 $2 $3 + pattern="([78]\d)(\d{3,4})(\d{4})"> 76| 8[35-9] @@ -6330,46 +7117,51 @@ technically they are numbers for the UK. --> 1\d{7,8}| - (?: - 2[24-9]| - 4(?: - 0[24]| - 7 - )| - 5(?: - 0[45]| - 8 - )| - 6[237-9]| - 9[3-9] - )\d{5}| - (?: - 45| - [569]1| - 818 - )\d{6}| - (?: - 4[12469]| - 5[3679]| - 6[56]| - 7[14]| - 9[04] - )\d{7}| - 21\d{6,7}| - (?: - 23| - 4[34]| - 52| - 64 - )\d{5,7}| - 48\d{8} + 2(?: + 1\d{6,7}| + [24-9]\d{5}| + 3\d{5,7} + )| + 4(?: + 0[24]\d{5}| + [1269]\d{7}| + [34]\d{5,7}| + 5\d{6}| + 7\d{5}| + 8[0-46-9]\d{7} + )| + 5(?: + 0[45]\d{5}| + 1\d{6}| + 2\d{5,7}| + [3679]\d{7}| + 8\d{5} + )| + 6(?: + 1\d{6}| + 4\d{5,7}| + [237-9]\d{5}| + [56]\d{7} + )| + 7[14]\d{7}| + 818\d{6}| + 9(?: + 1\d{6}| + [04]\d{7}| + [3-9]\d{5} + ) \d{5,10} 2212345 - 8[35-9]\d{7} - \d{9} + + 8(?: + 22\d{6}| + [35-9]\d{7,8} + ) + + \d{9,10} 850123456 @@ -7559,15 +8351,17 @@ - + - [2356] + pattern="(\d)(\d{3})(\d{4})"> + + [2356] + $1 $2 $3 @@ -7584,23 +8378,20 @@ [235-9]\d{7,8} - \d{7,9} + \d{8,9} + [2356][2-8]\d{6} \d{7,8} - 62345678 + 62001234 - 7(?: - 4[5-7]| - 55| - 7[5-79]| - 8[5-8]| - 9[05-9] + [1-8]\d| + 9[02-9] )\d{6} \d{9} @@ -7612,16 +8403,21 @@ 80012345 - 90\d{6} + 900\d{5} \d{8} 90012345 - (?: - 8[57]\d| - 810 - )\d{5} + 8(?: + 10\d| + 5\d{2}| + 7(?: + [02]0| + 7[08]| + 9[09] + ) + )\d{4} \d{8} 85012345 @@ -7635,6 +8431,7 @@ + @@ -8411,15 +9208,43 @@ (?: - 1[1-9][1-9]| - 9(?: - [3-9][1-9]| - 2\d + 1(?: + 2[3-6]| + 3[3-9]| + 4[2-6]| + [58][2-8]| + 6[2-7]| + 7[2-9]| + 9[1-578] )| - (?: - [36][1-9]| - [24578][2-9] - )\d + 2[2-9]\d| + [36][1-9]\d| + 4(?: + 6[0235-8]| + [2-578]\d| + 9[2-59] + )| + 5(?: + 6[1-9]| + 7[2-8]| + [2-589]\d + )| + 7(?: + 3[4-9]| + 4[02-9]| + [25-9]\d + )| + 8(?: + 3[2-9]| + 4[5-9]| + 5[1-9]| + 8[03-9]| + [2679]\d + )| + 9(?: + [679][1-9]| + [2-58]\d + ) )\d{6} \d{9} @@ -9376,16 +10201,23 @@ - - [13-6] - $1 $2 $3 - - - [7-9][01] + + + [13-6]| + 7(?: + [2-57-9]| + 62)| + [89][2-9] + $1 $2 $3 - - [7-9][2-9] + + + [89][01]| + 7(?: + [01]| + 66) + $1 $2 $3 @@ -9396,22 +10228,23 @@ (?: - [14-6]\d| - [7-9][2-9] - )\d{5} + [14-6]\d{2}| + 7(?: + [2-57-9]\d| + 62)| + [89][2-9]\d + )\d{4} \d{7} 1123456 - (?: 3\d| 7(?: - 0\d| - 1[167] + [01]\d| + 66 ) )\d{5} @@ -9625,8 +10458,42 @@ + + + nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG"> + + + [1-689] + $1 $2 $3 + + + 7 + $1 $2 $3 + + + + [1-9]\d{8} + \d{7,9} + + + + (?: + [189]1| + 2[13-7]| + 3[1-8]| + 4[157]| + 5[12457]| + 6[35-7] + )[2-57]\d{6} + + 112345678 + + + 7[12578]\d{7} + \d{9} + 712345678 + @@ -9636,8 +10503,8 @@ - - [27] + + [279] $1 $2 $3 @@ -9648,7 +10515,7 @@ (?: - [27]\d| + [279]\d| [4-6] )\d{6} @@ -9665,12 +10532,18 @@ (?: 4[67]| 5\d| - 7\d{2}| - 6[4-8] + 6[4-8]| + 7\d{2} )\d{5} 4612345 + + + 90\d{6} + \d{8} + 90123456 + @@ -9878,11 +10751,12 @@ 5(?: 2(?: - [015-7]\d{2}| (?: - [28][2-9]| - 3[2-7]| - 4[2-8] + [015-7]\d| + 2[2-9]| + 3[2-57]| + 4[2-8]| + 8[235-9]| )\d| 9(?: 0\d| @@ -9890,10 +10764,10 @@ ) )| 3(?: - [0-4]\d{2}| (?: + [0-4]\d| [57][2-9]| - 6[2-8]| + 6[235-8]| 9[3-9] )\d| 8(?: @@ -9908,10 +10782,10 @@ 6(?: - 00| + 0[06]| + [14-7]\d| + 2[236]| 33| - [15-7]\d| - 4[0-8]| 99 )\d{6} @@ -10124,16 +10998,32 @@ (?: - 2\d| - 3[1-4]| - 4[2-8] - )\d{6} + 2(?: + [23]\d| + 5[125]| + 61 + )| + 3(?: + 1[3-6]| + 2[2-6]| + 3[2-5]| + 4[235] + )| + 4(?: + [23][2-6]| + 4[3-6]| + 5[25]| + 6[25-8]| + 7[24-6]| + 8[4-6] + ) + )\d{5} \d{6,8} 22212345 - 7\d{7} + 7[0-25-8]\d{6} 72345678 @@ -10286,18 +11176,15 @@ - - - [12]1| - [7-9] - + + [12]1 $1 $2 $3 - + [12]2[1-3] $1 $2 - + [12](?: 27| @@ -10312,7 +11199,14 @@ $1 $2 - + + + [57-9] + $1 $2 + + [12](?: 27| @@ -10329,37 +11223,54 @@ - [127-9]\d{7} - \d{8} + + [12]\d{7,9}| + [57-9]\d{7} + + \d{8,10} + code, and could be 1 to 4 digits long. We also cover wireless local loop numbers here + as well, even though we are not certain whether they are in fact fixed or mobile in + this country. 5-digit subscriber numbers for 4-digit area codes have been added due to + online numbers being found. --> - (?: - [12](?: - 1\d| - 2[1-37]| - 3[2-8]| - 4[2-68]| - 5[1-4689] + [12](?: + 1\d| + 2(?: + [1-3]\d?| + 7\d )| + 3[2-8]\d{1,2}| + 4[2-68]\d{1,2}| + 5[1-4689]\d{1,2} + )\d{5}| + (?: + 5[0568]| 70 )\d{6} 70123456 + (?: - 88| - 9[1569] + 8[89]| + 9[15689] )\d{6} + \d{8} 88123456 + + 7[569]\d{6} + \d{8} + 75123456 + @@ -10470,15 +11381,26 @@ + + + [2-48] + $1 $2 $3 $4 + + [2-7] $1 $2 $3 - [2-7]\d{6} - \d{7} + + [2-4]\d{6,7}| + [5-7]\d{6}| + 8\d{7} + + \d{7,8} @@ -10490,9 +11412,10 @@ 5[02-467]| 6[39]| 7[4-69] - )\d{4} + )\d{4}| + [2-4]5\d{6} - 5131234 + 35123456 @@ -10501,10 +11424,20 @@ 4[3-5]| 6\d| 7[0-7] - )\d{5} + )\d{5}| + (?: + 2[27]| + 3[367]| + 4[467] + )\d{6} - 3123456 + 22123456 + + 800\d{5} + \d{8} + 80012345 + @@ -10546,8 +11479,68 @@ - + + + + + + $1 $2 + + + + [2579]\d{7} + \d{8} + + + + 2(?: + 0(?: + 1[0-6]| + [69]\d + )| + [1-357]\d{2} + )\d{4} + + 21001234 + + + + (?: + 7(?: + 210| + [79]\d{2}| + )| + 9(?: + 2[13]\d| + 696| + 8(?: + 1[1-3]| + 89| + 97 + )| + 9\d{2} + ) + )\d{4} + + 96961234 + + + 7117\d{4} + 71171234 + + + + 50(?: + 0(?: + 3[1679]| + 4\d + )| + [169]\d{2}| + 7[06]\d + )\d{3} + + 50031234 + @@ -10619,8 +11612,62 @@ - + + + + + + $1-$2 + + + + [3679]\d{6} + \d{7} + + + + + (?: + 3(?: + 00| + 3[0-59]| + )| + 6(?: + [567][02468]| + 8[024689] + ) + )\d{4} + + 6701234 + + + + (?: + 7(?: + [679]\d| + 8[02-9] + )| + 9[6-9]\d + )\d{4} + + 7712345 + + + 781\d{4} + 7812345 + + + + 1(?: + [19]0| + 23 + ) + + \d{3} + 123 + @@ -11074,130 +12121,159 @@ - - - - 8[15] - $1 $2 $3 - - - - 632 - 6325 - 63253 - 632532 - $1 $2 - - - - 6(?: - 1| - [245][1-7]| - 3[125-7]| - 6[1256]| - 7[1236] - ) - - $1 $2 $3 - - - - - 6(?: - 3[12567]| - 5[3-5]| - 6[1256]| - 7[1236] - ) - - $1 $2 - - - 6[2356]8 - $1 $2 + + + + 8[125] + $1 $2 $3 - - - 6(?: - 34| - 6[34]| - 75 - ) - - - 6(?: - 342| - 6[34]| - 751 - ) - - $1 $2 + + 6 + $1 $2 $3 88 $1 $2 $3 + + 870 + $1 $2 $3 + - [68]\d{5,9} - \d{4,10} + [68]\d{7,8} + \d{8,9} + 6(?: 1(?: - [136]| - 2\d? - )\d| + 17| + 2(?: + [0189]\d| + [23-6]| + 7\d? + )| + 3(?: + 2\d| + 3[378] + )| + 4[01]| + 69| + 7[014] + )| 2(?: - [25]\d? | - [134678] - )\d| + 17| + 25| + 5(?: + [0-36-8]| + 4\d? + )| + 69| + 70 + )| 3(?: - 2\d{0,3}| - 4\d{1,2}| - [135-8]\d? + 17| + 2(?: + [0237]\d?| + [14-689] + )| + 34| + 6[29]| + 7[01]| + 81 )| 4(?: - [13-8]\d| - 2\d{1,2} - )| - (?: + 17| + 2(?: + [012]| + 7? + )| + 4(?: + [06]| + 1\d + )| 5(?: - [16-7]\d| - [3-58]\d? | - 2\d{1,2} - ) + [01357]| + [25]\d? + )| + 69| + 7[01] + )| + 5(?: + 17| + 2(?: + [0459]| + [23678]\d? + )| + 69| + 7[01] )| - 6\d{0,4}| - 7\d{0,3} + 6(?: + 17| + 2(?: + 5| + 6\d? + )| + 38| + 42| + 69| + 7[01] + )| + 7(?: + 17| + 2(?: + [569]| + [234]\d? + )| + 3(?: + 0\d?| + [13] + )| + 69| + 7[01] + ) )\d{4} 612012345 - + - 8(?: - 1(?: - 1[0-24]| - [2-4]\d| - 50| - 6[0-2] - )| - 5\d{2} - )\d{5} + (?: + 60| + 8[125] + )\d{7} \d{9} - 811012345 + 811234567 + + 8701\d{5} + \d{9} + 870123456 + - 88\d{6} + 886\d{5} \d{8} - 88123456 + 88612345 + + + 1(?: + 0111| + \d{3} + )| + 9(?: + 3111| + \d{2} + ) + + \d{3,5} + 93111 + @@ -11609,8 +12685,22 @@ - + + + + + [1-5]\d{3} + \d{4} + + + + [34]\d{3} + 4002 + + + [125]\d{3} + 1234 + @@ -11872,7 +12962,7 @@ 68| 7(?: [126]\d| - 3[34689] + 3[1-9] ) )\d{5} @@ -11885,6 +12975,7 @@ 1801234 + 275\d{4} \d{7} 2751234 @@ -12485,8 +13576,80 @@ + + + + + nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG"> + + + [2489] + $1 $2 $3 + + + 5 + $1 $2 $3 + + + 1[78] + $1 $2 $3 + + + + + + (?: + [24589]\d{7,9}| + 1(?: + [78]\d{8}| + [49]\d{2,3} + ) + ) + + \d{4,10} + + + + (?: + 22[2379]| + 42[45]| + 82[01458]| + 92[369] + )\d{5} + + \d{7,8} + 22234567 + + + 5[69]\d{7} + \d{9} + 599123456 + + + 1800\d{6} + \d{10} + 1800123456 + + + + + 1(?: + 4| + 9\d + )\d{2} + + \d{4,5} + 19123 + + + 1700\d{6} + \d{10} + 1700123456 + @@ -12966,12 +14129,20 @@ preferredInternationalPrefix="00"> + + [23578]| + [46][0-35-9] + $1 $2 + + [46]4 + $1 $2 $3 + - [2-8]\d{5} - \d{6} + [2-8]\d{5,6} + \d{6,7} + + (?: + 4?4[1-3]| + 6?47 + )\d{4} + + 4410123 + + nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG"> + + + $1 $2 $3 + + + + [19]\d{8} + \d{9} + + + + + 1(?: + [25]\d| + 8[3567] + )\d{6} + + 121231234 + + + 9[1259]\d{7} + 911231234 + @@ -13264,22 +14468,40 @@ 1[89] $1 $2 $3 + + 70 + $1 $2 $3 + 80 $1 $2 $3 - [13689]\d{7,10} + + + [36]\d{7}| + [17-9]\d{7,10} + \d{8,11} - [36]\d{7} - \d{8} - 31234567 + + + 6[1-8]\d{6}| + 7000\d{7} + + \d{8,11} + 61234567 - [89]\d{7} + + (?: + 8[1-5]| + 9[0-8] + )\d{6} + \d{8} 81234567 @@ -13293,6 +14515,34 @@ \d{11} 19001234567 + + 3[0-2]\d{6} + \d{8} + 31234567 + + + + 7000\d{7} + \d{11} + 70001234567 + + + + 1(?: + [0136]\d{2}| + 41\d| + [89](?: + [1-9]\d| + 0[1-9] + )| + [57]\d{2,3})| + 99\d + + \d{3,5} + 1312 + @@ -13583,7 +14833,7 @@ - [19] + 15|9 $1 $2 @@ -13712,14 +14962,19 @@ $1 $2 - 7 + [027] $1 $2 - [2-7]\d{6,7} + [02-7]\d{6,7} \d{7,8} + + 0800\d{4} + \d{8} + 08001234 + @@ -13759,11 +15014,16 @@ (?: 6| - 7[67] + 7[6-8] )\d{6} 76123456 + + 0800\d{4} + \d{8} + 08001234 + @@ -15260,10 +16520,11 @@ 9 $1 $2 $3 $4 - + 1(?: [26]| + 88| 99 ) @@ -15271,12 +16532,7 @@ - - 1(?: - 8| - 90 - ) - + 1[89]0 $1 $2 @@ -15320,14 +16576,13 @@ 2101234567 - (?: 9\d| 1(?: - 2[1-35-9]| + 2\d| 6[3-9]| + 88| 99 ) )\d{7} @@ -15489,7 +16744,18 @@ + + 860 + $1 $2 $3 + + + [1-57]| + 8(?: + [0-57-9]| + 6[1-9] + ) + $1 $2 $3 @@ -15526,10 +16792,15 @@ 801234567 - 86\d{7} + 86[1-9]\d{6} \d{9} 861234567 + + 860\d{6} + \d{9} + 860123456 + 87\d{7} \d{9} @@ -15804,18 +17075,12 @@ 9[2-8] )\d{4,7} - \d{3,10} 1312345 - - (?: - [19]1| - 7[13] - )\d{6,7} - - \d{8,9} - 911234567 + 7[137]\d{7} + \d{9} + 711234567 diff --git a/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java b/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java index 4a176ce93..5aae1840d 100644 --- a/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java +++ b/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java @@ -169,7 +169,10 @@ public class PhoneNumberUtil { aSet.add(227); // Niger aSet.add(228); // Togo aSet.add(241); // Gabon + aSet.add(242); // Congo (Rep. of the) + aSet.add(268); // Swaziland aSet.add(379); // Vatican City + aSet.add(501); // Belize LEADING_ZERO_COUNTRIES = Collections.unmodifiableSet(aSet); } @@ -187,7 +190,7 @@ public class PhoneNumberUtil { // This consists of dash characters, white space characters, full stops, slashes, // square brackets, parentheses and tildes. It also includes the letter 'x' as that is found as a // placeholder for carrier information in some phone numbers. - private static final String VALID_PUNCTUATION = "-x\u2010-\u2015\u2212\uFF0D-\uFF0F " + + private static final String VALID_PUNCTUATION = "-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F " + "\u00A0\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E"; // Digits accepted in phone numbers @@ -255,7 +258,7 @@ public class PhoneNumberUtil { // the extension is written with a hash at the end, such as "- 503#". // Note that the only capturing groups should be around the digits that you want to capture as // part of the extension, or else parsing will fail! - private static final String KNOWN_EXTN_PATTERNS = "[ \u00A0\\t,]*(?:ext(?:ensio)?n?|" + + private static final String KNOWN_EXTN_PATTERNS = "[ \u00A0\\t,]*(?:ext(?:ensi[o\u00F3])?n?|" + "\uFF45\uFF58\uFF54\uFF4E?|[,x\uFF58#\uFF03~\uFF5E]|int|anexo|\uFF49\uFF4E\uFF54)" + "[:\\.\uFF0E]?[ \u00A0\\t,-]*([" + VALID_DIGITS + "]{1,7})#?|[- ]+([" + VALID_DIGITS + "]{1,5})#"; @@ -264,13 +267,13 @@ public class PhoneNumberUtil { // digits, for use when parsing. private static final Pattern EXTN_PATTERN = Pattern.compile("(?:" + KNOWN_EXTN_PATTERNS + ")$", - Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE); + Pattern.CANON_EQ | Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE); // We append optionally the extension pattern to the end here, as a valid phone number may // have an extension prefix appended, followed by 1 or more digits. private static final Pattern VALID_PHONE_NUMBER_PATTERN = Pattern.compile(VALID_PHONE_NUMBER + "(?:" + KNOWN_EXTN_PATTERNS + ")?", - Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE); + Pattern.CANON_EQ | Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE); private static final Pattern NON_DIGITS_PATTERN = Pattern.compile("(\\D+)"); private static final Pattern FIRST_GROUP_PATTERN = Pattern.compile("(\\$1)"); @@ -533,9 +536,7 @@ public class PhoneNumberUtil { return 0; } PhoneMetadata metadata = getMetadataForRegion(regionCode); - // For NANPA countries, national prefix is the same as country code, but it is not stored in - // the metadata. - if (!metadata.hasNationalPrefix() && !isNANPACountry(regionCode)) { + if (!metadata.hasNationalPrefix()) { return 0; } @@ -546,6 +547,39 @@ public class PhoneNumberUtil { return 0; } + return getLengthOfNationalDestinationCode(number); + } + + /** + * Gets the length of the national destination code (NDC) from the PhoneNumber object passed in, + * so that clients could use it to split a national significant number into NDC and subscriber + * number. The NDC of a phone number is normally the first group of digit(s) right after the + * country code when the number is formatted in the international format, if there is a subscriber + * number part that follows. An example of how this could be used: + * + * PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); + * PhoneNumber number = phoneUtil.parse("18002530000", "US"); + * String nationalSignificantNumber = PhoneNumberUtil.getNationalSignificantNumber(number); + * String nationalDestinationCode; + * String subscriberNumber; + * + * int nationalDestinationCodeLength = phoneUtil.getLengthOfNationalDestinationCode(number); + * if (nationalDestinationCodeLength > 0) { + * nationalDestinationCode = nationalSignificantNumber.substring(0, + * nationalDestinationCodeLength); + * subscriberNumber = nationalSignificantNumber.substring(nationalDestinationCodeLength); + * } else { + * nationalDestinationCode = ""; + * subscriberNumber = nationalSignificantNumber; + * } + * + * Refer to the unittests to see the difference between this function and + * getLengthOfGeographicalAreaCode(). + * + * @param number the PhoneNumber object for which clients want to know the length of the NDC. + * @return the length of NDC of the PhoneNumber object passed in. + */ + public int getLengthOfNationalDestinationCode(PhoneNumber number) { PhoneNumber copiedProto; if (number.hasExtension()) { // We don't want to alter the proto given to us, but we don't want to include the extension @@ -566,6 +600,17 @@ public class PhoneNumberUtil { if (numberGroups.length <= 3) { return 0; } + + if (getRegionCodeForNumber(number).equals("AR") && + getNumberType(number) == PhoneNumberType.MOBILE) { + // Argentinian mobile numbers, when formatted in the international format, are in the form of + // +54 9 NDC XXXX.... As a result, we take the length of the third group (NDC) and add 1 for + // the digit 9, which also forms part of the national significant number. + // + // TODO: Investigate the possibility of better modeling the metadata to make it + // easier to obtain the NDC. + return numberGroups[3].length() + 1; + } return numberGroups[2].length(); } @@ -1165,8 +1210,7 @@ public class PhoneNumberUtil { */ public boolean isValidNumber(PhoneNumber number) { String regionCode = getRegionCodeForNumber(number); - return isValidRegionCode(regionCode) - && isValidNumberForRegion(number, regionCode); + return (isValidRegionCode(regionCode) && isValidNumberForRegion(number, regionCode)); } /** @@ -1604,12 +1648,12 @@ public class PhoneNumberUtil { * the resulting number, and indicates if an international prefix was present. * * @param number the non-normalized telephone number that we wish to strip any international - * dialing prefix from + * dialing prefix from. * @param possibleIddPrefix the international direct dialing prefix from the country we * think this number may be dialed in * @return the corresponding CountryCodeSource if an international dialing prefix could be * removed from the number, otherwise CountryCodeSource.FROM_DEFAULT_COUNTRY if the - * number did not seem to be in international format + * number did not seem to be in international format. */ CountryCodeSource maybeStripInternationalPrefixAndNormalize( StringBuffer number, @@ -1712,6 +1756,21 @@ public class PhoneNumberUtil { return ""; } + /** + * Checks to see that the region code used is valid, or if it is not valid, that the number to + * parse starts with a + symbol so that we can attempt to infer the country from the number. + * Returns false if it cannot use the region provided and the region cannot be inferred. + */ + private boolean checkRegionForParsing(String numberToParse, String defaultCountry) { + if (!isValidRegionCode(defaultCountry)) { + if (numberToParse != null && !numberToParse.isEmpty() && + !PLUS_CHARS_PATTERN.matcher(numberToParse).lookingAt()) { + return false; + } + } + return true; + } + /** * Parses a string and returns it in proto buffer format. This method will throw a * NumberParseException exception if the number is not considered to be a possible number. Note @@ -1743,13 +1802,7 @@ public class PhoneNumberUtil { // decrease object creation when invoked many times. public void parse(String numberToParse, String defaultCountry, PhoneNumber phoneNumber) throws NumberParseException { - if (!isValidRegionCode(defaultCountry)) { - if (numberToParse.length() > 0 && numberToParse.charAt(0) != PLUS_SIGN) { - throw new NumberParseException(NumberParseException.ErrorType.INVALID_COUNTRY_CODE, - "Missing or invalid default country."); - } - } - parseHelper(numberToParse, defaultCountry, false, phoneNumber); + parseHelper(numberToParse, defaultCountry, false, true, phoneNumber); } /** @@ -1780,23 +1833,22 @@ public class PhoneNumberUtil { public void parseAndKeepRawInput(String numberToParse, String defaultCountry, PhoneNumber phoneNumber) throws NumberParseException { - if (!isValidRegionCode(defaultCountry)) { - if (numberToParse.length() > 0 && numberToParse.charAt(0) != PLUS_SIGN) { - throw new NumberParseException(NumberParseException.ErrorType.INVALID_COUNTRY_CODE, - "Missing or invalid default country."); - } - } - parseHelper(numberToParse, defaultCountry, true, phoneNumber); + parseHelper(numberToParse, defaultCountry, true, true, phoneNumber); } /** * Parses a string and fills up the phoneNumber. This method is the same as the public * parse() method, with the exception that it allows the default country to be null, for use by - * isNumberMatch(). + * isNumberMatch(). checkRegion should be set to false if it is permitted for the default country + * to be null or unknown ("ZZ"). */ - private void parseHelper(String numberToParse, String defaultCountry, - boolean keepRawInput, PhoneNumber phoneNumber) + private void parseHelper(String numberToParse, String defaultCountry, boolean keepRawInput, + boolean checkRegion, PhoneNumber phoneNumber) throws NumberParseException { + if (numberToParse == null) { + throw new NumberParseException(NumberParseException.ErrorType.NOT_A_NUMBER, + "The phone number supplied was null."); + } // Extract a possible number from the string passed in (this strips leading characters that // could not be the start of a phone number.) String number = extractPossibleNumber(numberToParse); @@ -1805,6 +1857,13 @@ public class PhoneNumberUtil { "The string supplied did not seem to be a phone number."); } + // Check the country supplied is valid, or that the extracted number starts with some sort of + + // sign so the number's region can be determined. + if (checkRegion && !checkRegionForParsing(number, defaultCountry)) { + throw new NumberParseException(NumberParseException.ErrorType.INVALID_COUNTRY_CODE, + "Missing or invalid default country."); + } + if (keepRawInput) { phoneNumber.setRawInput(numberToParse); } @@ -1969,9 +2028,9 @@ public class PhoneNumberUtil { public MatchType isNumberMatch(String firstNumber, String secondNumber) throws NumberParseException { PhoneNumber number1 = new PhoneNumber(); - parseHelper(firstNumber, null, false, number1); + parseHelper(firstNumber, null, false, false, number1); PhoneNumber number2 = new PhoneNumber(); - parseHelper(secondNumber, null, false, number2); + parseHelper(secondNumber, null, false, false, number2); return isNumberMatch(number1, number2); } @@ -1990,7 +2049,7 @@ public class PhoneNumberUtil { public MatchType isNumberMatch(PhoneNumber firstNumber, String secondNumber) throws NumberParseException { PhoneNumber number2 = new PhoneNumber(); - parseHelper(secondNumber, null, false, number2); + parseHelper(secondNumber, null, false, false, number2); return isNumberMatch(firstNumber, number2); } } diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AM index 0fc855ad3268e62d39f39df76ed4c7a1555960f4..aa722df63b55232145f42b3fd61f122fda639ec4 100644 GIT binary patch delta 51 zcmey!{F#|^&07Z6Dh39|R}(oKc||nrt<249ETau|P0S`vyTij9ZD<|~X=VgP4?Rvsy+5Rv>Kwq&X}M z42_IUOwE7_MK$cLEX->xqYVsAOwBD~HPO{tBGj^5n4rsAm_SULcwS|)IHN59nMof` delta 46 vcmbQqe1%DD&07Z6Dh38dZw4U2$jHDQZD?#}K2dznWNSvn$pMT!Q0xf+`Ctl& diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BZ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BZ index a890dcc2f43482b192830754c6248e463ec5a6bb..f5a494afaf114a7b661706bec0c0625dbcc9315f 100644 GIT binary patch literal 361 zcmb7AF%H5o40I|LgerkxU}osh4w0O+O)HiP9>4<#kr;RdG(X~NjO<)OL99fI&x-HP zcJ2>KuSDWZ2tv@xYT3EdN{bOKZgNfsW1EiRms!!Cv}%wIVr z`y-ZpQo@X_-zTAYfku@t17Jx?b0u?)DkhAdB0@^EF1Rc($%i<~D2sfVS2C}oO7N(N F9bPP_K!*ST literal 128 zcmZ4UmVvdrih+TFkr70|Fe3w#pCgz6Ns!HEU~-BAn);Q2$-n?;I3t_@+5-UqTiOfF diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CD b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CD index bfdfe3bba5ee5748c7add27710fa034f486dd24f..b248f9c0f7ef565398e577cbdeb12e00dbe79b78 100644 GIT binary patch delta 32 ocmX@dbb*O;&07Z6Dh38d_lcZd+>#phRu<6)x<)1z6JtIB0G1>PA^-pY delta 30 mcmcb>bdHI0&07Z6Dh38d*NL27oZ=exRu<6)h9(o^J^=uRVhFeZ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CG index 0ad281c48af720d7ac12a42fe5d1f6f7aecb2e35..94f8cca093da624f4b07b832af545ef9af1f60a8 100644 GIT binary patch literal 323 zcmb7#;y&qDxn@Jijot+N*I^Wv9J+xV=F_Iaf3-m&W@vF_~Zl9$32t) delta 123 zcmcc5^p;U>&07Z6^5+Z;42+D744lzM7O^oY)#kN~46H!fVxqc+9G6A3F<8_LCJLlE zEQ}3}j7?0&}F)#oC@QfUm diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CU b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CU index 6566563272f6394d8b6db13ddc727082ef0ec636..ab458a33c939ab73f369b373950199d36d0200f0 100644 GIT binary patch literal 415 zcmbV|L2kk@5JmqGr65&E9Dzj^i4-L4*m3Bls@QkeO$|Fv(c)`x3a-W-_>%~dHI_Uc z{dt=Cp6dU~J=j8#waKlTaTy-;VFXkHy*dmw-XNy_{pV z|KZ;~GGlfS$aVu(vXaHqf<*t%)|&H8$0?jEzarj7h0B(J?ft ztue6#%Nv5_4M6hdPKtUGb%BfPu5~o76$4B8Dg$uQCnkX3}V$z jPG&sE$>itA$N(f5Hm5KxWt_~%QU~%3@|4uFW@dK=ntzdIcJ_^M1}qdp4eR%uitAzYH__bITvX8Sy~2LnUU z(5>#*%y3oh4mH1H7gJir8uL<@WoXOJeg}$lBXi|Tt%bE4-mv+T_77R)Fz j&243O{@m0x-@86VLe@=!Kg_ki&C%s4t`h!VLkY$QuL52F delta 47 ocmZ3)(!eOX<}Cwjc@+Z#10y4dfZ&O14JYoBn0QZ|8zcY)0P6k-Gynhq diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EE index dcb5b6c293dc0bce77da80dcef4e0f1ceb480f9a..893337044f31564c2e4d60bb972d85a23908edd7 100644 GIT binary patch delta 256 zcmY*Uv2MaJ5ItK&fJ7Ih3KptJq#~9GGO-=Is44?vS2p8~{sdh1uE=A5p})h#%E~`* z$pq88yZ7$ByT9a?^#5;=902(B)L*zozFsL`D&sx^YHH+ek6sln2&|~IepwLXoY?J; zre@G3v~zd*xlCTH^s*?!`k5k8&&s%Eign^In^rTgD%;q%zGx_=-9tm5tqWLrZGwQ! zqcEP?*ZVNHQsm@c)-C8-KrdUSS(#=E02pwJ8t~7~YwmUY=5OPnmT1s5uSlfp8{-kp H;*qC!Z^J;t delta 157 zcmaFMI-8Yq&07Z6Dh39oNfSBs^wc!$t&F3Mj7=>pV{1&Jjdd+zYs_L&YRsbzb%7!l z7Md|B)uy$K46H!fd}97>5q5I}WFepwyZPjFMq@_i$+H=i*%hOWP0Y+KC!c1NVYh{{ pzcAWOj$<-q7SV{FJe^5Sh~Kov0%)&+K@HFr(^yRgk;!M76aZELDg^)l diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FO index b76288c0e3309746d5a2e9dc3ee65eba3039a324..6f8ab3a08df7e30bc53520f35ba2c1a4d779aba8 100644 GIT binary patch literal 344 zcmZvYI}XAy42GRbWne%;Oo)*MkSaMz^I}0PjBtREjZ;8+Bd*3B_`{>B1Q{I5{`~uK ze^7lT5+{NYg2qubA)PNb(+R5a+YWJ>uXbC-IqIfGGW#e)S|i)`l%SDfsdNi^QRpZk zlnrPH*Zt$=ho5+k%D8u9J(TpUz(8^t7@|??)}$y+<5ETk^>RWeqo`qB;G&JX>bQTI tvc%AzLCr>Pv`yLjpH=L4mA;0m18yWXR56!Z(Nva+SZ0ioxQHO!zbB0~Lk$1` literal 122 zcmZ4UmVvdrgn@y9kr70|Fe3w#pCgz6Ns!HEU~=;ZnySUXWMBX^8e##M!N33j{WS`a diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GB b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GB index e3ab0795118f8c100968a0d03faae28214c4f1f9..c6853dec2aa7d02c06f3518a5201f10250e20cf0 100644 GIT binary patch delta 180 zcmca2GD&oT24m@Dc~;|OLk)W?AOcaw(FVFE7O^$aCT6i9W^9dVw1J_KxrJqHjX6-j z7)VV>N4x41q%Cu{FjZ8m!CIGS)CArN#^>U}$7wrVCW18Iw|NHql`gOSF+i z?8MvJlLZ;`SfY(BVkb8+YHZ%f_?(foih+TJVe$;-!p(dvf{dGkSnHTTVodduFRuRv80ngt zTTE_aEMPRA{EJb89VldItZTVhf$1gVWImQc)+z=D7KY9BEP{*^HH|kfD;z=IOVscq;rm@_Pi@&jSS2KL-*4 delta 25 hcmaFO^oogd&07Z6Dh39|#EG1FjBXPvbS5r61^{nX2;Bex diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HN index 305ac3f3d44bc2a33f7c8ad8eae5d84c772d0753..c884ba6920518bbf2476368a33f43b2137623cde 100644 GIT binary patch literal 440 zcmbV|J#ND=423BJ1`4#uDKbQZ0R7X-QgrK-3$WUHibT0lfnKK9=-#o9c95l81xuvJ z&yONMzG*%anNPxD3_VFq>{@?&zwp)247*&Bp|5y&KI-=3L+c|*aH;kI9`MNG3vNXU z_tAiKJF@;Uk}JTIgyiZ14B79Z6vk}`xBq`2V*iNadDp=QzctVLt_-k_m}7(-0CRJ8gie@6hKZ2*IqPA}`B kgZZ~l)9VRC|DnlyOn+O3c8B$8_GW0_2e*%!HS4!=zx1eFeE^2BlbV!NsENsyT}gYl2;y&fL+cJFch;!p@1Y)X@+U0drk~@bbJBS<2XnF literal 128 zcmZ4UmVvdrih+TFkr70|Fe3w#pCgz6Ns!HEVDbn7n);W4$-n?;I3t_@+5-UqT(}F> diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HU b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HU index e0b9d9b5af0dd4d620b407aa157f176c086909c2..14dcc1cb39ad2d2924e30916ecbc2f72531718a9 100644 GIT binary patch delta 37 tcmX@he4d$e&07Z6Dh39|V-qF<8v^AuE9=Qpyizt#4|qe@Z^bbvBBGX4!K7B#l}R`B0taVYCm1J2{Z a@u}R5AJw`XhViF5Kl5NvTfT~7k5KPt;R}c>(dY3&+U=}7xcODDkA9&bnI|soJ@aDlD1iwI-vp=DK;ul#N z&7~^U)z$TW`nmboy_qln@bsGdGHG|W4-#lsM zR*6+O)zNG5rOD|}79R+*vc!~u2`15$t^Ok|Nih+TNVIrptqs2rubtwY_LnC7oMn(ona}9f|XhU6#*qD?W%V-0m zi4}Gn9F_(KF)7ui6ZeYi=vV+17y`L9ra&R1+8VG11EW}j8uMrai&&5*%UDfKprpyf Q7a1%<8Zjx8BN*2L03g^P@Bjb+ delta 117 zcmeBVX=UMD^Ok|Nih+Ug&qPicM)Qek>e|L8re@|AjEoFg<{I`^Cefz4=CL)VrZwgu zmSt>>1(3Fgt+9+YFrAog$IfnP5R+1EHgT=EhzL+UP}V#)CZ)#0&_EL?ZaVQp28WnN Ow2`r?S?uH(#By(Z*)6KvBzBAln3}-z?g|$k-I56{rHF7AS5BVp;-qnSvF7RD(@~DzX4+)~qoH zN*YI-042j}On|0i}01x=zsf;FaKYilf`4U8d5&CDSNSptiW(`=#45}d7$i&p#A~xCxs75m; zWwR9Hd#1^JESp%X7#LU>HXmT|W1hU7SAMb)$7G1mBVAK-T}z-yjhT^V zO|*q&EKmr<*90musbyqf1=8j~n%&UQ$k@cxjFFK+8mQ42r~_<(fgxD4*~F5SY)lM7 z8Zjx86B*@96{8J}fi|I7f@%dL1G9mOAtM6=gSbXC#0?;ws-j>=0F8y4Ut?ybiBJvH Hz`y_ie84p~ delta 193 zcmX@le4Uwd&07Z6Dh39|a}zn0Wn?t$t)dN0bj@O8Qfi{jbuD9~jevw^OiH!s#CS0= zki0Qa${a`=0BOT$Lo@T(iCrtXm>I-0q799KIw$uq%E_=n*o+L!1}cV(3=9mC8W7_Q l48aQ2IN@A`8Y!q6u$3A>JB=pWGfGHtAsm8G3pA2}0RVs_D=q*4 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LK b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LK index 528b89acfae12774d2a7ad85cb8389b37ef1e028..aa92d0ec1b2ea74ce0456428355f2aa88f9a0155 100644 GIT binary patch literal 371 zcmbVIJ8r^26rAS>5s)b9DO_L)OMbiFk5Qy3bs{dXn2IV#NbDPNHSWNyK#HYwG;iK# z=KU^L%zgm*28{@oN$ajZo`2&gm=nXU8(G2I_I;l;cD)WJsjWjlSaM@Ov`HN!m(;Y` z@yR-tt7K}1Y~d%Z1PfJTTjxV$*Hxg(g_vo9v>CA@F2aOV96kgzd5x!i6kngb@r0sj zAdrV)3I*0%&NX9|LGR$l3a_PZO0y|#eh%h5*Yg2_m!?!C;$MkMg_e9 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LR index a6d98d1bd879d49a7a13e19b2b018fec3da415e8..762883c88172219a3caad711696f8d71bc03d6e7 100644 GIT binary patch delta 100 zcmcb`^qxs#&07Z6Dh39|GzK8S$jBh3VQ&>}WNtZ8+=JIF+C}WIj>CgV#JJrP`>r#w^-I*CKXeuI9u8 giWB!rOnfNIA*KOT5*w2;*@jV$g$2l-ti|XG07YaKU;qFB diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MA index 7781aeb88516057210fc4dc9196c23f4177b04cc..673f6bb675732f06523e5b8c66ab2b6adf394b1a 100644 GIT binary patch delta 158 zcmZ3(x|x-8&07Z6Dh39oRTDYo(>qNy?5&J|7>J?`3{7>-V`EZkjG~QnEn{npft0Cv zY>f$!wur5IezAQPg2`XGjwfpksmwvtsf a18IpiFpI5;HZ*}-WDMjR8*jXSmJtB29xYV> delta 131 zcmdnYx`vf=&07Z6Dh39o#S=N@4O&e#?5&J|INHF_RM$KDUGl7~7fSNZx HJIe?Fk$xs& diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MK b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MK index 5401cbb8008a0dbd2a9080da07331d5b13d91e53..9bf3754f7f8d1cc504efc63cec88c5d8f056c48e 100644 GIT binary patch delta 176 zcmcb>yn%&t&07Z6Dh387^@*Gc^+g)?Rz^S^ZDbr9lTu?EZD?c~TVrOZSz`O~nD|1>Ej(3UCg=Jva;(;SRiU`cqlJ z#?CnJH)DT(BYgvs4**IjJbP_++u_|6{TRG;Wgn|iVb0U8(A7vB27xWtE4>|p;qG-= z6Sxj;JLIAErtE~L3p0j>ReLHeu}#}WUHP9AXU9Mh>nlrOaFv|3=bp58l{R%_TM0>U z=P40-uSw~52SO?#h1hjRbh3F-;3B#I^L^vIZDTx%a8z{mw<40)4KVw{tg18=R5dLe zCQ>{tr(xzxredSAHDiu>rWcu6WVOs3serViM8*}kk1WGE3f>ki8EIrh__e@IocAS% z@OpBw=bQw0``a=u_`0;a91j;KbTcQp+kMhQ;4}NH=}mBwQ`*OUkJ4C#7k_%kC&n8* Pq@lNO_|8uLY!vtb|B!^7 delta 237 zcmbQmI+vw>&07Z6Dh3875e5bZMn*;ko@hfOb6v~Wn3QVsT1Ey|AZ<|#lwq*Yu(txr z#R4hAn3Ni$XhU6N^Vk~WXd_*V*cuZcWd@{8fx;$c7M8J^HRcAIK+R@wLl_x2%nb~U zj7?0}&9ShkVYQ4lG&P%e)NkT@(aCmvOipA}ROJR)X;>2tauOp0 zvw?~sBhaA&ASJOzF)5lFKr2iqFJ?4mG?{#z(N0hZECUoYsRhd!14R`k7c;2?0NCL< AkpKVy diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MR index e7c1c5de3c481d313adeb880e2f04050498ba449..ce173e479b3928eb6e61281f31ad3553a71f579c 100644 GIT binary patch literal 486 zcmb7>Jx;_h5QWE)0+G1E7LX!ER@z98|6*v+)(8sPS$BJi#l8_&f*WuL-Z+5JQjx;X z_RM>q?Yw?adm>VAgh45~W;3~TIKG74QZoB#sf&^$_LidPQgjy!y6M4>_jfaE>r*zY zr*NCH#nQ!;9lHSWtPvQNlmlCo7k1LNMT$edz`W3YB`fNzpN(}sfUyUHjZKJml4>Ww z!r_P{jl)ThFBwgS4Jekaz=XaQ&ytP#N$#T7)vc(7MjS!5Y8~L_XK0Wx_%AajB?wE=iH9KnQ|s{HO&2B`oZ>tgGtfFYEUvK+K9jYjlb6J+gg2XZTzxT F{3myN` v?52jshDOFFKpB;Zi&TV=WWeI4W|Q?9Re;!%k#X`$MonG@MxgOPE5HB%6&V(T diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MT b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MT index 8bae5e4e86421f99d2120b25191611c5b46c0576..8e06f3f6a8168ca57279d57f4ae82f9653cfa4be 100644 GIT binary patch literal 404 zcmZvYK~BUl3`Lzvl|V?GVHUHPEC$(0n>1_?8+Nc_7rL8MfO~?u3RmL}d^aOh0a5K# z&iC_AKEJ4cCvs;(a*l3l7;~B5P9J%3)MK9(9FPx(hkHgyxm);1t4>a|#{N(4buNjj|~0G)LzS~3)k{RdtkzreefM@L9z z^lmhl7O_ggBpsU1)i7LYuAIy}xN+-tWRCv;xA5)%br#9LZ)`PVQ1|?b2R%{8jF)Z8 V(d}Vv@RyDHz3leEPTl%7-8WTpHF-=_0Mj1!ijELbdC?gcB9E35-dGG?^x6&~4s+lF z=S1p{0)wSRA$z4sYDW}ia=xfQ9U;+qOMaYwSj3DPVynxsm^{+I@d^j|Jr$+0GF0a) mz~TvOk>41lGLz-(Y-05qKuP5>=}003vP B3)KJs diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NA index b87e997c6550580ef9e77f2b7817543e12fdd90f..1e44cb9a08bd8397cb2b8d98a8d2b429fe545b25 100644 GIT binary patch literal 804 zcmZ`%OHRWu5FNJ^TCpo)#iola5~-2=_k>Nw1-L+(4eBYVb0eD`ypHd&bJiMy(g{X10QgH)lY_+L<7sK&% zsG>neBWPL^xT~TCtc$*h0S}8nq9z3wT^6a0uepmhvlC7ZB9n_Y0WOEwDqDLvB5k8@ zbpy*R&I&f8YL-+QDb$jJtwd?+c&bJ_WnAb`vP+uPr7(!5Y9>$XppL#gdbq*mDGU>E z(dVS$X!T4g%%q$jlGNg#iq?hN6?#{gv~F}iG$d##3ndVGF5#QOdjBs=_$y&sGS59g Yy75>rU*V_;`!%cSFMbKcm5^GYA5zPz`v3p{ literal 878 zcma))OHRWu5QfKX1Fet{53y&FMT`;=KV#TbT!0I>*_BIB=QM1&8h79yH?#o>#G>(Z z9^XHn@%slAuSD|~A`(K-S@fabY zb|_jWM6B;Z&wc|xa&~QPhGb!=S`VDz8dg}#WcRH6mvK2mCU{+r_@+Z*il%Y7;+P|o z&tyBKZj^xJ&Q4nvwDL-~N*n9Y{e1wFyH~MowCz*Wjb*%RlV?{ilLJE!OmZL zOLbf7+tTpjs0dNHUeLTPm4N56@!ZT9l8H(?Har`6B^^$@7I`F}AIP?L)4l|i%*zN5gyY5kMZzU96D*8J zV{88%w)9aOv=ENc`+~3Qd{>{*MOL?H-Qan2PSVxhqYo}MxyMx%LRKDmIDRZ;7AD#l GJkclO8n2oF diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NU b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NU index fb8ea167f24f8aa0cc7e4d341abb562d9742b920..099065c19c913df71649584a1c1870e0dc13e99e 100644 GIT binary patch literal 190 zcmZ4UmVvc=2Ll5GBO@aNSG1w7X>3eNwQ(&Y11pd=sRfENa7G)Opo%gwu$UMa7(uic mp=kk18X6g!0416H9Ki(05VF}oouLd2Osg4~3=DwoL;(Om%p7k3 literal 128 zcmZ4UmVvdrih+TFkr70|Fe3w#pCgz6Ns!G3>I`LIU|P+X^zY$NuyRb9zom(n|viO|) ze(wC`yjzI|Gv%?S5H>N-U=y0$kuK~48y zGDjY!FfW#)b@SpmY6HJ{2^@zp%pDXiDZ0u29=DpA2kXWO7Pl^fBM^WJHK1-?2qsg& z*cz`jfDyn36|*6e=9O|ME88U;Pcn>w%P`x^*vg1i_L~KdDa eBurouK$>mxenx#p#>wv)rFa<_fhGV=0RsRIV-uSI diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SD b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SD index 05dafe7f45137fa6dd68987d12f6e52b6ee58f65..8d70a39a287d25676ba0612778c8a6bb35955a3c 100644 GIT binary patch literal 271 zcmZ4UmVvd3fq{{Y0Z1@1GH^y4TE@ntR9n)1k`9~WN2gzL?%G>JeJXhMy6nc%#qbt8Y0v%`8hH&011%!WV0EVf?a?v z|H;5)V8Fo0zz8LPLO`CV2GEU0wVEKx7($uUYBF%B7%He3DX17jR52T<7&3yGAOHX$ CR4aM_ delta 47 ocmeBYYG4#y^Ok|Nyo!N=fsqkJK=8yq!-@S86ZeaAg9M-e0N^YKwg3PC diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SG index 399191b74149a4e88a5f8fe089cf91027216df11..5c92a372647485e7773bdc02c8180701f2b00b01 100644 GIT binary patch delta 216 zcmZ3?+{048<}Cwj6$1kkGXnzyBO@b&M6|J4Y)neEd2LO!p}DRln5|=IP|L``0Ti~- zF*K|NDr68fi#F7?0Lhxw)|eX@7=ZO4DFQOh42_IUOwG)J%EdJ7tt@~#Ok-;-qYZ!> zHNiR=Cq`9Da2o?fj37oaGO&Vd0oi6eaij3W7jld&li3-w)I~HvmS}1KWld_qlyR*l Y1BZ&Cf{KxXiZRIb3{2(*ld~8t0Scru6aWAK delta 103 zcmeBSSaV^Jp_&i-~vSWjPHj3=CpY us!eJc8CZd|1(4HyA=Zf delta 67 zcmX@aynVzLRd5)VH}4Uh+togB}sE6QdVZDAQ}z{tR)V#vq<1ppDc73=^2 delta 101 zcmZ3)zJ#4~&07Z6Dh3AT*%LYM%cyGDTUo}W)EEM3qi922V^dwr*c!8FV<5Gekx`3@ rO+v#k+Q@9O5wj8}4@eb|6FWJ9SyzG+#IvZeG|*&ZU{Wz;WPkzy98(pL diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZA index f4a82cc43af6bf236037c94e2e7d8f85afcfa75e..54877d9f2704c43daed16558ae475ad585869435 100644 GIT binary patch delta 187 zcmeywbd#BL&07Z6Dh39|3lllFIr3PTMH}i`#>S*no7FNhumWjIAkArEW@uz=Vrpj2 z$jHE9VP=3SZvas+@p+ID6N9h@P>rSrP?d2ljAGzWF;q}7Qcy8w0NTdD3{(Lm4O9#n o85ky8F>2^CGDrjMHZ_l}vCy!$iZ%c;fi9_mI7kz&7N{Et08*nS?*IS* delta 84 zcmcb~{E3Nk&07Z6Dh39|%!!=aG}tZ7Vp6KjYZ)0>fwU!%=Cm*~G%_|ZH8W>qWMJ}h c1QQIC7=suYC$}(a2rw`*FdL{CGBQ8`0A?Kz`2YX_ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZW b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZW index 99b27ec0dc64da3deb6483b57edb6d1bd160ac97..0c3990e6c1e5b7ea69693f43ca192ca841ec7206 100644 GIT binary patch delta 65 zcmey({f>J>3!?FbP@4YSx%(*jq@C+? SF)%PbnC#E2z1fXrD