From 525348906ffc293f492036f66dd1144dbd4a28ca Mon Sep 17 00:00:00 2001 From: Lara Scheidegger Date: Thu, 31 Mar 2011 12:21:45 +0000 Subject: [PATCH] JAVA: RFC3966 support, metadata update, extensive comment changes, getSupportedCountries renamed to getSupportedRegions. --- java/release_notes.txt | 17 + .../phonenumbers/BuildMetadataFromXml.java | 3 + .../BuildMetadataJsonFromXml.java | 6 +- .../phonenumbers/proto/phonemetadata.proto | 9 + .../phonenumbers/src/PhoneNumberMetaData.xml | 400 ++++++-- .../test/PhoneNumberMetaDataForTesting.xml | 4 +- .../i18n/phonenumbers/AsYouTypeFormatter.java | 8 +- .../i18n/phonenumbers/PhoneNumberUtil.java | 935 +++++++++++------- .../i18n/phonenumbers/Phonemetadata.java | 35 +- .../data/PhoneNumberMetadataProto_AC | Bin 218 -> 219 bytes .../data/PhoneNumberMetadataProto_AD | Bin 351 -> 352 bytes .../data/PhoneNumberMetadataProto_AE | Bin 563 -> 564 bytes .../data/PhoneNumberMetadataProto_AF | Bin 319 -> 320 bytes .../data/PhoneNumberMetadataProto_AG | Bin 475 -> 476 bytes .../data/PhoneNumberMetadataProto_AI | Bin 409 -> 410 bytes .../data/PhoneNumberMetadataProto_AL | Bin 706 -> 707 bytes .../data/PhoneNumberMetadataProto_AM | Bin 523 -> 524 bytes .../data/PhoneNumberMetadataProto_AN | Bin 555 -> 556 bytes .../data/PhoneNumberMetadataProto_AO | Bin 290 -> 291 bytes .../data/PhoneNumberMetadataProto_AR | Bin 2111 -> 2112 bytes .../data/PhoneNumberMetadataProto_AS | Bin 391 -> 392 bytes .../data/PhoneNumberMetadataProto_AT | Bin 1026 -> 1027 bytes .../data/PhoneNumberMetadataProto_AU | Bin 813 -> 814 bytes .../data/PhoneNumberMetadataProto_AW | Bin 366 -> 367 bytes .../data/PhoneNumberMetadataProto_AZ | Bin 731 -> 737 bytes .../data/PhoneNumberMetadataProto_BA | Bin 379 -> 380 bytes .../data/PhoneNumberMetadataProto_BB | Bin 387 -> 388 bytes .../data/PhoneNumberMetadataProto_BD | Bin 1031 -> 1032 bytes .../data/PhoneNumberMetadataProto_BE | Bin 685 -> 686 bytes .../data/PhoneNumberMetadataProto_BF | Bin 383 -> 384 bytes .../data/PhoneNumberMetadataProto_BG | Bin 774 -> 775 bytes .../data/PhoneNumberMetadataProto_BH | Bin 433 -> 434 bytes .../data/PhoneNumberMetadataProto_BI | Bin 316 -> 317 bytes .../data/PhoneNumberMetadataProto_BJ | Bin 388 -> 389 bytes .../data/PhoneNumberMetadataProto_BL | Bin 272 -> 273 bytes .../data/PhoneNumberMetadataProto_BM | Bin 425 -> 426 bytes .../data/PhoneNumberMetadataProto_BN | Bin 274 -> 275 bytes .../data/PhoneNumberMetadataProto_BO | Bin 530 -> 531 bytes .../data/PhoneNumberMetadataProto_BR | Bin 683 -> 684 bytes .../data/PhoneNumberMetadataProto_BS | Bin 567 -> 568 bytes .../data/PhoneNumberMetadataProto_BT | Bin 380 -> 381 bytes .../data/PhoneNumberMetadataProto_BW | Bin 515 -> 516 bytes .../data/PhoneNumberMetadataProto_BY | Bin 591 -> 592 bytes .../data/PhoneNumberMetadataProto_BZ | Bin 385 -> 386 bytes .../data/PhoneNumberMetadataProto_CA | Bin 660 -> 661 bytes .../data/PhoneNumberMetadataProto_CD | Bin 360 -> 361 bytes .../data/PhoneNumberMetadataProto_CF | Bin 301 -> 302 bytes .../data/PhoneNumberMetadataProto_CG | Bin 347 -> 348 bytes .../data/PhoneNumberMetadataProto_CH | Bin 500 -> 501 bytes .../data/PhoneNumberMetadataProto_CI | Bin 380 -> 381 bytes .../data/PhoneNumberMetadataProto_CK | Bin 154 -> 155 bytes .../data/PhoneNumberMetadataProto_CL | Bin 884 -> 885 bytes .../data/PhoneNumberMetadataProto_CM | Bin 381 -> 382 bytes .../data/PhoneNumberMetadataProto_CN | Bin 2579 -> 2580 bytes .../data/PhoneNumberMetadataProto_CO | Bin 832 -> 833 bytes .../data/PhoneNumberMetadataProto_CR | Bin 419 -> 420 bytes .../data/PhoneNumberMetadataProto_CU | Bin 435 -> 436 bytes .../data/PhoneNumberMetadataProto_CV | Bin 316 -> 317 bytes .../data/PhoneNumberMetadataProto_CY | Bin 345 -> 346 bytes .../data/PhoneNumberMetadataProto_CZ | Bin 413 -> 414 bytes .../data/PhoneNumberMetadataProto_DE | Bin 1639 -> 1640 bytes .../data/PhoneNumberMetadataProto_DJ | Bin 277 -> 278 bytes .../data/PhoneNumberMetadataProto_DK | Bin 410 -> 411 bytes .../data/PhoneNumberMetadataProto_DM | Bin 434 -> 435 bytes .../data/PhoneNumberMetadataProto_DO | Bin 375 -> 376 bytes .../data/PhoneNumberMetadataProto_DZ | Bin 589 -> 590 bytes .../data/PhoneNumberMetadataProto_EC | Bin 570 -> 571 bytes .../data/PhoneNumberMetadataProto_EE | Bin 796 -> 806 bytes .../data/PhoneNumberMetadataProto_EG | Bin 593 -> 594 bytes .../data/PhoneNumberMetadataProto_ER | Bin 317 -> 318 bytes .../data/PhoneNumberMetadataProto_ES | Bin 394 -> 395 bytes .../data/PhoneNumberMetadataProto_ET | Bin 1073 -> 1074 bytes .../data/PhoneNumberMetadataProto_FI | Bin 718 -> 729 bytes .../data/PhoneNumberMetadataProto_FJ | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_FK | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_FM | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_FO | Bin 399 -> 400 bytes .../data/PhoneNumberMetadataProto_FR | Bin 494 -> 495 bytes .../data/PhoneNumberMetadataProto_GA | Bin 545 -> 546 bytes .../data/PhoneNumberMetadataProto_GB | Bin 2742 -> 2743 bytes .../data/PhoneNumberMetadataProto_GD | Bin 484 -> 485 bytes .../data/PhoneNumberMetadataProto_GE | Bin 695 -> 696 bytes .../data/PhoneNumberMetadataProto_GF | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_GG | Bin 581 -> 582 bytes .../data/PhoneNumberMetadataProto_GH | Bin 438 -> 439 bytes .../data/PhoneNumberMetadataProto_GI | Bin 316 -> 317 bytes .../data/PhoneNumberMetadataProto_GL | Bin 337 -> 338 bytes .../data/PhoneNumberMetadataProto_GM | Bin 353 -> 354 bytes .../data/PhoneNumberMetadataProto_GN | Bin 387 -> 388 bytes .../data/PhoneNumberMetadataProto_GP | Bin 373 -> 374 bytes .../data/PhoneNumberMetadataProto_GQ | Bin 427 -> 428 bytes .../data/PhoneNumberMetadataProto_GR | Bin 826 -> 827 bytes .../data/PhoneNumberMetadataProto_GT | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_GU | Bin 444 -> 445 bytes .../data/PhoneNumberMetadataProto_GW | Bin 298 -> 299 bytes .../data/PhoneNumberMetadataProto_GY | Bin 153 -> 154 bytes .../data/PhoneNumberMetadataProto_HK | Bin 470 -> 471 bytes .../data/PhoneNumberMetadataProto_HN | Bin 464 -> 465 bytes .../data/PhoneNumberMetadataProto_HR | Bin 884 -> 885 bytes .../data/PhoneNumberMetadataProto_HT | Bin 335 -> 336 bytes .../data/PhoneNumberMetadataProto_HU | Bin 487 -> 488 bytes .../data/PhoneNumberMetadataProto_ID | Bin 1057 -> 1058 bytes .../data/PhoneNumberMetadataProto_IE | Bin 1189 -> 1190 bytes .../data/PhoneNumberMetadataProto_IL | Bin 843 -> 844 bytes .../data/PhoneNumberMetadataProto_IM | Bin 500 -> 501 bytes .../data/PhoneNumberMetadataProto_IN | Bin 2893 -> 3101 bytes .../data/PhoneNumberMetadataProto_IO | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_IQ | Bin 441 -> 442 bytes .../data/PhoneNumberMetadataProto_IR | Bin 864 -> 865 bytes .../data/PhoneNumberMetadataProto_IS | Bin 653 -> 654 bytes .../data/PhoneNumberMetadataProto_IT | Bin 904 -> 905 bytes .../data/PhoneNumberMetadataProto_JE | Bin 679 -> 680 bytes .../data/PhoneNumberMetadataProto_JM | Bin 529 -> 530 bytes .../data/PhoneNumberMetadataProto_JO | Bin 545 -> 539 bytes .../data/PhoneNumberMetadataProto_JP | Bin 4582 -> 4583 bytes .../data/PhoneNumberMetadataProto_KE | Bin 451 -> 452 bytes .../data/PhoneNumberMetadataProto_KG | Bin 598 -> 599 bytes .../data/PhoneNumberMetadataProto_KH | Bin 504 -> 505 bytes .../data/PhoneNumberMetadataProto_KI | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_KM | Bin 282 -> 283 bytes .../data/PhoneNumberMetadataProto_KN | Bin 418 -> 419 bytes .../data/PhoneNumberMetadataProto_KP | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_KR | Bin 1568 -> 1569 bytes .../data/PhoneNumberMetadataProto_KW | Bin 453 -> 461 bytes .../data/PhoneNumberMetadataProto_KY | Bin 517 -> 518 bytes .../data/PhoneNumberMetadataProto_KZ | Bin 829 -> 833 bytes .../data/PhoneNumberMetadataProto_LA | Bin 391 -> 392 bytes .../data/PhoneNumberMetadataProto_LB | Bin 487 -> 488 bytes .../data/PhoneNumberMetadataProto_LC | Bin 462 -> 463 bytes .../data/PhoneNumberMetadataProto_LI | Bin 747 -> 748 bytes .../data/PhoneNumberMetadataProto_LK | Bin 395 -> 396 bytes .../data/PhoneNumberMetadataProto_LR | Bin 391 -> 392 bytes .../data/PhoneNumberMetadataProto_LS | Bin 279 -> 280 bytes .../data/PhoneNumberMetadataProto_LT | Bin 527 -> 528 bytes .../data/PhoneNumberMetadataProto_LU | Bin 1460 -> 1461 bytes .../data/PhoneNumberMetadataProto_LV | Bin 301 -> 302 bytes .../data/PhoneNumberMetadataProto_LY | Bin 310 -> 311 bytes .../data/PhoneNumberMetadataProto_MA | Bin 715 -> 716 bytes .../data/PhoneNumberMetadataProto_MC | Bin 456 -> 457 bytes .../data/PhoneNumberMetadataProto_MD | Bin 550 -> 551 bytes .../data/PhoneNumberMetadataProto_ME | Bin 152 -> 650 bytes .../data/PhoneNumberMetadataProto_MF | Bin 278 -> 279 bytes .../data/PhoneNumberMetadataProto_MG | Bin 369 -> 370 bytes .../data/PhoneNumberMetadataProto_MH | Bin 153 -> 154 bytes .../data/PhoneNumberMetadataProto_MK | Bin 584 -> 585 bytes .../data/PhoneNumberMetadataProto_ML | Bin 415 -> 416 bytes .../data/PhoneNumberMetadataProto_MM | Bin 584 -> 585 bytes .../data/PhoneNumberMetadataProto_MN | Bin 690 -> 691 bytes .../data/PhoneNumberMetadataProto_MO | Bin 285 -> 286 bytes .../data/PhoneNumberMetadataProto_MP | Bin 462 -> 463 bytes .../data/PhoneNumberMetadataProto_MQ | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_MR | Bin 510 -> 511 bytes .../data/PhoneNumberMetadataProto_MS | Bin 358 -> 359 bytes .../data/PhoneNumberMetadataProto_MT | Bin 428 -> 429 bytes .../data/PhoneNumberMetadataProto_MU | Bin 440 -> 441 bytes .../data/PhoneNumberMetadataProto_MV | Bin 358 -> 466 bytes .../data/PhoneNumberMetadataProto_MW | Bin 508 -> 509 bytes .../data/PhoneNumberMetadataProto_MX | Bin 1767 -> 1768 bytes .../data/PhoneNumberMetadataProto_MY | Bin 638 -> 639 bytes .../data/PhoneNumberMetadataProto_MZ | Bin 378 -> 379 bytes .../data/PhoneNumberMetadataProto_NA | Bin 828 -> 829 bytes .../data/PhoneNumberMetadataProto_NC | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_NE | Bin 455 -> 456 bytes .../data/PhoneNumberMetadataProto_NF | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_NG | Bin 835 -> 836 bytes .../data/PhoneNumberMetadataProto_NI | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_NL | Bin 621 -> 622 bytes .../data/PhoneNumberMetadataProto_NO | Bin 565 -> 566 bytes .../data/PhoneNumberMetadataProto_NP | Bin 505 -> 506 bytes .../data/PhoneNumberMetadataProto_NR | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_NU | Bin 214 -> 215 bytes .../data/PhoneNumberMetadataProto_NZ | Bin 770 -> 771 bytes .../data/PhoneNumberMetadataProto_OM | Bin 401 -> 402 bytes .../data/PhoneNumberMetadataProto_PA | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_PE | Bin 415 -> 416 bytes .../data/PhoneNumberMetadataProto_PF | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_PG | Bin 442 -> 443 bytes .../data/PhoneNumberMetadataProto_PH | Bin 953 -> 954 bytes .../data/PhoneNumberMetadataProto_PK | Bin 1724 -> 1725 bytes .../data/PhoneNumberMetadataProto_PL | Bin 585 -> 586 bytes .../data/PhoneNumberMetadataProto_PM | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_PR | Bin 384 -> 385 bytes .../data/PhoneNumberMetadataProto_PS | Bin 535 -> 536 bytes .../data/PhoneNumberMetadataProto_PT | Bin 464 -> 465 bytes .../data/PhoneNumberMetadataProto_PW | Bin 147 -> 148 bytes .../data/PhoneNumberMetadataProto_PY | Bin 153 -> 154 bytes .../data/PhoneNumberMetadataProto_QA | Bin 343 -> 344 bytes .../data/PhoneNumberMetadataProto_RE | Bin 402 -> 403 bytes .../data/PhoneNumberMetadataProto_RO | Bin 453 -> 454 bytes .../data/PhoneNumberMetadataProto_RS | Bin 549 -> 550 bytes .../data/PhoneNumberMetadataProto_RU | Bin 571 -> 566 bytes .../data/PhoneNumberMetadataProto_RW | Bin 379 -> 380 bytes .../data/PhoneNumberMetadataProto_SA | Bin 601 -> 602 bytes .../data/PhoneNumberMetadataProto_SB | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_SC | Bin 623 -> 624 bytes .../data/PhoneNumberMetadataProto_SD | Bin 295 -> 296 bytes .../data/PhoneNumberMetadataProto_SE | Bin 2289 -> 2290 bytes .../data/PhoneNumberMetadataProto_SG | Bin 559 -> 560 bytes .../data/PhoneNumberMetadataProto_SH | Bin 241 -> 242 bytes .../data/PhoneNumberMetadataProto_SI | Bin 655 -> 656 bytes .../data/PhoneNumberMetadataProto_SK | Bin 550 -> 551 bytes .../data/PhoneNumberMetadataProto_SL | Bin 321 -> 322 bytes .../data/PhoneNumberMetadataProto_SM | Bin 583 -> 584 bytes .../data/PhoneNumberMetadataProto_SN | Bin 460 -> 461 bytes .../data/PhoneNumberMetadataProto_SO | Bin 334 -> 335 bytes .../data/PhoneNumberMetadataProto_SR | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_ST | Bin 250 -> 251 bytes .../data/PhoneNumberMetadataProto_SV | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_SY | Bin 432 -> 433 bytes .../data/PhoneNumberMetadataProto_SZ | Bin 494 -> 495 bytes .../data/PhoneNumberMetadataProto_TC | Bin 451 -> 452 bytes .../data/PhoneNumberMetadataProto_TD | Bin 343 -> 344 bytes .../data/PhoneNumberMetadataProto_TF | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_TG | Bin 313 -> 314 bytes .../data/PhoneNumberMetadataProto_TH | Bin 537 -> 538 bytes .../data/PhoneNumberMetadataProto_TJ | Bin 586 -> 587 bytes .../data/PhoneNumberMetadataProto_TK | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_TL | Bin 331 -> 332 bytes .../data/PhoneNumberMetadataProto_TM | Bin 309 -> 310 bytes .../data/PhoneNumberMetadataProto_TN | Bin 305 -> 306 bytes .../data/PhoneNumberMetadataProto_TO | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_TR | Bin 661 -> 662 bytes .../data/PhoneNumberMetadataProto_TT | Bin 510 -> 514 bytes .../data/PhoneNumberMetadataProto_TV | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_TW | Bin 412 -> 413 bytes .../data/PhoneNumberMetadataProto_TZ | Bin 507 -> 508 bytes .../data/PhoneNumberMetadataProto_UA | Bin 1051 -> 1052 bytes .../data/PhoneNumberMetadataProto_UG | Bin 524 -> 525 bytes .../data/PhoneNumberMetadataProto_US | Bin 1577 -> 1578 bytes .../data/PhoneNumberMetadataProto_UY | Bin 152 -> 153 bytes .../data/PhoneNumberMetadataProto_UZ | Bin 320 -> 321 bytes .../data/PhoneNumberMetadataProto_VA | Bin 245 -> 246 bytes .../data/PhoneNumberMetadataProto_VC | Bin 504 -> 505 bytes .../data/PhoneNumberMetadataProto_VE | Bin 400 -> 401 bytes .../data/PhoneNumberMetadataProto_VG | Bin 489 -> 490 bytes .../data/PhoneNumberMetadataProto_VI | Bin 511 -> 512 bytes .../data/PhoneNumberMetadataProto_VN | Bin 954 -> 955 bytes .../data/PhoneNumberMetadataProto_VU | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_WF | Bin 146 -> 147 bytes .../data/PhoneNumberMetadataProto_WS | Bin 375 -> 376 bytes .../data/PhoneNumberMetadataProto_YE | Bin 422 -> 423 bytes .../data/PhoneNumberMetadataProto_YT | Bin 260 -> 261 bytes .../data/PhoneNumberMetadataProto_ZA | Bin 497 -> 498 bytes .../data/PhoneNumberMetadataProto_ZM | Bin 362 -> 363 bytes .../data/PhoneNumberMetadataProto_ZW | Bin 1542 -> 1543 bytes .../phonenumbers/AsYouTypeFormatterTest.java | 8 +- .../i18n/phonenumbers/ExampleNumbersTest.java | 4 +- .../phonenumbers/PhoneNumberUtilTest.java | 209 ++-- .../PhoneNumberMetadataProtoForTesting_AD | Bin 146 -> 147 bytes .../PhoneNumberMetadataProtoForTesting_AO | Bin 300 -> 301 bytes .../PhoneNumberMetadataProtoForTesting_AR | Bin 835 -> 836 bytes .../PhoneNumberMetadataProtoForTesting_AU | Bin 358 -> 359 bytes .../PhoneNumberMetadataProtoForTesting_BS | Bin 371 -> 372 bytes .../PhoneNumberMetadataProtoForTesting_DE | Bin 716 -> 717 bytes .../PhoneNumberMetadataProtoForTesting_GB | Bin 518 -> 519 bytes .../PhoneNumberMetadataProtoForTesting_IT | Bin 454 -> 455 bytes .../PhoneNumberMetadataProtoForTesting_JP | Bin 435 -> 436 bytes .../PhoneNumberMetadataProtoForTesting_KR | Bin 1558 -> 1559 bytes .../PhoneNumberMetadataProtoForTesting_MX | Bin 939 -> 940 bytes .../PhoneNumberMetadataProtoForTesting_NZ | Bin 534 -> 535 bytes .../PhoneNumberMetadataProtoForTesting_PL | Bin 307 -> 308 bytes .../PhoneNumberMetadataProtoForTesting_RE | Bin 389 -> 390 bytes .../PhoneNumberMetadataProtoForTesting_SG | Bin 392 -> 393 bytes .../PhoneNumberMetadataProtoForTesting_US | Bin 511 -> 512 bytes .../PhoneNumberMetadataProtoForTesting_YT | Bin 261 -> 265 bytes 265 files changed, 1083 insertions(+), 555 deletions(-) diff --git a/java/release_notes.txt b/java/release_notes.txt index 860459587..3460a14f1 100644 --- a/java/release_notes.txt +++ b/java/release_notes.txt @@ -1,3 +1,20 @@ +Mar 31st, 2011 +* New functionality: + - Can parse and format numbers in RFC-3966 format. + - Added isAlphaNumber to check to see if a number is a "vanity" or "alpha" number + - Can format a number made up of alpha-characters in an "out-of-country" format (e.g. 0011 1 + 800-SIX-FLAG to dial an American alpha-number from Australia). +* Code changes: + - Renamed private vars, private methods and fixed comments to try and differentiate between country + (calling) codes and region codes. + == Non-backwards-compatible API changes: == + - Renamed getSupportedCountries to getSupportedRegions, as this more accurately reflects that the + library is based around region codes. + - getNationalSignificantNumber is no longer a static method, but is instead an instance method. +* Metadata changes: + - Bug-fixes and updates for AU, AZ, EE, FI, IN, JO, KW, KZ, MV, RU, RR, VA + - New country: ME + Mar 22nd, 2011 * Metadata changes: - New mobile-number pattern for AU diff --git a/java/resources/com/google/i18n/phonenumbers/BuildMetadataFromXml.java b/java/resources/com/google/i18n/phonenumbers/BuildMetadataFromXml.java index 04f7849d1..7f552d922 100644 --- a/java/resources/com/google/i18n/phonenumbers/BuildMetadataFromXml.java +++ b/java/resources/com/google/i18n/phonenumbers/BuildMetadataFromXml.java @@ -154,6 +154,9 @@ public class BuildMetadataFromXml { if (element.hasAttribute("mainCountryForCode")) { metadata.setMainCountryForCode(true); } + if (element.hasAttribute("leadingZeroPossible")) { + metadata.setLeadingZeroPossible(true); + } // Extract availableFormats NodeList numberFormatElements = element.getElementsByTagName("numberFormat"); diff --git a/java/resources/com/google/i18n/phonenumbers/BuildMetadataJsonFromXml.java b/java/resources/com/google/i18n/phonenumbers/BuildMetadataJsonFromXml.java index 81d6ad5a7..5120311dd 100644 --- a/java/resources/com/google/i18n/phonenumbers/BuildMetadataJsonFromXml.java +++ b/java/resources/com/google/i18n/phonenumbers/BuildMetadataJsonFromXml.java @@ -182,7 +182,7 @@ public class BuildMetadataJsonFromXml { // required string format = 2; jsArrayBuilder.append(format.getFormat()); // repeated string leading_digits_pattern = 3; - int leadingDigitsPatternSize = format.getLeadingDigitsPatternCount(); + int leadingDigitsPatternSize = format.leadingDigitsPatternSize(); if (leadingDigitsPatternSize > 0) { jsArrayBuilder.beginArray(); for (int i = 0; i < leadingDigitsPatternSize; i++) { @@ -310,7 +310,7 @@ public class BuildMetadataJsonFromXml { jsArrayBuilder.append(null); } // repeated NumberFormat number_format = 19; - int numberFormatSize = metadata.getNumberFormatCount(); + int numberFormatSize = metadata.numberFormatSize(); if (numberFormatSize > 0) { jsArrayBuilder.beginArray(); for (int i = 0; i < numberFormatSize; i++) { @@ -321,7 +321,7 @@ public class BuildMetadataJsonFromXml { jsArrayBuilder.append(null); } // repeated NumberFormat intl_number_format = 20; - int intlNumberFormatSize = metadata.getIntlNumberFormatCount(); + int intlNumberFormatSize = metadata.intlNumberFormatSize(); if (intlNumberFormatSize > 0) { jsArrayBuilder.beginArray(); for (int i = 0; i < intlNumberFormatSize; i++) { diff --git a/java/resources/com/google/i18n/phonenumbers/proto/phonemetadata.proto b/java/resources/com/google/i18n/phonenumbers/proto/phonemetadata.proto index 42f0a994d..0cf1faee1 100644 --- a/java/resources/com/google/i18n/phonenumbers/proto/phonemetadata.proto +++ b/java/resources/com/google/i18n/phonenumbers/proto/phonemetadata.proto @@ -218,6 +218,15 @@ message PhoneMetadata { // numbers are valid for all NANPA countries.) This field should be a regular // expression of the expected prefix match. optional string leading_digits = 23; + + // The leading zero in a phone number is meaningful in some countries (e.g. + // Italy). This means they cannot be dropped from the national number when + // converting into international format. If leading zeros are possible for + // valid international numbers for this region/country then set this to true. + // This only needs to be set for the region that is the main_country_for_code + // and all regions associated with that calling code will use the same + // setting. + optional bool leading_zero_possible = 26 [default=false]; } message PhoneMetadataCollection { diff --git a/java/resources/com/google/i18n/phonenumbers/src/PhoneNumberMetaData.xml b/java/resources/com/google/i18n/phonenumbers/src/PhoneNumberMetaData.xml index 80bb09fb0..e4fd71f2e 100644 --- a/java/resources/com/google/i18n/phonenumbers/src/PhoneNumberMetaData.xml +++ b/java/resources/com/google/i18n/phonenumbers/src/PhoneNumberMetaData.xml @@ -73,6 +73,7 @@ + @@ -1365,7 +1366,8 @@ + numbers. Also includes the area code 44 for CDMA regions, which are classified under + "Fixed Network" by the national plan. --> (?: 1(?: @@ -1390,7 +1392,8 @@ 6[56]| 79 )| - 365?\d + 365?\d| + 44\d{2} )\d{5} 123123456 @@ -1398,9 +1401,8 @@ (?: - 4[04]| + [46]0| 5[015]| - 60| 7[07] )\d{7} @@ -2718,7 +2720,7 @@ - + [2-8] @@ -2764,8 +2766,7 @@ - + @@ -2961,7 +2962,7 @@ - + [02] @@ -3053,7 +3054,7 @@ - + @@ -4668,20 +4669,19 @@ - - [3679]| + [369]| 4[3-8]| 5(?: [0-2]| 5[0-478]| 6[45] - ) + )| + 7[1-9] - [3679]| + [369]| 4[3-8]| 5(?: [02]| @@ -4694,7 +4694,8 @@ 4[0-4]| 5[1-589] ) - ) + )| + 7[1-9] $1 $2 @@ -4732,7 +4733,7 @@ [3-9]\d{6,7}| 800\d{6,7} - \d{6,10} + \d{7,10} 800[2-9]\d{3} @@ -4795,10 +4796,8 @@ 9001234 - - 70[0-2]?\d{5} - \d{7,8} + 70[0-2]\d{5} + \d{8} 70012345 @@ -5171,7 +5170,10 @@ - [1-9]\d{4,11} + + 1\d{4,11}| + [2-9]\d{4,10} + \d{5,12} @@ -5377,7 +5379,7 @@ - + [4-9] @@ -7875,10 +7877,13 @@ 7(?: + 2[0579]| 39| - 5[5-9]| - [67][02-9]| - 8[0-6] + 4[0-389]| + 5[04-9]| + 6| + 7[02-9]| + 8[0-79] )| 8(?: 0[01589]| @@ -7890,13 +7895,18 @@ 7(?: + 2[0579]| 39| + 4[0-389]| 5(?: + 0[0-5]| + 49| 50| [6-9] )| - [67][02-9]| - 8[0-6] + 6| + 7[02-9]| + 8[0-79] )| 8(?: 0[01589]| @@ -8255,37 +8265,58 @@ [013-8]\d ) ) - )[2-6]\d{5} + )[2-6]\d{5} + \d{6,10} 1123456789 - + - + (?: 7(?: - 39[89]| + 2(?: + 0[04-9]| + 5[09]| + 7[568]| + 9[39] + )| + 3(?: + 07| + 7[3679]| + 9[689] + )| + 4(?: + 05| + 1[15-9]| + [29][89]| + 39| + 8[389] + )| 5(?: + 0[0-5]| + [47]9| 50| - 6[6-8]| - 79| + 6[6-9]| [89][7-9] )| 6(?: 0[027]| + 12| 20| 3[19]| - 54| - 65| + 5[45]| + 6[5-9]| 7[67]| 9[6-9] )| 7(?: - 0[89]| - 3[589]| + 0[289]| + 3[5-9]| 42| 60| 9[5-9] @@ -8295,14 +8326,21 @@ 14| 2[7-9]| 4[25]| - 6[09] + 6[09]| + 7[015689]| + 9[0357-9] ) )\d| 9\d{4}| 8(?: (?: 0[01589]| - 1[024] + 1[24]| + 2[2369]| + 4[023458]| + 52| + 6[0589]| + 7[2569] )\d| 8(?: [079]\d| @@ -8625,7 +8663,7 @@ - + @@ -9046,7 +9084,7 @@ [235-9]\d{7,8} - \d{8,9} + \d{7,9} + + 8(?: + 10| + [78]\d + )\d{5} + + \d{8} + 87101234 + @@ -10593,18 +10633,20 @@ (?: 5(?: - 0[02]| + 0[0-2]| 5\d )| 6(?: 0[034679]| 5[015-9]| 6\d| - 7[067] + 7[067]| + 99 )| 9(?: 0[09]| 4[049]| + 66| [79]\d ) )\d{5} @@ -10716,19 +10758,24 @@ - + (?: - [67]\d{2}| + 7\d{2}| 80[09] )\d{7} \d{10} + + 751\d{7} + \d{10} + 7511234567 + @@ -10751,14 +10798,14 @@ )| 3(?: 2\d| - 3[1-7]| - 4[1235-9]| + 3[1-79]| + 4[0-35-9]| 59 )| 4(?: 2\d| 3[013-79]| - 4[0-58]| + 4[0-8]| 5[1-79] )| 5(?: @@ -10768,15 +10815,16 @@ 59 )| 6(?: - 22| + 2\d| [34]\d| - 5[19] + 5[19]| + 61 )| 72\d| 8(?: [27]\d| 3[1-46-9]| - 4[0-4]| + 4[0-5]| ) )| 2(?: @@ -10796,16 +10844,18 @@ 5[139]| )| 4(?: - 22| - 3[1235-8] + 2\d| + 3[1235-9]| + 59 )| 5(?: [23]\d| - 4[0124-8]| - 59 + 4[01246-8]| + 59| + 61 )| 6(?: - 22| + 2\d| 3[1-9]| 4[0-4]| 59 @@ -10823,7 +10873,7 @@ )| 9(?: 2\d| - 3[12478]| + 3[124578]| 59 ) )| @@ -10833,25 +10883,14 @@ 7123456789 - 7(?: 0[01257]\d{2}| - 1[2-578]9[01]| - 2(?: - [13-6]9[01]| - 7(?: - 58| - 9[01] - ) - )| 6[02-4]\d{2}| 7[157]\d{2} - )\d{5}| - 6\d{9} + )\d{5} - 7129012345 + 7710009998 800\d{7} @@ -10861,6 +10900,10 @@ 809\d{7} 8091234567 + + 751\d{7} + 7511234567 + @@ -11882,8 +11925,130 @@ - + + + + + [2-57-9]|6[3789] + + [2-57-9]| + 6(?: + [389]| + 7(?: + [0-8]| + 9[3-9] + ) + ) + + $1 $2 $3 + + + 679 + 679[0-2] + $1 $2 $3 $4 + + + + [2-9]\d{7,8} + \d{6,9} + + + + + (?: + 20[2-8]| + 3(?: + 0[2-7]| + 1[35-7]| + 2[367]| + 3[4-7] + )| + 4(?: + 0[237]| + 1[2467] + )| + 5(?: + 0[47]| + 1[27]| + 2[378] + ) + )\d{5} + + \d{6,8} + 30234567 + + + + + 6(?: + 32\d| + [89]\d{2}| + 7(?: + [0-8]\d| + 9(?: + [3-9]| + [0-2]\d + ) + ) + )\d{4} + + + \d{8,9} + 67622901 + + + + 800[28]\d{4} + \d{8} + 80080002 + + + + + (?: + 88\d| + 9(?: + 4[13-8]| + 5[16-8] + ) + )\d{5} + + \d{8} + 94515151 + + + + 78[134579]\d{5} + \d{8} + 78108780 + + + + 77\d{6} + \d{8} + 77273012 + + + + + 1(?: + 16\d{3}| + 2\d{1,2}| + [0135]\d{2}| + 4\d{2,3}| + 9\d{3} + ) + + \d{3,6} + 123 + @@ -12644,46 +12809,69 @@ preferredInternationalPrefix="00"> + + [367]| + 9(?: + [1-9]| + 0[1-9] + ) + $1-$2 + + 900 + $1 $2 $3 + - [3679]\d{6} - \d{7} + + [367]\d{6}| + 9(?: + 00\d{7}| + \d{6} + ) + + \d{7,10} - + (?: 3(?: - 00| + 0[01]| 3[0-59]| )| 6(?: [567][02468]| - 8[024689] + 8[024689]| + 90 ) )\d{4} + \d{7} 6701234 (?: - 7(?: - [679]\d| - 8[02-9] - )| - 9[6-9]\d - )\d{4} + 7[36-9]| + 9[6-9] + )\d{5} + \d{7} 7712345 781\d{4} + \d{7} 7812345 + + 900\d{7} + \d{10} + 9001234567 + 1(?: @@ -13309,7 +13497,7 @@ - + @@ -13558,7 +13746,7 @@ - + [489] @@ -14979,8 +15167,8 @@ [34689] $1 $2-$3-$4 - - [67] + + 7 $1 $2 $3 @@ -15887,7 +16075,8 @@ and without this area code. The nationalPrefixForParsing and nationalPrefixTransformRule are used to ensure that if the 0549 is not present, it will be added. --> + nationalPrefixForParsing="(?:0549)?([89]\d{5})" nationalPrefixTransformRule="0549$1" + leadingZeroPossible="true"> [5-7] @@ -16151,7 +16340,7 @@ - + [2-6] @@ -16350,7 +16539,7 @@ - + $1 $2 $3 @@ -16764,6 +16953,7 @@ 2[1-4] )| 6(?: + 07| 1[4-6]| 2[1-9]| [3-6]\d| @@ -17488,7 +17678,7 @@ - + $1 $2 $3 diff --git a/java/resources/com/google/i18n/phonenumbers/test/PhoneNumberMetaDataForTesting.xml b/java/resources/com/google/i18n/phonenumbers/test/PhoneNumberMetaDataForTesting.xml index c01acf742..81969118f 100644 --- a/java/resources/com/google/i18n/phonenumbers/test/PhoneNumberMetaDataForTesting.xml +++ b/java/resources/com/google/i18n/phonenumbers/test/PhoneNumberMetaDataForTesting.xml @@ -194,7 +194,7 @@ [34]0|[68]9 - $1 $2 + $1/$2 - + 0[26] diff --git a/java/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java b/java/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java index 11b8ba08f..15d9313d2 100644 --- a/java/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java +++ b/java/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java @@ -133,9 +133,9 @@ public class AsYouTypeFormatter { private void getAvailableFormats(String leadingThreeDigits) { List formatList = - (isInternationalFormatting && currentMetaData.getIntlNumberFormatCount() > 0) - ? currentMetaData.getIntlNumberFormatList() - : currentMetaData.getNumberFormatList(); + (isInternationalFormatting && currentMetaData.intlNumberFormatSize() > 0) + ? currentMetaData.intlNumberFormats() + : currentMetaData.numberFormats(); possibleFormats.addAll(formatList); narrowDownPossibleFormats(leadingThreeDigits); } @@ -146,7 +146,7 @@ public class AsYouTypeFormatter { Iterator it = possibleFormats.iterator(); while (it.hasNext()) { NumberFormat format = it.next(); - if (format.getLeadingDigitsPatternCount() > indexOfLeadingDigitsPattern) { + if (format.leadingDigitsPatternSize() > indexOfLeadingDigitsPattern) { Pattern leadingDigitsPattern = regexCache.getPatternForRegex( format.getLeadingDigitsPattern(indexOfLeadingDigitsPattern)); diff --git a/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java b/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java index 52b826e07..13a5bc2e1 100644 --- a/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java +++ b/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java @@ -44,6 +44,9 @@ import java.util.regex.Pattern; * Utility for international phone numbers. Functionality includes formatting, parsing and * validation. * + *

If you use this library, and want to be notified about important changes, please sign up to + * our mailing list. + * * @author Shaopeng Jia * @author Lara Rennie */ @@ -53,36 +56,38 @@ public class PhoneNumberUtil { // The minimum and maximum length of the national significant number. private static final int MIN_LENGTH_FOR_NSN = 3; static final int MAX_LENGTH_FOR_NSN = 15; - // The maximum length of the country code. + // The maximum length of the country calling code. static final int MAX_LENGTH_COUNTRY_CODE = 3; static final String META_DATA_FILE_PREFIX = "/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto"; private String currentFilePrefix = META_DATA_FILE_PREFIX; private static final Logger LOGGER = Logger.getLogger(PhoneNumberUtil.class.getName()); - // A mapping from a country code to the region codes which denote the country/region - // represented by that country code. In the case of multiple countries sharing a calling code, - // such as the NANPA countries, the one indicated with "isMainCountryForCode" in the metadata - // should be first. - private Map> countryCodeToRegionCodeMap = null; + // A mapping from a country calling code to the region codes which denote the region represented + // by that country calling code. In the case of multiple regions sharing a calling code, such as + // the NANPA regions, the one indicated with "isMainCountryForCode" in the metadata should be + // first. + private Map> countryCallingCodeToRegionCodeMap = null; - // The set of countries the library supports. + // The set of regions the library supports. // There are roughly 220 of them and we set the initial capacity of the HashSet to 300 to offer a // load factor of roughly 0.75. - private final Set supportedCountries = new HashSet(300); + private final Set supportedRegions = new HashSet(300); // Region-code for the unknown region. private static final String UNKNOWN_REGION = "ZZ"; - // The set of countries that share country code 1. - // There are roughly 26 countries of them and we set the initial capacity of the HashSet to 35 - // to offer a load factor of roughly 0.75. - private final Set nanpaCountries = new HashSet(35); + // The set of regions that share country code 1. + // There are roughly 26 regions and we set the initial capacity of the HashSet to 35 to offer a + // load factor of roughly 0.75. + private final Set nanpaRegions = new HashSet(35); private static final int NANPA_COUNTRY_CODE = 1; // The PLUS_SIGN signifies the international prefix. static final char PLUS_SIGN = '+'; + private static final String RFC3966_EXTN_PREFIX = ";ext="; + // These mappings map a character (key) to a specific digit that should replace it for // normalization purposes. Non-European digits that may be used in phone numbers are mapped to a // European equivalent. @@ -94,45 +99,53 @@ public class PhoneNumberUtil { // For performance reasons, amalgamate both into one map. private static final Map ALL_NORMALIZATION_MAPPINGS; + // Separate map of all symbols that we wish to retain when formatting alpha numbers. This + // includes digits, ASCII letters and number grouping symbols such as "-" and " ". + private static final Map ALL_PLUS_NUMBER_GROUPING_SYMBOLS; + static { + // Simple ASCII digits map used to populate DIGIT_MAPPINGS and ALPHA_MAPPINGS. + HashMap asciiDigitMappings = new HashMap(); + asciiDigitMappings.put('0', '0'); + asciiDigitMappings.put('1', '1'); + asciiDigitMappings.put('2', '2'); + asciiDigitMappings.put('3', '3'); + asciiDigitMappings.put('4', '4'); + asciiDigitMappings.put('5', '5'); + asciiDigitMappings.put('6', '6'); + asciiDigitMappings.put('7', '7'); + asciiDigitMappings.put('8', '8'); + asciiDigitMappings.put('9', '9'); + HashMap digitMap = new HashMap(50); - digitMap.put('0', '0'); + digitMap.putAll(asciiDigitMappings); digitMap.put('\uFF10', '0'); // Fullwidth digit 0 digitMap.put('\u0660', '0'); // Arabic-indic digit 0 digitMap.put('\u06F0', '0'); // Eastern-Arabic digit 0 - digitMap.put('1', '1'); digitMap.put('\uFF11', '1'); // Fullwidth digit 1 digitMap.put('\u0661', '1'); // Arabic-indic digit 1 digitMap.put('\u06F1', '1'); // Eastern-Arabic digit 1 - digitMap.put('2', '2'); digitMap.put('\uFF12', '2'); // Fullwidth digit 2 digitMap.put('\u0662', '2'); // Arabic-indic digit 2 digitMap.put('\u06F2', '2'); // Eastern-Arabic digit 2 - digitMap.put('3', '3'); digitMap.put('\uFF13', '3'); // Fullwidth digit 3 digitMap.put('\u0663', '3'); // Arabic-indic digit 3 digitMap.put('\u06F3', '3'); // Eastern-Arabic digit 3 - digitMap.put('4', '4'); digitMap.put('\uFF14', '4'); // Fullwidth digit 4 digitMap.put('\u0664', '4'); // Arabic-indic digit 4 digitMap.put('\u06F4', '4'); // Eastern-Arabic digit 4 - digitMap.put('5', '5'); digitMap.put('\uFF15', '5'); // Fullwidth digit 5 digitMap.put('\u0665', '5'); // Arabic-indic digit 5 digitMap.put('\u06F5', '5'); // Eastern-Arabic digit 5 - digitMap.put('6', '6'); digitMap.put('\uFF16', '6'); // Fullwidth digit 6 digitMap.put('\u0666', '6'); // Arabic-indic digit 6 digitMap.put('\u06F6', '6'); // Eastern-Arabic digit 6 - digitMap.put('7', '7'); digitMap.put('\uFF17', '7'); // Fullwidth digit 7 digitMap.put('\u0667', '7'); // Arabic-indic digit 7 digitMap.put('\u06F7', '7'); // Eastern-Arabic digit 7 - digitMap.put('8', '8'); digitMap.put('\uFF18', '8'); // Fullwidth digit 8 digitMap.put('\u0668', '8'); // Arabic-indic digit 8 digitMap.put('\u06F8', '8'); // Eastern-Arabic digit 8 - digitMap.put('9', '9'); digitMap.put('\uFF19', '9'); // Fullwidth digit 9 digitMap.put('\u0669', '9'); // Arabic-indic digit 9 digitMap.put('\u06F9', '9'); // Eastern-Arabic digit 9 @@ -171,31 +184,38 @@ public class PhoneNumberUtil { combinedMap.putAll(alphaMap); combinedMap.putAll(digitMap); ALL_NORMALIZATION_MAPPINGS = Collections.unmodifiableMap(combinedMap); - } - // A list of all country codes where national significant numbers (excluding any national prefix) - // exist that start with a leading zero. - private static final Set LEADING_ZERO_COUNTRIES; - static { - HashSet aSet = new HashSet(10); - aSet.add(39); // Italy - aSet.add(47); // Norway - aSet.add(225); // Cote d'Ivoire - 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(378); // San Marino - aSet.add(379); // Vatican City - aSet.add(501); // Belize - LEADING_ZERO_COUNTRIES = Collections.unmodifiableSet(aSet); - } - - // Pattern that makes it easy to distinguish whether a country has a unique international dialing - // prefix or not. If a country has a unique international prefix (e.g. 011 in USA), it will be + HashMap allPlusNumberGroupings = new HashMap(); + // Put (lower letter -> upper letter) and (upper letter -> upper letter) mappings. + for (char c : ALPHA_MAPPINGS.keySet()) { + allPlusNumberGroupings.put(Character.toLowerCase(c), c); + allPlusNumberGroupings.put(c, c); + } + allPlusNumberGroupings.putAll(asciiDigitMappings); + // Put grouping symbols. + allPlusNumberGroupings.put('-', '-'); + allPlusNumberGroupings.put('\uFF0D', '-'); + allPlusNumberGroupings.put('\u2010', '-'); + allPlusNumberGroupings.put('\u2011', '-'); + allPlusNumberGroupings.put('\u2012', '-'); + allPlusNumberGroupings.put('\u2013', '-'); + allPlusNumberGroupings.put('\u2014', '-'); + allPlusNumberGroupings.put('\u2015', '-'); + allPlusNumberGroupings.put('\u2212', '-'); + allPlusNumberGroupings.put('/', '/'); + allPlusNumberGroupings.put('\uFF0F', '/'); + allPlusNumberGroupings.put(' ', ' '); + allPlusNumberGroupings.put('\u3000', ' '); + allPlusNumberGroupings.put('\u2060', ' '); + allPlusNumberGroupings.put('.', '.'); + allPlusNumberGroupings.put('\uFF0E', '.'); + ALL_PLUS_NUMBER_GROUPING_SYMBOLS = Collections.unmodifiableMap(allPlusNumberGroupings); + } + + // Pattern that makes it easy to distinguish whether a region has a unique international dialing + // prefix or not. If a region has a unique international prefix (e.g. 011 in USA), it will be // represented as a string that contains a sequence of ASCII digits. If there are multiple - // available international prefixes in a country, they will be represented as a regex string that + // available international prefixes in a region, they will be represented as a regex string that // always contains character(s) other than ASCII digits. // Note this regex also includes tilde, which signals waiting for the tone. private static final Pattern UNIQUE_INTERNATIONAL_PREFIX = @@ -218,6 +238,7 @@ public class PhoneNumberUtil { Arrays.toString(ALPHA_MAPPINGS.keySet().toArray()).toLowerCase().replaceAll("[, \\[\\]]", ""); static final String PLUS_CHARS = "+\uFF0B"; private static final Pattern PLUS_CHARS_PATTERN = Pattern.compile("[" + PLUS_CHARS + "]+"); + private static final Pattern SEPARATOR_PATTERN = Pattern.compile("[" + VALID_PUNCTUATION + "]+"); private static final Pattern CAPTURING_DIGIT_PATTERN = Pattern.compile("([" + VALID_DIGITS + "])"); @@ -264,27 +285,30 @@ public class PhoneNumberUtil { // Default extension prefix to use when formatting. This will be put in front of any extension // component of the number, after the main national number is formatted. For example, if you wish // the default extension formatting to be " extn: 3456", then you should specify " extn: " here - // as the default extension prefix. This can be overridden by country-specific preferences. + // as the default extension prefix. This can be overridden by region-specific preferences. private static final String DEFAULT_EXTN_PREFIX = " ext. "; // Regexp of all possible ways to write extensions, for use when parsing. This will be run as a - // case-insensitive regexp match. Wide character versions are also provided after each ascii - // version. There are two regular expressions here: the more generic one starts with optional - // white space and ends with an optional full stop (.), followed by zero or more spaces/tabs and - // then the numbers themselves. The other one covers the special case of American numbers where - // the extension is written with a hash at the end, such as "- 503#". + // case-insensitive regexp match. Wide character versions are also provided after each ASCII + // version. There are three regular expressions here. The first covers RFC 3966 format, where the + // extension is added using ";ext=". The second more generic one starts with optional white space + // and ends with an optional full stop (.), followed by zero or more spaces/tabs and then the + // numbers themselves. The other one covers the special case of American numbers where 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! // Canonical-equivalence doesn't seem to be an option with Android java, so we allow two options // for representing the accented o - the character itself, and one in the unicode decomposed form // with the combining acute accent. - static final String KNOWN_EXTN_PATTERNS = "[ \u00A0\\t,]*" + - "(?:ext(?:ensi(?:o\u0301?|\u00F3))?n?|" + + private static final String CAPTURING_EXTN_DIGITS = "([" + VALID_DIGITS + "]{1,7})"; + static final String KNOWN_EXTN_PATTERNS = + RFC3966_EXTN_PREFIX + CAPTURING_EXTN_DIGITS + "|" + + "[ \u00A0\\t,]*(?:ext(?:ensi(?:o\u0301?|\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})#"; + "[:\\.\uFF0E]?[ \u00A0\\t,-]*" + CAPTURING_EXTN_DIGITS + "#?|" + + "[- ]+([" + VALID_DIGITS + "]{1,5})#"; - // Regexp of all known extension prefixes used by different countries followed by 1 or more valid + // Regexp of all known extension prefixes used by different regions followed by 1 or more valid // digits, for use when parsing. private static final Pattern EXTN_PATTERN = Pattern.compile("(?:" + KNOWN_EXTN_PATTERNS + ")$", REGEX_FLAGS); @@ -303,10 +327,9 @@ public class PhoneNumberUtil { private static PhoneNumberUtil instance = null; // A mapping from a region code to the PhoneMetadata for that region. - private Map countryToMetadataMap = - new HashMap(); + private Map regionToMetadataMap = new HashMap(); - // A cache for frequently used country-specific regular expressions. + // A cache for frequently used region-specific regular expressions. // As most people use phone numbers primarily from one to two countries, and there are roughly 60 // regular expressions needed, the initial capacity of 100 offers a rough load factor of 0.75. private RegexCache regexCache = new RegexCache(100); @@ -316,14 +339,17 @@ public class PhoneNumberUtil { * E. 123. For example, the number of the Google Zurich office will be written as * "+41 44 668 1800" in INTERNATIONAL format, and as "044 668 1800" in NATIONAL format. * E164 format is as per INTERNATIONAL format but with no formatting applied, e.g. +41446681800. + * RFC3966 is as per INTERNATIONAL format, but with all spaces and other separating symbols + * replaced with a hyphen, and with any phone number extension appended with ";ext=". * * Note: If you are considering storing the number in a neutral format, you are highly advised to - * use the phonenumber.proto. + * use the PhoneNumber class. */ public enum PhoneNumberFormat { E164, INTERNATIONAL, - NATIONAL + NATIONAL, + RFC3966 } /** @@ -332,7 +358,7 @@ public class PhoneNumberUtil { public enum PhoneNumberType { FIXED_LINE, MOBILE, - // In some countries (e.g. the USA), it is impossible to distinguish between fixed-line and + // In some regions (e.g. the USA), it is impossible to distinguish between fixed-line and // mobile numbers by looking at the phone number itself. FIXED_LINE_OR_MOBILE, // Freephone lines @@ -353,7 +379,7 @@ public class PhoneNumberUtil { // specific offices, but allow one number to be used for a company. UAN, // A phone number is of type UNKNOWN when it does not fit any of the known patterns for a - // specific country. + // specific region. UNKNOWN } @@ -416,10 +442,10 @@ public class PhoneNumberUtil { private void init(String filePrefix) { currentFilePrefix = filePrefix; - for (List regionCodes : countryCodeToRegionCodeMap.values()) { - supportedCountries.addAll(regionCodes); + for (List regionCodes : countryCallingCodeToRegionCodeMap.values()) { + supportedRegions.addAll(regionCodes); } - nanpaCountries.addAll(countryCodeToRegionCodeMap.get(NANPA_COUNTRY_CODE)); + nanpaRegions.addAll(countryCallingCodeToRegionCodeMap.get(NANPA_COUNTRY_CODE)); } private void loadMetadataForRegionFromFile(String filePrefix, String regionCode) { @@ -431,7 +457,7 @@ public class PhoneNumberUtil { PhoneMetadataCollection metadataCollection = new PhoneMetadataCollection(); metadataCollection.readExternal(in); for (PhoneMetadata metadata : metadataCollection.getMetadataList()) { - countryToMetadataMap.put(regionCode, metadata); + regionToMetadataMap.put(regionCode, metadata); } } catch (IOException e) { LOGGER.log(Level.WARNING, e.toString()); @@ -461,6 +487,7 @@ public class PhoneNumberUtil { Matcher trailingCharsMatcher = UNWANTED_END_CHAR_PATTERN.matcher(number); if (trailingCharsMatcher.find()) { number = number.substring(0, trailingCharsMatcher.start()); + LOGGER.log(Level.FINER, "Stripped trailing characters: " + number); } // Check for extra numbers at the end. Matcher secondNumber = SECOND_NUMBER_START_PATTERN.matcher(number); @@ -547,15 +574,16 @@ public class PhoneNumberUtil { } /** - * Gets the length of the geographical area code from the national_number field of the PhoneNumber - * object passed in, so that clients could use it to split a national significant number into - * geographical area code and subscriber number. It works in such a way that the resultant - * subscriber number should be diallable, at least on some devices. An example of how this could - * be used: + * Gets the length of the geographical area code in the {@code nationalNumber_} field of the + * PhoneNumber object passed in, so that clients could use it to split a national significant + * number into geographical area code and subscriber number. It works in such a way that the + * resultant subscriber number should be diallable, at least on some devices. An example of how + * this could be used: * + *

    * PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
    * PhoneNumber number = phoneUtil.parse("16502530000", "US");
-   * String nationalSignificantNumber = PhoneNumberUtil.getNationalSignificantNumber(number);
+   * String nationalSignificantNumber = phoneUtil.getNationalSignificantNumber(number);
    * String areaCode;
    * String subscriberNumber;
    *
@@ -567,10 +595,10 @@ public class PhoneNumberUtil {
    *   areaCode = "";
    *   subscriberNumber = nationalSignificantNumber;
    * }
+   * 
* * N.B.: area code is a very ambiguous concept, so the I18N team generally recommends against - * using it for most purposes, but recommends using the more general national_number instead. Read - * the following carefully before deciding to use this method: + * using it for most purposes. Read the following carefully before deciding to use this method: * * - geographical area codes change over time, and this method honors those changes; therefore, * it doesn't guarantee the stability of the result it produces. @@ -607,12 +635,12 @@ public class PhoneNumberUtil { * 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: + * country calling 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 nationalSignificantNumber = phoneUtil.getNationalSignificantNumber(number); * String nationalDestinationCode; * String subscriberNumber; * @@ -625,9 +653,10 @@ public class PhoneNumberUtil { * nationalDestinationCode = ""; * subscriberNumber = nationalSignificantNumber; * } + * * * Refer to the unittests to see the difference between this function and - * getLengthOfGeographicalAreaCode(). + * {@link 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. @@ -648,8 +677,8 @@ public class PhoneNumberUtil { PhoneNumberUtil.PhoneNumberFormat.INTERNATIONAL); String[] numberGroups = NON_DIGITS_PATTERN.split(nationalSignificantNumber); // The pattern will start with "+COUNTRY_CODE " so the first group will always be the empty - // string (before the + symbol) and the second group will be the country code. The third group - // will be area code if it is not the last group. + // string (before the + symbol) and the second group will be the country calling code. The third + // group will be area code if it is not the last group. if (numberGroups.length <= 3) { return 0; } @@ -699,10 +728,10 @@ public class PhoneNumberUtil { static synchronized PhoneNumberUtil getInstance( String baseFileLocation, - Map> countryCodeToRegionCodeMap) { + Map> countryCallingCodeToRegionCodeMap) { if (instance == null) { instance = new PhoneNumberUtil(); - instance.countryCodeToRegionCodeMap = countryCodeToRegionCodeMap; + instance.countryCallingCodeToRegionCodeMap = countryCallingCodeToRegionCodeMap; instance.init(baseFileLocation); } return instance; @@ -716,20 +745,19 @@ public class PhoneNumberUtil { } /** - * Convenience method to enable tests to get a list of what countries the library has metadata - * for. + * Convenience method to enable tests to get a list of what regions the library has metadata for. */ - public Set getSupportedCountries() { - return supportedCountries; + public Set getSupportedRegions() { + return supportedRegions; } /** - * Gets a PhoneNumberUtil instance to carry out international phone number formatting, parsing, - * or validation. The instance is loaded with phone number metadata for a number of most commonly - * used countries/regions. + * Gets a {@link PhoneNumberUtil} instance to carry out international phone number formatting, + * parsing, or validation. The instance is loaded with phone number metadata for a number of most + * commonly used regions. * - * The PhoneNumberUtil is implemented as a singleton. Therefore, calling getInstance multiple - * times will only result in one instance being created. + *

The {@link PhoneNumberUtil} is implemented as a singleton. Therefore, calling getInstance + * multiple times will only result in one instance being created. * * @return a PhoneNumberUtil instance */ @@ -745,7 +773,23 @@ public class PhoneNumberUtil { * Helper function to check region code is not unknown or null. */ private boolean isValidRegionCode(String regionCode) { - return regionCode != null && supportedCountries.contains(regionCode.toUpperCase()); + return regionCode != null && supportedRegions.contains(regionCode.toUpperCase()); + } + + /** + * Helper function to check region code is not unknown or null and log an error message. The + * {@code countryCallingCode} and {@code number} supplied is used only for the resultant log + * message. + */ + private boolean hasValidRegionCode(String regionCode, + int countryCallingCode, String number) { + if (!isValidRegionCode(regionCode)) { + LOGGER.log(Level.WARNING, + "Number " + number + " has invalid or missing country calling code (" + + countryCallingCode + ")"); + return false; + } + return true; } /** @@ -754,8 +798,9 @@ public class PhoneNumberUtil { * format in either 'national' or 'international' format depending on what the client asks for, we * do not currently support a more abbreviated format, such as for users in the same "area" who * could potentially dial the number without area code. Note that if the phone number has a - * country code of 0 or an otherwise invalid country code, we cannot work out which formatting - * rules to apply so we return the national significant number with no formatting applied. + * country calling code of 0 or an otherwise invalid country calling code, we cannot work out + * which formatting rules to apply so we return the national significant number with no formatting + * applied. * * @param number the phone number to be formatted * @param numberFormat the format the phone number should be formatted into @@ -782,9 +827,9 @@ public class PhoneNumberUtil { formatNumberByFormat(countryCode, PhoneNumberFormat.E164, formattedNumber); return; } - // Note getRegionCodeForCountryCode() is used because formatting information for countries which - // share a country code is contained by only one country for performance reasons. For example, - // for NANPA countries it will be contained in the metadata for US. + // Note getRegionCodeForCountryCode() is used because formatting information for regions which + // share a country calling code is contained by only one region for performance reasons. For + // example, for NANPA regions it will be contained in the metadata for US. String regionCode = getRegionCodeForCountryCode(countryCode); if (!isValidRegionCode(regionCode)) { formattedNumber.append(nationalSignificantNumber); @@ -793,15 +838,15 @@ public class PhoneNumberUtil { formattedNumber.append(formatNationalNumber(nationalSignificantNumber, regionCode, numberFormat)); - maybeGetFormattedExtension(number, regionCode, formattedNumber); + maybeGetFormattedExtension(number, regionCode, numberFormat, formattedNumber); formatNumberByFormat(countryCode, numberFormat, formattedNumber); } /** * Formats a phone number in the specified format using client-defined formatting rules. Note that - * if the phone number has a country code of zero or an otherwise invalid country code, we cannot - * work out things like whether there should be a national prefix applied, or how to format - * extensions, so we return the national significant number with no formatting applied. + * if the phone number has a country calling code of zero or an otherwise invalid country calling + * code, we cannot work out things like whether there should be a national prefix applied, or how + * to format extensions, so we return the national significant number with no formatting applied. * * @param number the phone number to be formatted * @param numberFormat the format the phone number should be formatted into @@ -811,13 +856,13 @@ public class PhoneNumberUtil { public String formatByPattern(PhoneNumber number, PhoneNumberFormat numberFormat, List userDefinedFormats) { - int countryCode = number.getCountryCode(); + int countryCallingCode = number.getCountryCode(); String nationalSignificantNumber = getNationalSignificantNumber(number); - // Note getRegionCodeForCountryCode() is used because formatting information for countries which - // share a country code is contained by only one country for performance reasons. For example, - // for NANPA countries it will be contained in the metadata for US. - String regionCode = getRegionCodeForCountryCode(countryCode); - if (!isValidRegionCode(regionCode)) { + // Note getRegionCodeForCountryCode() is used because formatting information for regions which + // share a country calling code is contained by only one region for performance reasons. For + // example, for NANPA regions it will be contained in the metadata for US. + String regionCode = getRegionCodeForCountryCode(countryCallingCode); + if (!hasValidRegionCode(regionCode, countryCallingCode, nationalSignificantNumber)) { return nationalSignificantNumber; } List userDefinedFormatsCopy = @@ -853,30 +898,30 @@ public class PhoneNumberUtil { new StringBuffer(formatAccordingToFormats(nationalSignificantNumber, userDefinedFormatsCopy, numberFormat)); - maybeGetFormattedExtension(number, regionCode, formattedNumber); - formatNumberByFormat(countryCode, numberFormat, formattedNumber); + maybeGetFormattedExtension(number, regionCode, numberFormat, formattedNumber); + formatNumberByFormat(countryCallingCode, numberFormat, formattedNumber); return formattedNumber.toString(); } /** * Formats a phone number in national format for dialing using the carrier as specified in the - * carrierCode. The carrierCode will always be used regardless of whether the phone number already - * has a preferred domestic carrier code stored. If carrierCode contains an empty string, return - * the number in national format without any carrier code. + * {@code carrierCode}. The {@code carrierCode} will always be used regardless of whether the + * phone number already has a preferred domestic carrier code stored. If {@code carrierCode} + * contains an empty string, returns the number in national format without any carrier code. * * @param number the phone number to be formatted * @param carrierCode the carrier selection code to be used * @return the formatted phone number in national format for dialing using the carrier as - * specified in the carrierCode + * specified in the {@code carrierCode} */ public String formatNationalNumberWithCarrierCode(PhoneNumber number, String carrierCode) { - int countryCode = number.getCountryCode(); + int countryCallingCode = number.getCountryCode(); String nationalSignificantNumber = getNationalSignificantNumber(number); - // Note getRegionCodeForCountryCode() is used because formatting information for countries which - // share a country code is contained by only one country for performance reasons. For example, - // for NANPA countries it will be contained in the metadata for US. - String regionCode = getRegionCodeForCountryCode(countryCode); - if (!isValidRegionCode(regionCode)) { + // Note getRegionCodeForCountryCode() is used because formatting information for regions which + // share a country calling code is contained by only one region for performance reasons. For + // example, for NANPA regions it will be contained in the metadata for US. + String regionCode = getRegionCodeForCountryCode(countryCallingCode); + if (!hasValidRegionCode(regionCode, countryCallingCode, nationalSignificantNumber)) { return nationalSignificantNumber; } @@ -885,26 +930,27 @@ public class PhoneNumberUtil { regionCode, PhoneNumberFormat.NATIONAL, carrierCode)); - maybeGetFormattedExtension(number, regionCode, formattedNumber); - formatNumberByFormat(countryCode, PhoneNumberFormat.NATIONAL, formattedNumber); + maybeGetFormattedExtension(number, regionCode, PhoneNumberFormat.NATIONAL, formattedNumber); + formatNumberByFormat(countryCallingCode, PhoneNumberFormat.NATIONAL, formattedNumber); return formattedNumber.toString(); } /** * Formats a phone number in national format for dialing using the carrier as specified in the - * preferred_domestic_carrier_code field of the PhoneNumber object passed in. If that is missing, - * use the fallbackCarrierCode passed in instead. If there is no preferred_domestic_carrier_code, - * and the fallbackCarrierCode contains an empty string, return the number in national format - * without any carrier code. + * preferredDomesticCarrierCode field of the PhoneNumber object passed in. If that is missing, + * use the {@code fallbackCarrierCode} passed in instead. If there is no + * {@code preferredDomesticCarrierCode}, and the {@code fallbackCarrierCode} contains an empty + * string, return the number in national format without any carrier code. * - * Use formatNationalNumberWithCarrierCode instead if the carrier code passed in should take - * precedence over the number's preferred_domestic_carrier_code when formatting. + *

Use {@link #formatNationalNumberWithCarrierCode} instead if the carrier code passed in + * should take precedence over the number's {@code preferredDomesticCarrierCode} when formatting. * * @param number the phone number to be formatted * @param fallbackCarrierCode the carrier selection code to be used, if none is found in the - * phone number itself + * phone number itself * @return the formatted phone number in national format for dialing using the number's - * preferred_domestic_carrier_code, or the fallbackCarrierCode passed in if none is found + * {@code preferredDomesticCarrierCode}, or the {@code fallbackCarrierCode} passed in if + * none is found */ public String formatNationalNumberWithPreferredCarrierCode(PhoneNumber number, String fallbackCarrierCode) { @@ -914,56 +960,55 @@ public class PhoneNumberUtil { } /** - * Formats a phone number for out-of-country dialing purpose. If no countryCallingFrom - * is supplied, we format the number in its INTERNATIONAL format. If the countryCallingFrom is - * the same as the country where the number is from, then NATIONAL formatting will be applied. + * Formats a phone number for out-of-country dialing purposes. If no countryCallingFrom is + * supplied, we format the number in its INTERNATIONAL format. If the country calling code is the + * same as the region where the number is from, then NATIONAL formatting will be applied. * - * If the number itself has a country code of zero or an otherwise invalid country code, then we - * return the number with no formatting applied. + *

If the number itself has a country calling code of zero or an otherwise invalid country + * calling code, then we return the number with no formatting applied. * - * Note this function takes care of the case for calling inside of NANPA and between Russia and - * Kazakhstan (who share the same country code). In those cases, no international prefix is used. - * For countries which have multiple international prefixes, the number in its INTERNATIONAL - * format will be returned instead. + *

Note this function takes care of the case for calling inside of NANPA and between Russia and + * Kazakhstan (who share the same country calling code). In those cases, no international prefix + * is used. For regions which have multiple international prefixes, the number in its + * INTERNATIONAL format will be returned instead. * * @param number the phone number to be formatted - * @param countryCallingFrom the ISO 3166-1 two-letter country code that denotes - * the foreign country where the call is being placed + * @param regionCallingFrom the ISO 3166-1 two-letter region code that denotes the region + * where the call is being placed * @return the formatted phone number */ - public String formatOutOfCountryCallingNumber(PhoneNumber number, - String countryCallingFrom) { - if (!isValidRegionCode(countryCallingFrom)) { + public String formatOutOfCountryCallingNumber(PhoneNumber number, String regionCallingFrom) { + if (!isValidRegionCode(regionCallingFrom)) { return format(number, PhoneNumberFormat.INTERNATIONAL); } - int countryCode = number.getCountryCode(); - String regionCode = getRegionCodeForCountryCode(countryCode); + int countryCallingCode = number.getCountryCode(); + String regionCode = getRegionCodeForCountryCode(countryCallingCode); String nationalSignificantNumber = getNationalSignificantNumber(number); if (!isValidRegionCode(regionCode)) { return nationalSignificantNumber; } - if (countryCode == NANPA_COUNTRY_CODE) { - if (isNANPACountry(countryCallingFrom)) { - // For NANPA countries, return the national format for these countries but prefix it with - // the country code. - return countryCode + " " + format(number, PhoneNumberFormat.NATIONAL); + if (countryCallingCode == NANPA_COUNTRY_CODE) { + if (isNANPACountry(regionCallingFrom)) { + // For NANPA regions, return the national format for these regions but prefix it with the + // country calling code. + return countryCallingCode + " " + format(number, PhoneNumberFormat.NATIONAL); } - } else if (countryCode == getCountryCodeForRegion(countryCallingFrom)) { - // For countries that share a country calling code, the country code need not be dialled. This - // also applies when dialling within a country, so this if clause covers both these cases. - // Technically this is the case for dialling from la Reunion to other overseas departments of + } else if (countryCallingCode == getCountryCodeForRegion(regionCallingFrom)) { + // For regions that 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 code. + // 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); } String formattedNationalNumber = formatNationalNumber(nationalSignificantNumber, regionCode, PhoneNumberFormat.INTERNATIONAL); - PhoneMetadata metadata = getMetadataForRegion(countryCallingFrom); + PhoneMetadata metadata = getMetadataForRegion(regionCallingFrom); String internationalPrefix = metadata.getInternationalPrefix(); - // For countries that have multiple international prefixes, the international format of the + // For regions that have multiple international prefixes, the international format of the // number is returned, unless there is a preferred international prefix. String internationalPrefixForFormatting = ""; if (UNIQUE_INTERNATIONAL_PREFIX.matcher(internationalPrefix).matches()) { @@ -973,12 +1018,13 @@ public class PhoneNumberUtil { } StringBuffer formattedNumber = new StringBuffer(formattedNationalNumber); - maybeGetFormattedExtension(number, regionCode, formattedNumber); + maybeGetFormattedExtension(number, regionCode, PhoneNumberFormat.INTERNATIONAL, + formattedNumber); if (internationalPrefixForFormatting.length() > 0) { - formattedNumber.insert(0, " ").insert(0, countryCode).insert(0, " ") + formattedNumber.insert(0, " ").insert(0, countryCallingCode).insert(0, " ") .insert(0, internationalPrefixForFormatting); } else { - formatNumberByFormat(countryCode, + formatNumberByFormat(countryCallingCode, PhoneNumberFormat.INTERNATIONAL, formattedNumber); } @@ -991,12 +1037,12 @@ public class PhoneNumberUtil { * passed in. If such information is missing, the number will be formatted into the NATIONAL * format by default. * - * @param number the PhoneNumber that needs to be formatted in its original number format - * @param countryCallingFrom the country whose IDD needs to be prefixed if the original number + * @param number the phone number that needs to be formatted in its original number format + * @param regionCallingFrom the region whose IDD needs to be prefixed if the original number * has one * @return the formatted phone number in its original number format */ - public String formatInOriginalFormat(PhoneNumber number, String countryCallingFrom) { + public String formatInOriginalFormat(PhoneNumber number, String regionCallingFrom) { if (!number.hasCountryCodeSource()) { return format(number, PhoneNumberFormat.NATIONAL); } @@ -1004,7 +1050,7 @@ public class PhoneNumberUtil { case FROM_NUMBER_WITH_PLUS_SIGN: return format(number, PhoneNumberFormat.INTERNATIONAL); case FROM_NUMBER_WITH_IDD: - return formatOutOfCountryCallingNumber(number, countryCallingFrom); + return formatOutOfCountryCallingNumber(number, regionCallingFrom); case FROM_NUMBER_WITHOUT_PLUS_SIGN: return format(number, PhoneNumberFormat.INTERNATIONAL).substring(1); case FROM_DEFAULT_COUNTRY: @@ -1013,6 +1059,105 @@ public class PhoneNumberUtil { } } + /** + * Formats a phone number for out-of-country dialing purposes. + * + * Note that in this version, if the number was entered originally using alpha characters and + * this version of the number is stored in raw_input, this representation of the number will be + * used rather than the digit representation. Grouping information, as specified by characters + * such as "-" and " ", will be retained. + * + *

Caveats:

+ *
    + *
  • This will not produce good results if the country calling code is both present in the raw + * input _and_ is the start of the national number. This is not a problem in the regions + * which typically use alpha numbers. + *
  • This will also not produce good results if the raw input has any grouping information + * within the first three digits of the national number, and if the function needs to strip + * preceding digits/words in the raw input before these digits. Normally people group the + * first three digits together so this is not a huge problem - and will be fixed if it + * proves to be so. + *
+ * + * @param number the phone number that needs to be formatted + * @param regionCallingFrom the region where the call is being placed + * @return the formatted phone number + */ + public String formatOutOfCountryKeepingAlphaChars(PhoneNumber number, String regionCallingFrom) { + String rawInput = number.getRawInput(); + // If there is no raw input, then we can't keep alpha characters because there aren't any. + // In this case, we return formatOutOfCountryCallingNumber. + if (rawInput.length() == 0) { + return formatOutOfCountryCallingNumber(number, regionCallingFrom); + } + int countryCode = number.getCountryCode(); + String regionCode = getRegionCodeForCountryCode(countryCode); + if (!hasValidRegionCode(regionCode, countryCode, rawInput)) { + return rawInput; + } + // Strip any prefix such as country calling code, IDD, that was present. We do this by comparing + // the number in raw_input with the parsed number. + // To do this, first we normalize punctuation. We retain number grouping symbols such as " " + // only. + rawInput = normalizeHelper(rawInput, ALL_PLUS_NUMBER_GROUPING_SYMBOLS, true); + // Now we trim everything before the first three digits in the parsed number. We choose three + // because all valid alpha numbers have 3 digits at the start - if it does not, then we don't + // trim anything at all. Similarly, if the national number was less than three digits, we don't + // trim anything at all. + String nationalNumber = getNationalSignificantNumber(number); + if (nationalNumber.length() > 3) { + int firstNationalNumberDigit = rawInput.indexOf(nationalNumber.substring(0, 3)); + if (firstNationalNumberDigit != -1) { + rawInput = rawInput.substring(firstNationalNumberDigit); + } + } + PhoneMetadata metadata = getMetadataForRegion(regionCallingFrom); + if (countryCode == NANPA_COUNTRY_CODE) { + if (isNANPACountry(regionCallingFrom)) { + return countryCode + " " + rawInput; + } + } else if (countryCode == getCountryCodeForRegion(regionCallingFrom)) { + // Here we copy the formatting rules so we can modify the pattern we expect to match against. + List availableFormats = + new ArrayList(metadata.numberFormatSize()); + for (NumberFormat format : metadata.numberFormats()) { + NumberFormat newFormat = new NumberFormat(); + newFormat.mergeFrom(format); + // The first group is the first group of digits that the user determined. + newFormat.setPattern("(\\d+)(.*)"); + // Here we just concatenate them back together after the national prefix has been fixed. + newFormat.setFormat("$1$2"); + availableFormats.add(newFormat); + } + // Now we format using these patterns instead of the default pattern, but with the national + // prefix prefixed if necessary, by choosing the format rule based on the leading digits + // present in the unformatted national number. + // This will not work in the cases where the pattern (and not the leading digits) decide + // whether a national prefix needs to be used, since we have overridden the pattern to match + // anything, but that is not the case in the metadata to date. + return formatAccordingToFormats(rawInput, availableFormats, PhoneNumberFormat.NATIONAL); + } + String internationalPrefix = metadata.getInternationalPrefix(); + // For countries that have multiple international prefixes, the international format of the + // number is returned, unless there is a preferred international prefix. + String internationalPrefixForFormatting = + UNIQUE_INTERNATIONAL_PREFIX.matcher(internationalPrefix).matches() + ? internationalPrefix + : metadata.getPreferredInternationalPrefix(); + StringBuffer formattedNumber = new StringBuffer(rawInput); + maybeGetFormattedExtension(number, regionCode, PhoneNumberFormat.INTERNATIONAL, + formattedNumber); + if (internationalPrefixForFormatting.length() > 0) { + formattedNumber.insert(0, " ").insert(0, countryCode).insert(0, " ") + .insert(0, internationalPrefixForFormatting); + } else { + formatNumberByFormat(countryCode, + PhoneNumberFormat.INTERNATIONAL, + formattedNumber); + } + return formattedNumber.toString(); + } + /** * Gets the national significant number of the a phone number. Note a national significant number * doesn't contain a national prefix or any formatting. @@ -1020,17 +1165,17 @@ public class PhoneNumberUtil { * @param number the PhoneNumber object for which the national significant number is needed * @return the national significant number of the PhoneNumber object passed in */ - public static String getNationalSignificantNumber(PhoneNumber number) { + public String getNationalSignificantNumber(PhoneNumber number) { // The leading zero in the national (significant) number of an Italian phone number has a // special meaning. Unlike the rest of the world, it indicates the number is a landline // number. There have been plans to migrate landline numbers to start with the digit two since // December 2000, but it has not yet happened. // See http://en.wikipedia.org/wiki/%2B39 for more details. - // Other countries such as Cote d'Ivoire and Gabon use this for their mobile numbers. + // Other regions such as Cote d'Ivoire and Gabon use this for their mobile numbers. StringBuffer nationalNumber = new StringBuffer( (number.hasItalianLeadingZero() && number.getItalianLeadingZero() && - isLeadingZeroCountry(number.getCountryCode())) + isLeadingZeroPossible(number.getCountryCode())) ? "0" : "" ); nationalNumber.append(number.getNationalNumber()); @@ -1040,15 +1185,18 @@ public class PhoneNumberUtil { /** * A helper function that is used by format and formatByPattern. */ - private void formatNumberByFormat(int countryCode, + private void formatNumberByFormat(int countryCallingCode, PhoneNumberFormat numberFormat, StringBuffer formattedNumber) { switch (numberFormat) { case E164: - formattedNumber.insert(0, countryCode).insert(0, PLUS_SIGN); + formattedNumber.insert(0, countryCallingCode).insert(0, PLUS_SIGN); return; case INTERNATIONAL: - formattedNumber.insert(0, " ").insert(0, countryCode).insert(0, PLUS_SIGN); + formattedNumber.insert(0, " ").insert(0, countryCallingCode).insert(0, PLUS_SIGN); + return; + case RFC3966: + formattedNumber.insert(0, "-").insert(0, countryCallingCode) .insert(0, PLUS_SIGN); return; case NATIONAL: default: @@ -1063,7 +1211,7 @@ public class PhoneNumberUtil { return formatNationalNumber(number, regionCode, numberFormat, null); } - // Note in some countries, the national number can be written in two completely different ways + // Note in some regions, the national number can be written in two completely different ways // depending on whether it forms part of the NATIONAL format or INTERNATIONAL format. The // numberFormat parameter here is used to specify which format to use for those cases. If a // carrierCode is specified, this will be inserted into the formatted string to replace $CC. @@ -1072,14 +1220,20 @@ public class PhoneNumberUtil { PhoneNumberFormat numberFormat, String carrierCode) { PhoneMetadata metadata = getMetadataForRegion(regionCode); - List intlNumberFormats = metadata.getIntlNumberFormatList(); + List intlNumberFormats = metadata.intlNumberFormats(); // When the intlNumberFormats exists, we use that to format national number for the // INTERNATIONAL format instead of using the numberDesc.numberFormats. List availableFormats = (intlNumberFormats.size() == 0 || numberFormat == PhoneNumberFormat.NATIONAL) - ? metadata.getNumberFormatList() - : metadata.getIntlNumberFormatList(); - return formatAccordingToFormats(number, availableFormats, numberFormat, carrierCode); + ? metadata.numberFormats() + : metadata.intlNumberFormats(); + String formattedNationalNumber = + formatAccordingToFormats(number, availableFormats, numberFormat, carrierCode); + if (numberFormat == PhoneNumberFormat.RFC3966) { + formattedNationalNumber = + SEPARATOR_PATTERN.matcher(formattedNationalNumber).replaceAll("-"); + } + return formattedNationalNumber; } // Simple wrapper of formatAccordingToFormats for the common case of no carrier code. @@ -1096,7 +1250,7 @@ public class PhoneNumberUtil { PhoneNumberFormat numberFormat, String carrierCode) { for (NumberFormat numFormat : availableFormats) { - int size = numFormat.getLeadingDigitsPatternCount(); + int size = numFormat.leadingDigitsPatternSize(); if (size == 0 || regexCache.getPatternForRegex( // We always use the last leading_digits_pattern, as it is the most detailed. numFormat.getLeadingDigitsPattern(size - 1)).matcher(nationalNumber).lookingAt()) { @@ -1136,11 +1290,11 @@ public class PhoneNumberUtil { } /** - * Gets a valid number for the specified country. + * Gets a valid number for the specified region. * - * @param regionCode the ISO 3166-1 two-letter country code that denotes - * the country for which an example number is needed - * @return a valid fixed-line number for the specified country. Returns null when the metadata + * @param regionCode the ISO 3166-1 two-letter region code that denotes + * the region for which an example number is needed + * @return a valid fixed-line number for the specified region. Returns null when the metadata * does not contain such information. */ public PhoneNumber getExampleNumber(String regionCode) { @@ -1148,12 +1302,12 @@ public class PhoneNumberUtil { } /** - * Gets a valid number for the specified country and number type. + * Gets a valid number for the specified region and number type. * - * @param regionCode the ISO 3166-1 two-letter country code that denotes - * the country for which an example number is needed + * @param regionCode the ISO 3166-1 two-letter region code that denotes + * the region for which an example number is needed * @param type the type of number that is needed - * @return a valid number for the specified country and type. Returns null when the metadata + * @return a valid number for the specified region and type. Returns null when the metadata * does not contain such information. */ public PhoneNumber getExampleNumberForType(String regionCode, PhoneNumberType type) { @@ -1173,18 +1327,28 @@ public class PhoneNumberUtil { * an extension specified. */ private void maybeGetFormattedExtension(PhoneNumber number, String regionCode, + PhoneNumberFormat numberFormat, StringBuffer formattedNumber) { - if (number.hasExtension()) { - // Formats the extension part of the phone number by prefixing it with the appropriate - // extension prefix. This will be the default extension prefix, unless overridden by a - // preferred extension prefix for this country. - PhoneMetadata metadata = getMetadataForRegion(regionCode); - if (metadata.hasPreferredExtnPrefix()) { - formattedNumber.append(metadata.getPreferredExtnPrefix()); + if (number.hasExtension() && number.getExtension().length() > 0) { + if (numberFormat == PhoneNumberFormat.RFC3966) { + formattedNumber.append(RFC3966_EXTN_PREFIX).append(number.getExtension()); } else { - formattedNumber.append(DEFAULT_EXTN_PREFIX); + formatExtension(number.getExtension(), regionCode, formattedNumber); } - formattedNumber.append(number.getExtension()); + } + } + + /** + * Formats the extension part of the phone number by prefixing it with the appropriate extension + * prefix. This will be the default extension prefix, unless overridden by a preferred + * extension prefix for this region. + */ + private void formatExtension(String extensionDigits, String regionCode, StringBuffer extension) { + PhoneMetadata metadata = getMetadataForRegion(regionCode); + if (metadata.hasPreferredExtnPrefix()) { + extension.append(metadata.getPreferredExtnPrefix()).append(extensionDigits); + } else { + extension.append(DEFAULT_EXTN_PREFIX).append(extensionDigits); } } @@ -1281,10 +1445,10 @@ public class PhoneNumberUtil { return null; } regionCode = regionCode.toUpperCase(); - if (!countryToMetadataMap.containsKey(regionCode)) { + if (!regionToMetadataMap.containsKey(regionCode)) { loadMetadataForRegionFromFile(currentFilePrefix, regionCode); } - return countryToMetadataMap.get(regionCode); + return regionToMetadataMap.get(regionCode); } private boolean isNumberMatchingDesc(String nationalNumber, PhoneNumberDesc numberDesc) { @@ -1312,14 +1476,14 @@ public class PhoneNumberUtil { /** * Tests whether a phone number is valid for a certain region. Note this doesn't verify the number * is actually in use, which is impossible to tell by just looking at a number itself. If the - * country code is not the same as the country code for the region, this immediately exits with - * false. After this, the specific number pattern rules for the region are examined. This is - * useful for determining for example whether a particular number is valid for Canada, rather than - * just a valid NANPA number. + * country calling code is not the same as the country calling code for the region, this + * immediately exits with false. After this, the specific number pattern rules for the region are + * examined. This is useful for determining for example whether a particular number is valid for + * Canada, rather than just a valid NANPA number. * * @param number the phone number that we want to validate - * @param regionCode the ISO 3166-1 two-letter country code that denotes - * the region/country that we want to validate the phone number for + * @param regionCode the ISO 3166-1 two-letter region code that denotes the region that we want + * to validate the phone number for * @return a boolean that indicates whether the number is of a valid pattern */ public boolean isValidNumberForRegion(PhoneNumber number, String regionCode) { @@ -1330,8 +1494,8 @@ public class PhoneNumberUtil { PhoneNumberDesc generalNumDesc = metadata.getGeneralDesc(); String nationalSignificantNumber = getNationalSignificantNumber(number); - // For countries where we don't have metadata for PhoneNumberDesc, we treat any number passed - // in as a valid number if its national significant number is between the minimum and maximum + // For regions where we don't have metadata for PhoneNumberDesc, we treat any number passed in + // as a valid number if its national significant number is between the minimum and maximum // lengths defined by ITU for a national significant number. if (!generalNumDesc.hasNationalNumberPattern()) { int numberLength = nationalSignificantNumber.length(); @@ -1341,16 +1505,16 @@ public class PhoneNumberUtil { } /** - * Returns the country/region where a phone number is from. This could be used for geo-coding in - * the country/region level. + * Returns the region where a phone number is from. This could be used for geocoding at the region + * level. * * @param number the phone number whose origin we want to know - * @return the country/region where the phone number is from, or null if no country matches this - * calling code. + * @return the region where the phone number is from, or null if no region matches this calling + * code */ public String getRegionCodeForNumber(PhoneNumber number) { int countryCode = number.getCountryCode(); - List regions = countryCodeToRegionCodeMap.get(countryCode); + List regions = countryCallingCodeToRegionCodeMap.get(countryCode); if (regions == null) { return null; } @@ -1380,12 +1544,12 @@ public class PhoneNumberUtil { } /** - * Returns the region code that matches the specific country code. In the case of no region code - * being found, ZZ will be returned. In the case of multiple regions, the one designated in the - * metadata as the "main" country for this calling code will be returned. + * Returns the region code that matches the specific country calling code. In the case of no + * region code being found, ZZ will be returned. In the case of multiple regions, the one + * designated in the metadata as the "main" region for this calling code will be returned. */ - public String getRegionCodeForCountryCode(int countryCode) { - List regionCodes = countryCodeToRegionCodeMap.get(countryCode); + public String getRegionCodeForCountryCode(int countryCallingCode) { + List regionCodes = countryCallingCodeToRegionCodeMap.get(countryCallingCode); return regionCodes == null ? UNKNOWN_REGION : regionCodes.get(0); } @@ -1393,9 +1557,9 @@ public class PhoneNumberUtil { * Returns the country calling code for a specific region. For example, this would be 1 for the * United States, and 64 for New Zealand. * - * @param regionCode the ISO 3166-1 two-letter country code that denotes - * the country/region that we want to get the country code for - * @return the country calling code for the country/region denoted by regionCode + * @param regionCode the ISO 3166-1 two-letter region code that denotes + * the region that we want to get the country calling code for + * @return the country calling code for the region denoted by regionCode */ public int getCountryCodeForRegion(String regionCode) { if (!isValidRegionCode(regionCode)) { @@ -1414,23 +1578,23 @@ public class PhoneNumberUtil { * (which indicates a wait for a dialling tone) from the prefix returned. If no national prefix is * present, we return null. * - * Warning: Do not use this method for do-your-own formatting - for some countries, the national - * dialling prefix is used only for certain types of numbers. Use the library's formatting - * functions to prefix the national prefix when required. + *

Warning: Do not use this method for do-your-own formatting - for some regions, the + * national dialling prefix is used only for certain types of numbers. Use the library's + * formatting functions to prefix the national prefix when required. * - * @param regionCode the ISO 3166-1 two-letter country code that denotes - * the country/region that we want to get the dialling prefix for + * @param regionCode the ISO 3166-1 two-letter region code that denotes + * the region that we want to get the dialling prefix for * @param stripNonDigits true to strip non-digits from the national dialling prefix - * @return the dialling prefix for the country/region denoted by regionCode + * @return the dialling prefix for the region denoted by regionCode */ public String getNddPrefixForRegion(String regionCode, boolean stripNonDigits) { if (!isValidRegionCode(regionCode)) { - LOGGER.log(Level.SEVERE, "Invalid or missing country code provided."); + LOGGER.log(Level.SEVERE, "Invalid or missing region code provided."); return null; } PhoneMetadata metadata = getMetadataForRegion(regionCode); if (metadata == null) { - LOGGER.log(Level.SEVERE, "Unsupported country code provided."); + LOGGER.log(Level.SEVERE, "Unsupported region code provided."); return null; } String nationalPrefix = metadata.getNationalPrefix(); @@ -1447,26 +1611,51 @@ public class PhoneNumberUtil { } /** - * Check if a country is one of the countries under the North American Numbering Plan - * Administration (NANPA). + * Checks if this is a region under the North American Numbering Plan Administration (NANPA). * - * @return true if regionCode is one of the countries under NANPA + * @return true if regionCode is one of the regions under NANPA */ public boolean isNANPACountry(String regionCode) { - return regionCode != null && nanpaCountries.contains(regionCode.toUpperCase()); + return regionCode != null && nanpaRegions.contains(regionCode.toUpperCase()); } /** - * Check whether countryCode represents the country calling code from a country whose national - * significant number could contain a leading zero. An example of such a country is Italy. + * Checks whether countryCode represents the country calling code from a region whose national + * significant number could contain a leading zero. An example of such a region is Italy. Returns + * false if no metadata for the country is found. + */ + boolean isLeadingZeroPossible(int countryCallingCode) { + PhoneMetadata mainMetadataForCallingCode = getMetadataForRegion( + getRegionCodeForCountryCode(countryCallingCode)); + if (mainMetadataForCallingCode == null) { + return false; + } + return mainMetadataForCallingCode.isLeadingZeroPossible(); + } + + /** + * Checks if the number is a valid vanity (alpha) number such as 800 MICROSOFT. A valid vanity + * number will start with at least 3 digits and will have three or more alpha characters. This + * does not do region-specific checks - to work out if this number is actually valid for a region, + * it should be parsed and methods such as {@link #isPossibleNumberWithReason} and + * {@link #isValidNumber} should be used. + * + * @param number the number that needs to be checked + * @return true if the number is a valid vanity number */ - public static boolean isLeadingZeroCountry(int countryCode) { - return LEADING_ZERO_COUNTRIES.contains(countryCode); + public boolean isAlphaNumber(String number) { + if (!isViablePhoneNumber(number)) { + // Number is too short, or doesn't match the basic phone number pattern. + return false; + } + StringBuffer strippedNumber = new StringBuffer(number); + maybeStripExtension(strippedNumber); + return VALID_ALPHA_PHONE_PATTERN.matcher(strippedNumber).matches(); } /** - * Convenience wrapper around isPossibleNumberWithReason. Instead of returning the reason for - * failure, this method returns a boolean value. + * Convenience wrapper around {@link #isPossibleNumberWithReason}. Instead of returning the reason + * for failure, this method returns a boolean value. * @param number the number that needs to be checked * @return true if the number is possible */ @@ -1476,13 +1665,14 @@ public class PhoneNumberUtil { /** * Check whether a phone number is a possible number. It provides a more lenient check than - * isValidNumber in the following sense: - * 1. It only checks the length of phone numbers. In particular, it doesn't check starting + * {@link #isValidNumber} in the following sense: + *

    + *
  1. It only checks the length of phone numbers. In particular, it doesn't check starting * digits of the number. - * 2. It doesn't attempt to figure out the type of the number, but uses general rules which - * applies to all types of phone numbers in a country. Therefore, it is much faster than + *
  2. It doesn't attempt to figure out the type of the number, but uses general rules which + * applies to all types of phone numbers in a region. Therefore, it is much faster than * isValidNumber. - * 3. For fixed line numbers, many countries have the concept of area code, which together with + *
  3. For fixed line numbers, many regions have the concept of area code, which together with * subscriber number constitute the national significant number. It is sometimes okay to dial * the subscriber number only when dialing in the same area. This function will return * true if the subscriber-number-only version is passed in. On the other hand, because @@ -1490,21 +1680,21 @@ public class PhoneNumberUtil { * numbers, that would most likely be area codes) and length (obviously includes the * length of area codes for fixed line numbers), it will return false for the * subscriber-number-only version. - * + *
This method first parses the number, then invokes {@link #isPossibleNumber(PhoneNumber + * number)} with the resultant PhoneNumber object. * * @param number the number that needs to be checked, in the form of a string - * @param countryDialingFrom the ISO 3166-1 two-letter country code that denotes - * the country that we are expecting the number to be dialed from. - * Note this is different from the country where the number belongs. For example, the number + * @param regionDialingFrom the ISO 3166-1 two-letter region code that denotes the region that + * we are expecting the number to be dialed from. + * Note this is different from the region where the number belongs. For example, the number * +1 650 253 0000 is a number that belongs to US. When written in this form, it could be - * dialed from any country. When it is written as 00 1 650 253 0000, it could be dialed from - * any country which uses an international dialling prefix of 00. When it is written as 650 + * dialed from any region. When it is written as 00 1 650 253 0000, it could be dialed from + * any region which uses an international dialling prefix of 00. When it is written as 650 * 253 0000, it could only be dialed from within the US, and when written as 253 0000, it * could only be dialed from within a smaller area in the US (Mountain View, CA, to be more * specific). * @return true if the number is possible */ - public boolean isPossibleNumber(String number, String countryDialingFrom) { + public boolean isPossibleNumber(String number, String regionDialingFrom) { try { - return isPossibleNumber(parse(number, countryDialingFrom)); + return isPossibleNumber(parse(number, regionDialingFrom)); } catch (NumberParseException e) { return false; } @@ -1583,27 +1773,28 @@ public class PhoneNumberUtil { } /** - * Gets an AsYouTypeFormatter for the specific country. + * Gets an {@link com.google.i18n.phonenumbers.AsYouTypeFormatter} for the specific region. * - * @param regionCode the ISO 3166-1 two-letter country code that denotes the - * country/region where the phone number is being entered + * @param regionCode the ISO 3166-1 two-letter region code that denotes the region where + * the phone number is being entered * - * @return an AsYouTypeFormatter object, which could be used to format phone numbers in the - * specific country "as you type" + * @return an {@link com.google.i18n.phonenumbers.AsYouTypeFormatter} object, which could be used + * to format phone numbers in the specific region "as you type" */ public AsYouTypeFormatter getAsYouTypeFormatter(String regionCode) { return new AsYouTypeFormatter(regionCode); } - // Extracts country code from fullNumber, returns it and places the remaining number in + // Extracts country calling code from fullNumber, returns it and places the remaining number in // nationalNumber. It assumes that the leading plus sign or IDD has already been removed. Returns - // 0 if fullNumber doesn't start with a valid country code, and leaves nationalNumber unmodified. + // 0 if fullNumber doesn't start with a valid country calling code, and leaves nationalNumber + // unmodified. int extractCountryCode(StringBuffer fullNumber, StringBuffer nationalNumber) { int potentialCountryCode; int numberLength = fullNumber.length(); for (int i = 1; i <= MAX_LENGTH_COUNTRY_CODE && i <= numberLength; i++) { potentialCountryCode = Integer.parseInt(fullNumber.substring(0, i)); - if (countryCodeToRegionCodeMap.containsKey(potentialCountryCode)) { + if (countryCallingCodeToRegionCodeMap.containsKey(potentialCountryCode)) { nationalNumber.append(fullNumber.substring(i)); return potentialCountryCode; } @@ -1612,32 +1803,35 @@ public class PhoneNumberUtil { } /** - * Tries to extract a country code from a number. This method will return zero if no country code - * is considered to be present. Country codes are extracted in the following ways: - * - by stripping the international dialing prefix of the country the person is dialing from, + * Tries to extract a country calling code from a number. This method will return zero if no + * country calling code is considered to be present. Country calling codes are extracted in the + * following ways: + *
    + *
  • by stripping the international dialing prefix of the region the person is dialing from, * if this is present in the number, and looking at the next digits - * - by stripping the '+' sign if present and then looking at the next digits - * - by comparing the start of the number and the country code of the default region. If the - * number is not considered possible for the numbering plan of the default region initially, - * but starts with the country code of this region, validation will be reattempted after - * stripping this country code. If this number is considered a possible number, then the - * first digits will be considered the country code and removed as such. - * - * It will throw a NumberParseException if the number starts with a '+' but the country code - * supplied after this does not match that of any known country. + *
  • by stripping the '+' sign if present and then looking at the next digits + *
  • by comparing the start of the number and the country calling code of the default region. + * If the number is not considered possible for the numbering plan of the default region + * initially, but starts with the country calling code of this region, validation will be + * reattempted after stripping this country calling code. If this number is considered a + * possible number, then the first digits will be considered the country calling code and + * removed as such. + *
+ * It will throw a NumberParseException if the number starts with a '+' but the country calling + * code supplied after this does not match that of any known region. * - * @param number non-normalized telephone number that we wish to extract a country + * @param number non-normalized telephone number that we wish to extract a country calling * code from - may begin with '+' * @param defaultRegionMetadata metadata about the region this number may be from * @param nationalNumber a string buffer to store the national significant number in, in the case - * that a country code was extracted. The number is appended to any existing contents. If no - * country code was extracted, this will be left unchanged. + * that a country calling code was extracted. The number is appended to any existing contents. + * If no country calling code was extracted, this will be left unchanged. * @param keepRawInput true if the country_code_source and preferred_carrier_code fields of * phoneNumber should be populated. - * @param phoneNumber the PhoneNumber object that needs to be populated with country code and - * country code source. Note the country code is always populated, whereas country code source - * is only populated when keepCountryCodeSource is true. - * @return the country code extracted or 0 if none could be extracted + * @param phoneNumber the PhoneNumber object where the country_code and country_code_source need + * to be populated. Note the country_code is always populated, whereas country_code_source is + * only populated when keepCountryCodeSource is true. + * @return the country calling code extracted or 0 if none could be extracted */ int maybeExtractCountryCode(String number, PhoneMetadata defaultRegionMetadata, StringBuffer nationalNumber, boolean keepRawInput, @@ -1670,13 +1864,14 @@ public class PhoneNumberUtil { return potentialCountryCode; } - // If this fails, they must be using a strange country code that we don't recognize, or - // that doesn't exist. + // If this fails, they must be using a strange country calling code that we don't recognize, + // or that doesn't exist. throw new NumberParseException(NumberParseException.ErrorType.INVALID_COUNTRY_CODE, - "Country code supplied was not recognised."); + "Country calling code supplied was not recognised."); } else if (defaultRegionMetadata != null) { // Check to see if the number is valid for the default region already. If not, we check to - // see if the country code for the default region is present at the start of the number. + // see if the country calling code for the default region is present at the start of the + // number. PhoneNumberDesc generalDesc = defaultRegionMetadata.getGeneralDesc(); Pattern validNumberPattern = regexCache.getPatternForRegex(generalDesc.getNationalNumberPattern()); @@ -1692,8 +1887,9 @@ public class PhoneNumberUtil { Matcher possibleNumberMatcher = regexCache.getPatternForRegex(generalDesc.getPossibleNumberPattern()).matcher( potentialNationalNumber); - // If the resultant number is either valid, or still too long even with the country code - // stripped, we consider this a better result and keep the potential national number. + // If the resultant number is either valid, or still too long even with the country + // calling code stripped, we consider this a better result and keep the potential national + // number. if (validNumberPattern.matcher(potentialNationalNumber).matches() || (possibleNumberMatcher.lookingAt() && possibleNumberMatcher.end() != potentialNationalNumber.length())) { @@ -1707,7 +1903,7 @@ public class PhoneNumberUtil { } } } - // No country code present. + // No country calling code present. phoneNumber.setCountryCode(0); return 0; } @@ -1720,8 +1916,8 @@ public class PhoneNumberUtil { Matcher m = iddPattern.matcher(number); if (m.lookingAt()) { int matchEnd = m.end(); - // Only strip this if the first digit after the match is not a 0, since country codes cannot - // begin with 0. + // Only strip this if the first digit after the match is not a 0, since country calling codes + // cannot begin with 0. Matcher digitMatcher = CAPTURING_DIGIT_PATTERN.matcher(number.substring(matchEnd)); if (digitMatcher.find()) { String normalizedGroup = normalizeHelper(digitMatcher.group(1), DIGIT_MAPPINGS, true); @@ -1741,7 +1937,7 @@ public class PhoneNumberUtil { * * @param number the non-normalized telephone number that we wish to strip any international * dialing prefix from. - * @param possibleIddPrefix the international direct dialing prefix from the country we + * @param possibleIddPrefix the international direct dialing prefix from the region 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 @@ -1781,7 +1977,7 @@ public class PhoneNumberUtil { * * @param number the normalized telephone number that we wish to strip any national * dialing prefix from - * @param metadata the metadata for the country that we think this number is from + * @param metadata the metadata for the region that we think this number is from * @return the carrier code extracted if it is present, otherwise return an empty string. */ String maybeStripNationalPrefixAndCarrierCode(StringBuffer number, PhoneMetadata metadata) { @@ -1859,12 +2055,12 @@ public class PhoneNumberUtil { /** * 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. + * parse starts with a + symbol so that we can attempt to infer the region 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 the number is null or empty, we can't guess the country code. + private boolean checkRegionForParsing(String numberToParse, String defaultRegion) { + if (!isValidRegionCode(defaultRegion)) { + // If the number is null or empty, we can't infer the region. if (numberToParse == null || numberToParse.length() == 0 || !PLUS_CHARS_PATTERN.matcher(numberToParse).lookingAt()) { return false; @@ -1875,95 +2071,95 @@ public class PhoneNumberUtil { /** * 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 - * that validation of whether the number is actually a valid number for a particular - * country/region is not performed. This can be done separately with isValidNumber. + * {@link com.google.i18n.phonenumbers.NumberParseException} if the number is not considered to be + * a possible number. Note that validation of whether the number is actually a valid number for a + * particular region is not performed. This can be done separately with {@link #isValidNumber}. * * @param numberToParse number that we are attempting to parse. This can contain formatting * such as +, ( and -, as well as a phone number extension. - * @param defaultCountry the ISO 3166-1 two-letter country code that denotes the - * country that we are expecting the number to be from. This is only used - * if the number being parsed is not written in international format. - * The country code for the number in this case would be stored as that - * of the default country supplied. If the number is guaranteed to - * start with a '+' followed by the country code, then "ZZ" or + * @param defaultRegion the ISO 3166-1 two-letter region code that denotes the region that we + * are expecting the number to be from. This is only used if the number + * being parsed is not written in international format. + * The country_code for the number in this case would be stored as that + * of the default region supplied. If the number is guaranteed to + * start with a '+' followed by the country calling code, then "ZZ" or * null can be supplied. * @return a phone number proto buffer filled with the parsed number * @throws NumberParseException if the string is not considered to be a viable phone number or if - * no default country was supplied and the number is not in + * no default region was supplied and the number is not in * international format (does not start with +) */ - public PhoneNumber parse(String numberToParse, String defaultCountry) + public PhoneNumber parse(String numberToParse, String defaultRegion) throws NumberParseException { PhoneNumber phoneNumber = new PhoneNumber(); - parse(numberToParse, defaultCountry, phoneNumber); + parse(numberToParse, defaultRegion, phoneNumber); return phoneNumber; } // Same as parse(String, String), but accepts mutable PhoneNumber as a parameter to // decrease object creation when invoked many times. - public void parse(String numberToParse, String defaultCountry, PhoneNumber phoneNumber) + public void parse(String numberToParse, String defaultRegion, PhoneNumber phoneNumber) throws NumberParseException { - parseHelper(numberToParse, defaultCountry, false, true, phoneNumber); + parseHelper(numberToParse, defaultRegion, false, true, phoneNumber); } /** - * Parses a string and returns it in proto buffer format. This method differs from parse() in that - * it always populates the raw_input field of the protocol buffer with numberToParse as well as - * the country_code_source field. + * Parses a string and returns it in proto buffer format. This method differs from {@link #parse} + * in that it always populates the raw_input field of the protocol buffer with numberToParse as + * well as the country_code_source field. * * @param numberToParse number that we are attempting to parse. This can contain formatting * such as +, ( and -, as well as a phone number extension. - * @param defaultCountry the ISO 3166-1 two-letter country code that denotes the country that + * @param defaultRegion the ISO 3166-1 two-letter region code that denotes the region that * we are expecting the number to be from. This is only used if the * number being parsed is not written in international format. The - * country code for the number in this case would be stored as that of - * the default country supplied. + * country calling code for the number in this case would be stored as + * that of the default region supplied. * @return a phone number proto buffer filled with the parsed number * @throws NumberParseException if the string is not considered to be a viable phone number or if - * no default country was supplied + * no default region was supplied */ - public PhoneNumber parseAndKeepRawInput(String numberToParse, String defaultCountry) + public PhoneNumber parseAndKeepRawInput(String numberToParse, String defaultRegion) throws NumberParseException { PhoneNumber phoneNumber = new PhoneNumber(); - parseAndKeepRawInput(numberToParse, defaultCountry, phoneNumber); + parseAndKeepRawInput(numberToParse, defaultRegion, phoneNumber); return phoneNumber; } // Same as parseAndKeepRawInput(String, String), but accepts mutable PhoneNumber as a parameter to // decrease object creation when invoked many times. - public void parseAndKeepRawInput(String numberToParse, String defaultCountry, + public void parseAndKeepRawInput(String numberToParse, String defaultRegion, PhoneNumber phoneNumber) throws NumberParseException { - parseHelper(numberToParse, defaultCountry, true, true, phoneNumber); + parseHelper(numberToParse, defaultRegion, true, true, phoneNumber); } /** * Returns an iterable over all {@link PhoneNumberMatch PhoneNumberMatches} in {@code text}. This * is a shortcut for {@link #findNumbers(CharSequence, String, Leniency, long) - * getMatcher(text, defaultCountry, Leniency.VALID, Long.MAX_VALUE)}. + * getMatcher(text, defaultRegion, Leniency.VALID, Long.MAX_VALUE)}. * * @param text the text to search for phone numbers, null for no text - * @param defaultCountry the ISO 3166-1 two-letter country code that denotes the country that + * @param defaultRegion the ISO 3166-1 two-letter region code that denotes the region that * we are expecting the number to be from. This is only used if the * number being parsed is not written in international format. The - * country code for the number in this case would be stored as that of - * the default country supplied. May be null if only international + * country calling code for the number in this case would be stored as + * that of the default region supplied. May be null if only international * numbers are expected. */ - public Iterable findNumbers(CharSequence text, String defaultCountry) { - return findNumbers(text, defaultCountry, Leniency.VALID, Long.MAX_VALUE); + public Iterable findNumbers(CharSequence text, String defaultRegion) { + return findNumbers(text, defaultRegion, Leniency.VALID, Long.MAX_VALUE); } /** * Returns an iterable over all {@link PhoneNumberMatch PhoneNumberMatches} in {@code text}. * * @param text the text to search for phone numbers, null for no text - * @param defaultCountry the ISO 3166-1 two-letter country code that denotes the country that + * @param defaultRegion the ISO 3166-1 two-letter region code that denotes the region that * we are expecting the number to be from. This is only used if the * number being parsed is not written in international format. The - * country code for the number in this case would be stored as that of - * the default country supplied. May be null if only international + * country calling code for the number in this case would be stored as + * that of the default region supplied. May be null if only international * numbers are expected. * @param leniency the leniency to use when evaluating candidate phone numbers * @param maxTries the maximum number of invalid numbers to try before giving up on the @@ -1971,24 +2167,24 @@ public class PhoneNumberUtil { * false positives in it. Must be {@code >= 0}. */ public Iterable findNumbers( - final CharSequence text, final String defaultCountry, final Leniency leniency, + final CharSequence text, final String defaultRegion, final Leniency leniency, final long maxTries) { return new Iterable() { public Iterator iterator() { return new PhoneNumberMatcher( - PhoneNumberUtil.this, text, defaultCountry, leniency, maxTries); + PhoneNumberUtil.this, text, defaultRegion, leniency, maxTries); } }; } /** * 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(). checkRegion should be set to false if it is permitted for the default country + * parse() method, with the exception that it allows the default region to be null, for use by + * isNumberMatch(). checkRegion should be set to false if it is permitted for the default region * to be null or unknown ("ZZ"). */ - private void parseHelper(String numberToParse, String defaultCountry, boolean keepRawInput, + private void parseHelper(String numberToParse, String defaultRegion, boolean keepRawInput, boolean checkRegion, PhoneNumber phoneNumber) throws NumberParseException { if (numberToParse == null) { @@ -2003,42 +2199,42 @@ 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 + + // Check the region 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)) { + if (checkRegion && !checkRegionForParsing(number, defaultRegion)) { throw new NumberParseException(NumberParseException.ErrorType.INVALID_COUNTRY_CODE, - "Missing or invalid default country."); + "Missing or invalid default region."); } if (keepRawInput) { phoneNumber.setRawInput(numberToParse); } StringBuffer nationalNumber = new StringBuffer(number); - // Attempt to parse extension first, since it doesn't require country-specific data and we want + // Attempt to parse extension first, since it doesn't require region-specific data and we want // to have the non-normalised number here. String extension = maybeStripExtension(nationalNumber); if (extension.length() > 0) { phoneNumber.setExtension(extension); } - PhoneMetadata countryMetadata = getMetadataForRegion(defaultCountry); + PhoneMetadata regionMetadata = getMetadataForRegion(defaultRegion); // Check to see if the number is given in international format so we know whether this number is - // from the default country or not. + // from the default region or not. StringBuffer normalizedNationalNumber = new StringBuffer(); - int countryCode = maybeExtractCountryCode(nationalNumber.toString(), countryMetadata, + int countryCode = maybeExtractCountryCode(nationalNumber.toString(), regionMetadata, normalizedNationalNumber, keepRawInput, phoneNumber); if (countryCode != 0) { String phoneNumberRegion = getRegionCodeForCountryCode(countryCode); - if (!phoneNumberRegion.equals(defaultCountry)) { - countryMetadata = getMetadataForRegion(phoneNumberRegion); + if (!phoneNumberRegion.equals(defaultRegion)) { + regionMetadata = getMetadataForRegion(phoneNumberRegion); } } else { - // If no extracted country code, use the region supplied instead. The national number is just - // the normalized version of the number we were given to parse. + // If no extracted country calling code, use the region supplied instead. The national number + // is just the normalized version of the number we were given to parse. normalize(nationalNumber); normalizedNationalNumber.append(nationalNumber); - if (defaultCountry != null) { - countryCode = countryMetadata.getCountryCode(); + if (defaultRegion != null) { + countryCode = regionMetadata.getCountryCode(); phoneNumber.setCountryCode(countryCode); } else if (keepRawInput) { phoneNumber.clearCountryCodeSource(); @@ -2048,9 +2244,9 @@ public class PhoneNumberUtil { throw new NumberParseException(NumberParseException.ErrorType.TOO_SHORT_NSN, "The string supplied is too short to be a phone number."); } - if (countryMetadata != null) { + if (regionMetadata != null) { String carrierCode = - maybeStripNationalPrefixAndCarrierCode(normalizedNationalNumber, countryMetadata); + maybeStripNationalPrefixAndCarrierCode(normalizedNationalNumber, regionMetadata); if (keepRawInput) { phoneNumber.setPreferredDomesticCarrierCode(carrierCode); } @@ -2065,7 +2261,8 @@ public class PhoneNumberUtil { "The string supplied is too long to be a phone number."); } if (normalizedNationalNumber.charAt(0) == '0' && - isLeadingZeroCountry(countryCode)) { + regionMetadata != null && + regionMetadata.isLeadingZeroPossible()) { phoneNumber.setItalianLeadingZero(true); } phoneNumber.setNationalNumber(Long.parseLong(normalizedNationalNumber.toString())); @@ -2074,12 +2271,12 @@ public class PhoneNumberUtil { /** * Takes two phone numbers and compares them for equality. * - * Returns EXACT_MATCH if the country code, NSN, presence of a leading zero for Italian numbers + *

Returns EXACT_MATCH if the country_code, NSN, presence of a leading zero for Italian numbers * and any extension present are the same. - * Returns NSN_MATCH if either or both has no country specified, and the NSNs and extensions are + * Returns NSN_MATCH if either or both has no region specified, and the NSNs and extensions are * the same. - * Returns SHORT_NSN_MATCH if either or both has no country specified, or the country specified - * is the same, and one NSN could be a shorter version of the other number. This includes the case + * Returns SHORT_NSN_MATCH if either or both has no region specified, or the region specified is + * the same, and one NSN could be a shorter version of the other number. This includes the case * where one has an extension specified, and the other does not. * Returns NO_MATCH otherwise. * For example, the numbers +1 345 657 1234 and 657 1234 are a SHORT_NSN_MATCH. @@ -2120,7 +2317,7 @@ public class PhoneNumberUtil { } int firstNumberCountryCode = firstNumber.getCountryCode(); int secondNumberCountryCode = secondNumber.getCountryCode(); - // Both had country code specified. + // Both had country_code specified. if (firstNumberCountryCode != 0 && secondNumberCountryCode != 0) { if (firstNumber.exactlySameAs(secondNumber)) { return MatchType.EXACT_MATCH; @@ -2134,8 +2331,8 @@ public class PhoneNumberUtil { // This is not a match. return MatchType.NO_MATCH; } - // Checks cases where one or both country codes were not specified. To make equality checks - // easier, we first set the country codes to be equal. + // Checks cases where one or both country_code fields were not specified. To make equality + // checks easier, we first set the country_code fields to be equal. firstNumber.setCountryCode(secondNumberCountryCode); // If all else was the same, then this is an NSN_MATCH. if (firstNumber.exactlySameAs(secondNumber)) { @@ -2159,11 +2356,10 @@ public class PhoneNumberUtil { /** * Takes two phone numbers as strings and compares them for equality. This is a convenience - * wrapper for isNumberMatch(PhoneNumber firstNumber, PhoneNumber secondNumber). No default region - * is known. + * wrapper for {@link #isNumberMatch(PhoneNumber, PhoneNumber)}. No default region is known. * - * @param firstNumber first number to compare. Can contain formatting, and can have country code - * specified with + at the start. + * @param firstNumber first number to compare. Can contain formatting, and can have country + * calling code specified with + at the start. * @param secondNumber second number to compare. Can contain formatting, and can have country * code specified with + at the start. * @return NOT_A_NUMBER, NO_MATCH, SHORT_NSN_MATCH, NSN_MATCH, EXACT_MATCH. See @@ -2208,13 +2404,14 @@ public class PhoneNumberUtil { * isNumberMatch(PhoneNumber firstNumber, PhoneNumber secondNumber) for more details. */ public MatchType isNumberMatch(PhoneNumber firstNumber, String secondNumber) { - // First see if the second number has an implicit country code, by attempting to parse it. + // First see if the second number has an implicit country calling code, by attempting to parse + // it. try { PhoneNumber secondNumberAsProto = parse(secondNumber, UNKNOWN_REGION); return isNumberMatch(firstNumber, secondNumberAsProto); } catch (NumberParseException e) { if (e.getErrorType() == NumberParseException.ErrorType.INVALID_COUNTRY_CODE) { - // The second number has no country code. EXACT_MATCH is no longer possible. + // The second number has no country calling code. EXACT_MATCH is no longer possible. // We parse it as if the region was the same as that for the first number, and if // EXACT_MATCH is returned, we replace this with NSN_MATCH. String firstNumberRegion = getRegionCodeForCountryCode(firstNumber.getCountryCode()); @@ -2227,8 +2424,8 @@ public class PhoneNumberUtil { } return match; } else { - // If the first number didn't have a valid country code, then we parse the second number - // without one as well. + // If the first number didn't have a valid country calling code, then we parse the + // second number without one as well. PhoneNumber secondNumberProto = new PhoneNumber(); parseHelper(secondNumber, null, false, false, secondNumberProto); return isNumberMatch(firstNumber, secondNumberProto); @@ -2243,14 +2440,14 @@ public class PhoneNumberUtil { } /** - * Returns true if the number can only be dialled from within the country. If unknown, or the - * number can be dialled from outside the country as well, returns false. Does not check the + * Returns true if the number can only be dialled from within the region. If unknown, or the + * number can be dialled from outside the region as well, returns false. Does not check the * number is a valid number. * TODO: Make this method public when we have enough metadata to make it worthwhile. Currently * visible for testing purposes only. * * @param number the phone-number for which we want to know whether it is only diallable from - * within the country + * within the region */ boolean canBeInternationallyDialled(PhoneNumber number) { String regionCode = getRegionCodeForNumber(number); diff --git a/java/src/com/google/i18n/phonenumbers/Phonemetadata.java b/java/src/com/google/i18n/phonenumbers/Phonemetadata.java index 98dd52fa2..d8da29608 100644 --- a/java/src/com/google/i18n/phonenumbers/Phonemetadata.java +++ b/java/src/com/google/i18n/phonenumbers/Phonemetadata.java @@ -57,10 +57,10 @@ public final class Phonemetadata { // repeated string leading_digits_pattern = 3; private java.util.List leadingDigitsPattern_ = new java.util.ArrayList(); - public java.util.List getLeadingDigitsPatternList() { + public java.util.List leadingDigitPatterns() { return leadingDigitsPattern_; } - public int getLeadingDigitsPatternCount() { return leadingDigitsPattern_.size(); } + public int leadingDigitsPatternSize() { return leadingDigitsPattern_.size(); } public String getLeadingDigitsPattern(int index) { return leadingDigitsPattern_.get(index); } @@ -108,7 +108,7 @@ public final class Phonemetadata { if (other.hasFormat()) { setFormat(other.getFormat()); } - int leadingDigitsPatternSize = other.getLeadingDigitsPatternCount(); + int leadingDigitsPatternSize = other.leadingDigitsPatternSize(); for (int i = 0; i < leadingDigitsPatternSize; i++) { addLeadingDigitsPattern(other.getLeadingDigitsPattern(i)); } @@ -124,7 +124,7 @@ public final class Phonemetadata { public void writeExternal(ObjectOutput objectOutput) throws IOException { objectOutput.writeUTF(pattern_); objectOutput.writeUTF(format_); - int leadingDigitsPatternSize = getLeadingDigitsPatternCount(); + int leadingDigitsPatternSize = leadingDigitsPatternSize(); objectOutput.writeInt(leadingDigitsPatternSize); for (int i = 0; i < leadingDigitsPatternSize; i++) { objectOutput.writeUTF(leadingDigitsPattern_.get(i)); @@ -503,10 +503,10 @@ public final class Phonemetadata { // repeated NumberFormat number_format = 19; private java.util.List numberFormat_ = new java.util.ArrayList(); - public java.util.List getNumberFormatList() { + public java.util.List numberFormats() { return numberFormat_; } - public int getNumberFormatCount() { return numberFormat_.size(); } + public int numberFormatSize() { return numberFormat_.size(); } public NumberFormat getNumberFormat(int index) { return numberFormat_.get(index); } @@ -521,10 +521,10 @@ public final class Phonemetadata { // repeated NumberFormat intl_number_format = 20; private java.util.List intlNumberFormat_ = new java.util.ArrayList(); - public java.util.List getIntlNumberFormatList() { + public java.util.List intlNumberFormats() { return intlNumberFormat_; } - public int getIntlNumberFormatCount() { return intlNumberFormat_.size(); } + public int intlNumberFormatSize() { return intlNumberFormat_.size(); } public NumberFormat getIntlNumberFormat(int index) { return intlNumberFormat_.get(index); } @@ -559,6 +559,17 @@ public final class Phonemetadata { return this; } + // optional bool leading_zero_possible = 26 [default = false]; + private boolean hasLeadingZeroPossible; + private boolean leadingZeroPossible_ = false; + public boolean hasLeadingZeroPossible() { return hasLeadingZeroPossible; } + public boolean isLeadingZeroPossible() { return leadingZeroPossible_; } + public PhoneMetadata setLeadingZeroPossible(boolean value) { + hasLeadingZeroPossible = true; + leadingZeroPossible_ = value; + return this; + } + public void writeExternal(ObjectOutput objectOutput) throws IOException { objectOutput.writeBoolean(hasGeneralDesc); if (hasGeneralDesc) { @@ -636,13 +647,13 @@ public final class Phonemetadata { objectOutput.writeBoolean(sameMobileAndFixedLinePattern_); - int numberFormatSize = getNumberFormatCount(); + int numberFormatSize = numberFormatSize(); objectOutput.writeInt(numberFormatSize); for (int i = 0; i < numberFormatSize; i++) { numberFormat_.get(i).writeExternal(objectOutput); } - int intlNumberFormatSize = getIntlNumberFormatCount(); + int intlNumberFormatSize = intlNumberFormatSize(); objectOutput.writeInt(intlNumberFormatSize); for (int i = 0; i < intlNumberFormatSize; i++) { intlNumberFormat_.get(i).writeExternal(objectOutput); @@ -654,6 +665,8 @@ public final class Phonemetadata { if (hasLeadingDigits) { objectOutput.writeUTF(leadingDigits_); } + + objectOutput.writeBoolean(leadingZeroPossible_); } public void readExternal(ObjectInput objectInput) throws IOException { @@ -775,6 +788,8 @@ public final class Phonemetadata { if (hasString) { setLeadingDigits(objectInput.readUTF()); } + + setLeadingZeroPossible(objectInput.readBoolean()); } } diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AC b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AC index 5bf42890876700bb6461c41c4a29e1931ea70508..d0069f1a2093972ef4124884d565259e4695b7bd 100644 GIT binary patch delta 16 Ycmcb`c$<-J&07Z6@~acst}rqH062yQ6aWAK delta 14 Wcmcc3c#Dy3&07Z6@+%YBt^fcmTm}*V diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AD b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AD index 62b3b29d8a6ca67f9329c1e6ceb47af735a2886a..2f5199be9a4f098af8c7ab6899d09c97ba55734b 100644 GIT binary patch delta 20 bcmcc5^ni(T&07Z6Dh39|@Qs{djEoEbMzsY` delta 18 ZcmaFBbf1ZH&07Z6Dh39|u#KEyi~u|o1x)|| diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AE index cce75403ea2ba9ad8fe1a35b263e192da337af6d..2f543e19b0582c99adb27a1123abe17c52ad657d 100644 GIT binary patch delta 20 bcmdnYvW10n&07Z6Dh387?TwsTOpFWwKAZ%l delta 18 ZcmdnOvYCZ*&07Z6Dh387t&N;oOaL`c1fu`| diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AF index 69223401efbbdb111d6b01fdf1b929369fc2ffa9..0120a2380d27d83e2a1f6951ef27992163ea925b 100644 GIT binary patch delta 20 bcmdnbbbyI-&07Z6Dh38d^NpNljEoEbK$Qf~ delta 18 ZcmX@Ww4aG{&07Z6Dh38dvyGf)i~u(D1kC^d diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AG index f0b7c4fa76101f4b87fcfd37e63240cb95401bdf..8679e74bb71076d9d1d878069f7867b6747f977b 100644 GIT binary patch delta 20 ccmcc3e21BH&07Z6Dh39|%Nsc_F)}g$085nyK>z>% delta 18 acmcb^e4Ckb&07Z6Dh39|OB*>aF#-TT5C%U0 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AI index 403d693830093acb655841ed6d5c9bce98578f26..8a3623756d8584b8295ffee3e6fc9ad663e280cd 100644 GIT binary patch delta 20 ccmbQqJd2rg&07Z6Dh39|i5od5FfuX#06y~tIRF3v delta 18 acmbQmJd>Go&07Z6Dh39|2^%>lFaiKHeg!uG diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AL b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AL index 560b6777b69b7e389dbc1ca2cab7be8bf0f45d6f..15cbd779c1640d90dc4c129af9aaa0675aa36a1d 100644 GIT binary patch delta 20 ccmX@adYF}S&07Z6Dh39oT^l)fGBGj$07oAM;{X5v delta 18 acmX@idWe;C&07Z6Dh39oof|oKG64WPRt4bz diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AM index e1488b3cf186966810fba33c6b9d87064b901a52..45ee014f4fa20aa23329edca7350de2ce747d2c8 100644 GIT binary patch delta 20 bcmeBX>0#kq^Ok|Nih+TNc_Swi6C(ovHuMAq delta 18 ZcmeBS>1N?v^Ok|Nih+TNX(J~S696vf1Oos7 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AN index 73a83e8606f67bbdfc0b8a6f33a85951478f4e7f..e2aa056d444f0d55d0fd3bfa83e5fadd3a4d3baf 100644 GIT binary patch delta 20 bcmZ3@vWA6o&07Z6Dh387<&B(5OpFWwJro3m delta 18 ZcmZ3(vYLf+&07Z6Dh387rH!0QOaL?o1cLwo diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AO index 304cb0a2c7709eccd81853d281da9844d30e39b9..13a528534993ecba2dceec752453d64cd2a5771d 100644 GIT binary patch delta 20 bcmZ3)w3vx=&07Z6Dh38dsg0bHjEoEbI|u|@ delta 18 ZcmZ3?w1|mw&07Z6Dh38d$&H+ni~urE1X%z8 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AR index 44a3b68a07fe824b439d8a59387a58ec404b0482..5da4db1a7001e7bebb879ee491ecaafb7810881b 100644 GIT binary patch delta 15 Wcmdlla6n)KKL?}1WC0F+Mg{;R*8_6^ delta 13 UcmX>guwP&UKL?}!WC0F+03GfFaR2}S diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AS b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AS index 8728b2840ddc8ba8d7c9a97c133062b14f305c88..81d04c8b741c7a7657ec0f61618d310f6d086f96 100644 GIT binary patch delta 20 bcmZo??qKFz^Ok|Nih+T#ej{fcBO?OwvLT+&07Z6Dh38-)s37g%!~{GJ;?-< delta 18 ZcmZ3-ww8@^&07Z6Dh38-m5rP#%m6f?1d#v$ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AW b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AW index 1c7842e7bead7851903af09142c1e3b8d83e660b..00b01734db1a2dbb2c4ab97834e18495f3375899 100644 GIT binary patch delta 20 bcmaFI^qz@x&07Z6Dh39|w2hppjEoEbNt6YP delta 18 ZcmaFQ^p1&h&07Z6Dh39|)Qy~}i~v4+1&IIv diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AZ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AZ index ca83c980b7cbae68296ea19c77ca91df9ed30c70..4b3d331046470f138aae6329c6883b1190c2e75c 100644 GIT binary patch delta 57 zcmcc3`jC}#&07Z6Dh39o8xuK|82cvbG;q|In8c)18`Vx+BQGGWVQ&>}Vis#qV;XH> NXd1im-d{#W1^^cX5+?uv delta 77 zcmaFJdYhGV&07Z6Dh39oOA|Sj7~3Z5G#F{dq*R;MGBU7(XdO!+i__4^7>GHvj+t diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BA index 3c9e2688758fdc04c8e9a3264748e2b6e3b3e165..c5e36f658df28cc06cd3c9b9c636d2ca774d1026 100644 GIT binary patch delta 20 bcmey(^oNOa&07Z6Dh39|;*Fd|jEoEbOc4dY delta 18 Zcmeyv^qYxu&07Z6Dh39|qK%wIi~vB81-$?O diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BB b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BB index 0b60e57244ef39a69bfa48d1fd748c94b80e2677..74345e75ae1a5de9290a0959ec1a7f364639dfbd 100644 GIT binary patch delta 20 bcmZo>ZeiwJ^Ok|Nih+T#dLw5QBO?Ox{j4|&07Z6Dh39or5ibyFflR!07DuDj{pDw delta 18 acmZ3-x|Wr5&07Z6Dh39oB^x=HFaZEJ`2~#t diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BF index cd1431f156484dd417aa680ed8129cf2689dea39..a450f514c37d1b65ec070fc4eba10b8eda424c97 100644 GIT binary patch delta 20 bcmey*)WFQS<}Cwj6$1lf`9{t%Mn(nzL*@lg delta 18 ZcmZo*{?Ej@<}Cwj6$1lf*+$MXMgTZP1x^3} diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BG index ed3913d0fd4c63a52481d900e489b42711ba739e..e1e34d9d97af5d87479b4e7277b75c54f07804dd 100644 GIT binary patch delta 20 bcmZo;YiHwJ^Ok|Nih+UY-$u^AOpFWwK}QAk delta 18 ZcmZo?Yh&YF^Ok|Nih+UY??%qQOaL`n1@iy^ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BH b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BH index a7b67c4b23286345dd2af0be0472b080e8c2d4af..3589ec9fd35721732ee5d64d113eb240605a50eb 100644 GIT binary patch delta 20 ccmdnUyos4}&07Z6Dh39|l^Z!%FfuX#07HufnE(I) delta 18 acmdnQypfr6&07Z6Dh39|6&pEMFaiKLRt1*; diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BI index 40ecfcbb1b8a11b66b4c4adec97aee4c52fa46b1..2b67b002effe357dbac1e1f04c5273166bb022dd 100644 GIT binary patch delta 20 bcmdnPw3mr<&07Z6Dh38dlZ~9ljEoEbKmr8A delta 18 ZcmdnXw1n+a delta 18 acmZ3*ypox7&07Z6Dh39|1sgdRFaiKK4h44r diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BN index 0fe3d380421d91942e818117dcdd286d76984c2b..46b0177a07b9f8cac8a70aba73d4c83c6eea3ee3 100644 GIT binary patch delta 20 bcmbQlG?|HW&07Z6Dh38du8o|WjEoEbH~0h_ delta 18 ZcmbQtG>M6G&07Z6Dh38d&W)U$i~ujc1Q`GT diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BO index 0395299f0ada644ab69137a6fe1436976acb8aa6..8e8857c75ee2540393c0832c69f97b632f7964c1 100644 GIT binary patch delta 20 bcmbQlGMR;Q&07Z6Dh387u8o|WOpFWwI7X<^}9^Ok|Nih+Ug_eRcNjEoEbKw$;r delta 18 ZcmZo+X=dSE^Ok|Nih+Ug*GA4?i~uy41>pby diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BY index 91b82072b96e524d5a666e25cf7360cc13fb09bc..969f182a926503f671ed8a8841e969bec0b3ee76 100644 GIT binary patch delta 20 bcmX@la)E_&&07Z6Dh387_l=xxOpFWwL-++1 delta 18 Zcmcb>a-M~A&07Z6Dh387w~d@`OaM8{1rq=O diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BZ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BZ index ec98a819b9e47c87a289232bd55e907f3e040d14..d1d270b4d1c2c73dc290f42220e8911a66edabd4 100644 GIT binary patch delta 20 bcmZojEoEbNNxpl delta 18 ZcmaFK^n!_V&07Z6Dh39|_>G+Li~v1_1#tiX diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CF index 440ee17f2330b97b3bd8feae87fdedef8ec3575b..eeb5eeb157498a3b96a25374e5169609a656a872 100644 GIT binary patch delta 20 bcmZ3>w2p~$&07Z6Dh38d)s37gjEoEbJtG8% delta 18 ZcmZ3-w3dl;&07Z6Dh38dm5rP#i~uwe1cd+q diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CG index dfc82a1db99b22ad4af9b40e6d6236bca256cc9e..6b809d41ee81f186b56a13bde8f920335808eb32 100644 GIT binary patch delta 20 bcmcc3bccy^&07Z6Dh39|;EkL?jEsx`Me+qe delta 18 Zcmcb^beoBD&07Z6Dh39|ppBeCi~u`u1w8-& diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CH b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CH index b9781b3c9d483743390d7d8ac4db8a23dfbfb1b7..1b520c313b159710ada493d8e8e96db8b0484f9d 100644 GIT binary patch delta 20 ccmeyu{FRw=&07Z6Dh39|Hyb%$Gcqy&08m~Ar2qf` delta 18 acmey${Dqlw&07Z6Dh39|*Bd!sGXelZ5eB0G diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CI index c647c3dfb5dac65e522b21d23e04192846263a37..15a95d63968f07a18dac5e2e2237abf57dc51541 100644 GIT binary patch delta 20 bcmeyv^p}Zq&07Z6Dh39|l8v0jjEsx`OhX04 delta 18 Zcmey%^oNOa&07Z6Dh39|;*Ffei~vBn1;GFS diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CK b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CK index 2ce83c2808c3f3136684718700059d3a6009090e..4f01ce284f07851709243ae4b5844bec7b7c8b3b 100644 GIT binary patch delta 16 YcmbQmIGd4e&07Z6@~IQqrZ6%904~M_6aWAK delta 14 WcmbQuIE#^O&07Z6@+lM9rT_pWoCOj9 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CL b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CL index 2e9c0d8d65388d62bade439afbb019a1d8352fc3..8fabf745f36c518ae5086b7841805c371a82630c 100644 GIT binary patch delta 20 bcmeyu_LYru&07Z6Dh3AToQ<5>%!~{GOJD`B delta 18 Zcmey$_Jxge&07Z6Dh3AT?2Vk+%m6?C1+4%8 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CM index 414c1ddc0f43cc5bda0dbaa1b7b26a500976db2d..5fb3c1fe482e4473ef2fe3e107bcfc83caf2e6e2 100644 GIT binary patch delta 20 bcmey%^pA;i&07Z6Dh39|(v6%YjEoEbOmhXt delta 18 Zcmeyz^p}Zq&07Z6Dh39|l8u}ti~vC51;qdW diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CN index aeb822422a46a656e5f8cdd4289539c32f6196ee..913120f0e24d38831a4e9f05db09d7fbf542034f 100644 GIT binary patch delta 32 ncmbO%GDT#A5C<bZ`en delta 30 lcmbOtGFfDU5C<;<10w?igQ!MKO0{wAS;%jEoEbMUMqH delta 18 Zcmcb`bd!m5&07Z6Dh39|fQ_61i~u_x1vLNw diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CZ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CZ index 8e4bc858fd989790b0849d1ed7168fac0d1d3371..0d263a1b2d18b5fa1a9b93216ff4947a989725f2 100644 GIT binary patch delta 20 ccmbQsJdc@k&07Z6Dh39|sT(<`FfuX#06(_{NdN!< delta 18 acmbQoJeQes&07Z6Dh39|DH}PbFaiKIA_YeP diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DE index 657ff376a8f86163613897b7e6ae41c715145c00..87844f3a2651b588f7403b113b6af7830aa0b223 100644 GIT binary patch delta 16 XcmaFP^MYpsFAHPTWwUK&07Z6Dh38d-i@3*jEoEbIEw@) delta 18 ZcmbQnG?j^S&07Z6Dh38do{gM5i~uk?1SJ3f diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DK b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DK index 2b9a712c2dcd490819133429299816382a45ee83..cbb0f4c56d52af41d9fd5752cf0e5da17e3dd7d0 100644 GIT binary patch delta 20 ccmbQmJe!$w&07Z6Dh39|NgFvQGBPp%06!!JJpcdz delta 18 acmbQuJd2rg&07Z6Dh39|i5od5G6DcJrv*Cz diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DM index 2f468341e75ad48cb8e545a3a6990c045c8199b3..486ba15520cebf49ad07b7caba82997b87620314 100644 GIT binary patch delta 20 ccmdnQyqTGE&07Z6Dh39|RU0{1GBPp%07JY5od5s; delta 18 acmdnYyos4}&07Z6Dh39|l^Z!%G6DcNe+8QW diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DO index 0100b938c94c3cb594113975189f02adbe661dd2..5ee5e4d789c2fa25d97f12e055c4f25e32937168 100644 GIT binary patch delta 20 bcmey)^n;0W&07Z6Dh39|{EeJ>jEoEbOHBo@ delta 18 Zcmeyt^qq-w&07Z6Dh39|yp5cBi~v9E1+4%8 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DZ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DZ index 9551e58d1d97e62b8bfc5f370d9d7ac9188b92ed..c3d52a0a5a2c3a958ea8b4eb81af09290ef959b2 100644 GIT binary patch delta 20 bcmX@ha*l;_&07Z6Dh387*NvPmOpFWwLzV>% delta 18 ZcmX@da+Za2&07Z6Dh387myMh*OaM7~1q%QG diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EC b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EC index 5078020831299875a06e2f258f82e5dffbeadfb5..1b59c2321df067064bb621d55be1d666b6b96ed4 100644 GIT binary patch delta 20 bcmdnRvYUl-&07Z6Dh387qm7(~OpFWwKl22^ delta 18 ZcmdnZvWtat&07Z6Dh387!;PGVOaL}+1it_P diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EE index 45242fefe4cedd4253db3eb2adf58e6ebbac1152..8387a3b156364f21b76bd6cf75b44070836d89b9 100644 GIT binary patch delta 87 zcmbQkwv3H)&07Z6Dh38-*@>L0jOH8lr5S~J%nhOqbd6$TQmRdB85vlC^yCD_UKZVG iW3$Ph7?pWy%%cr;En^uxK?2fD_UurB$x%#)7#RT0wiaRl delta 75 zcmZ3+HiwOK&07Z6Dh38-;fb88jAk44r5VL|%?+Xrbd6%|V^XS3YZ)2XfwZ~K5|&07Z6Dh387kByujOaM9^1sebW diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ER b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ER index 72073963ef3082dc64e7de61e716a0993fc3bcb6..5c256361f5059992bd51b96fefd3644575bd20c5 100644 GIT binary patch delta 20 bcmdnXw2z5%&07Z6Dh38d(~X=ajEoEbKr;l# delta 18 ZcmdnTw3mr<&07Z6Dh38dlZ~7vi~u&G1jPUV diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES index 81c67e2561e197ed8b9bfc4146861c54a0e06d01..17bf1857160df0381e5d879f74f825ca64b1742e 100644 GIT binary patch delta 20 bcmeBT?q=p(^Ok|Nih+T#X(MMNBO?OWNsEU02^HcApigX diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FI index 925e74014e69a48e7e1a974613a4a997cd06afb2..982c8dd4bcce5aed8ce8280115193eaf71fdde03 100644 GIT binary patch delta 50 zcmX@ddXrUs&07Z6Dh39o3k(bljEsy7;)XFP)h0TIhP5@(M!J@<5T3zC*^Nw$3;UIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FM index f3f36997b9790cb7d866b6a7315e9f65232ac4aa..f58dc40d2a70b06107def71aa481b7ea649fb263 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FO index 2d2ff182414b5f29cd26c9661acba5cb9539e46a..f6641dd59921ffedf0e5b5473e94ef502b7a721a 100644 GIT binary patch delta 20 bcmeBYp1{nx<}Cwj6$1lf`$o<-Mn(nzJqZO7 delta 18 ZcmbQh+|SIp<}Cwj6$1lf+eXedMgTJ81rGoK diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FR index 2b16deaae735e65d931b34cb61108e73073fc147..7a2adfd4ff7f0e240b56d862b792a64af51974d1 100644 GIT binary patch delta 20 ccmaFI{GOR}&07Z6Dh39|XB#=6GBPp%08cmujQ{`u delta 18 acmaFQ{EnG(&07Z6Dh39|ryDt+G6DcX8wQI2 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GA index f923cae53bf39100362c693a8441c94e6497808a..800c4f2e8a9b2c41702a3cc8c3a7c233ec7af386 100644 GIT binary patch delta 20 bcmZ3;vWSIq&07Z6Dh387$&H*6OpJ^GJ1YcU delta 18 ZcmZ3)vXF&y&07Z6Dh387iH)2ROaL-%1X}Hw} delta 14 Vcmdlkx=nP05C`Mp&B7dunE)kL1bF}e diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GD b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GD index f2e6c56f65c32924d7be7d47f538dc5f382a7ec6..b54ca62709591a486bcc9d7d6c6bfbb263268bee 100644 GIT binary patch delta 20 ccmaFD{FIq<&07Z6Dh39|I~zG~Gcqy&08LH?WdHyG delta 18 acmaFL{Dhfv&07Z6Dh39|+Z#D=GXelWfd*p$ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GE index 22f3da287bfa4dc656eced6793ca81811c8b92bd..f1941072690816e619b8d16446b21394283bd123 100644 GIT binary patch delta 20 ccmdnax`UN-&07Z6Dh39o^&2_YF)=a#07V1^w*UYD delta 18 acmdnNx}BAC&07Z6Dh39obsIU?F#!NMlLfT^ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GF index e82b26cf0c1679acaa8b0892f0ebdb516abfc63e..fd17d8d466778a438469ed071c0aad72ae76e9b2 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GG index ae3cec7c8620237c1a03619a68fe322502142176..7d246864479b3c51bec4d1833db06a8c4448db94 100644 GIT binary patch delta 20 bcmX@ga*Ty@&07Z6Dh387+l`zyOpFWwLJkD& delta 18 ZcmX@ca+HO0&07Z6Dh387n~j_{OaM4B1nU3* diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GH b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GH index 82ff8e468688e175d43f07286db7ad8705a9c228..3cf818d244cf4980609de7f25ef7395351facf5d 100644 GIT binary patch delta 20 ccmdnSyq%eI&07Z6Dh39|bsIU?GBPp%07QTVtpET3 delta 18 acmdnayp5T2&07Z6Dh39|wHrCtG6DcOBL%Af diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GI index 63a685fa4dc00443e858e66dec48902b21edd54b..6625331291159894b38d11f946ce4ef0a112e982 100644 GIT binary patch delta 20 bcmdnPw3mr<&07Z6Dh38dlZ~9ljEoEbKmr8A delta 18 ZcmdnXw1I delta 18 Zcmcb_bdia3&07Z6Dh38dkByuji~u>-1r-1Q diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GM index 27ce34fb107a74fdeb271bc60c24c7fbd95b435b..abef42bd927f851f3310d1049dbec3f01db18805 100644 GIT binary patch delta 20 bcmaFJ^oWUb&07Z6Dh39|$c>y4jEoEbM;8TG delta 18 ZcmaFF^pJ^j&07Z6Dh39|h>e^Pi~u}l1yuk5 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GN index dde6c5365735e3e44c96f59547c2d28e2d14d9b5..c865a17749570af9ff5698e9c33a40a66aa01fcb 100644 GIT binary patch delta 20 bcmZo>ZeiwJ^Ok|Nih+T#dLw5QBO?OM+$jEoEbO6vuu delta 18 Zcmeyy^p%No&07Z6Dh39|oQ<40i~v8H1*HH0 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GQ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GQ index c3bd13e57f6be8f03144abe646816e89f02809f8..a94a26e2ab20027caae156c6751620e9725e6985 100644 GIT binary patch delta 20 ccmZ3@yoQ-`&07Z6Dh39|#Tz*nF)}g$077L2fdBvi delta 18 acmZ3(yqcMF&07Z6Dh39|MH@L6F#-TLUR delta 18 acmdnXyoZ@{&07Z6Dh39|%^Nv4GXelQ83n@t diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GW b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GW index a755f364104d7093e51475b69acd3a2fb9623bf0..9ca22998101451e71231f1193a0dce4b10bb660c 100644 GIT binary patch delta 20 bcmZ3*w3>-?&07Z6Dh38drH!15jEoEbJdgx? delta 18 ZcmZ3@w2Fyy&07Z6Dh38d#f_Ybi~uv21bF}e diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GY index 10f48a72c02d9f2d68350a5c0831b2eaf23ef3e0..e6666f9979fb7b41cb5d855e02ac85e2abee1284 100644 GIT binary patch delta 16 YcmbQqIE#^O&07Z6@+lM9CNnYs04|>e5C8xG delta 14 WcmbQmIFpfW&07Z6^2rm~CIbK@eFY8x diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HK b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HK index 01b773d70fefcdac61768999018cd296418878cd..260696ba9df79a9673c83a961f3f9e271873dbc4 100644 GIT binary patch delta 20 ccmcb{e4Uwd&07Z6Dh39|a~nC&GBPp%07{?+EdT%j delta 18 acmcc4e2tlN&07Z6Dh39|vl}_jG6DcTLk24V diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HN index 502c311e1511b0822bd9bc736c64c0b6623bc97f..8aa38571b658b0f555eb07f78223199e10960fc8 100644 GIT binary patch delta 20 ccmcb>e36-R&07Z6Dh39|6B{{?Gcqy&07-fV6#xJL delta 18 acmcb}e1VyB&07Z6Dh39|;~P1TGXelTO$HMH diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HR index 3089e8b99416c2ef415eab049607f8df9ac0c85e..9766d56241d2ded32e1ad7a0c8daddd323a8d7c5 100644 GIT binary patch delta 20 bcmeyu_LYru&07Z6Dh3AToQ<5>%!~{GOJD`B delta 18 Zcmey$_Jxge&07Z6Dh3AT?2Vk+%m6?C1+4%8 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HT b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HT index 11abb56fb6805733b48cbc58b7ab169815365ae1..6d4d7b71f74fa1fcfc72d265b18d25e766fe1ede 100644 GIT binary patch delta 20 bcmX@lbb*O;&07Z6Dh38d_l=xxjEoEbL!|`| delta 18 Zcmcb>be@TG&07Z6Dh38dw~d@`i~u==1q}cI diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HU b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HU index 90009c01285450b558031df3935f426bdaf544e3..79efc3c79bf89c89739d04feefd7d36015dd1528 100644 GIT binary patch delta 20 ccmaFP{DPTt&07Z6Dh39|`x`m$F)}g$08QZraR2}S delta 18 acmaFC{G6F{&07Z6Dh39|dmB0LF#-TU{046T diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ID b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ID index 0c2803e31a18f00a52fbf3af3929fdbc4911511a..c2d6738e883cd400fa2e3471d724083548216010 100644 GIT binary patch delta 32 fcmZ3;v4~>>7mI{A10w^og@GlIG*B^QWPkwxRCEJy delta 31 fcmZ3)v5;c}7mK(U10w^og@GlIG*B^QWPkzyP}c)) diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IE index 706aeddd5d3c4fd7377e35fafe48ffa5aa42e5d3..bd1e9ed020abe80d3aa28f867746ae7b6bef337f 100644 GIT binary patch delta 15 WcmZ3=xr}oI7YpO;$=ocn7#RR0_yhF- delta 13 UcmZ3+xs-DQ7YpO8$=ocn038bh^8f$< diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IL b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IL index d39b391d89dd3863c08be795a582c296e18fed33..f784b0f8b2d360b3fe98b2e27701bba154991d1d 100644 GIT binary patch delta 20 bcmX@jc7}~}&07Z6Dh38-=Z&0B%!~{GLx%+m delta 18 ZcmX@ZcAAZI&07Z6Dh38-r;VIW%m6uV1qlEE diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IM index 30bb20ef1cc00ecae035df12ca6269fb07bebaa4..ab78e3a3750da51fc1a9f50f9d3b042abd1e8f21 100644 GIT binary patch delta 20 ccmeyu{FRw=&07Z6Dh39|Hyb%$Gcqy&08m~Ar2qf` delta 18 acmey${Dqlw&07Z6Dh39|*Bd!sGXelZ5eB0G diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IN index 60dd9da21222b63190a4df50c88739a2da773103..f8fafa942792fbc6f46c85c52254820d7681b226 100644 GIT binary patch delta 442 zcmZ`#K}rNM5S+o;b@Zqpd)%8YIFNMG$;69#@Z=9{@&^S$kVX&U3+C(}guVI&J^CIi z*#$2eNC;hB)m`;@^tO1v@1EPIlk>BPOSndiA5vBpgEtC?F>4Z+@=9I7BZ@9WfJwqw z%D$9YtynHhp_B!Hx}>AH+QJ*{>%K$z}En_7XDCr?H-$^ Wn=W?0T0h5Jq>#+b09XhjJB|htuX~MO$}>F^)C_ z$(q!dnNC(<73Bb_HI6p5m~6*tI=P)yj@iJ-Wb+wT1x9%fh-o#Z(WbgUMbT#FvC#%b zAf`pMfv(wPS$1u;P?#EsZ9vN`V>PiUm6*JcJ$JGvr`lvoj^(UX3=GUxn;&o(GqW>5 F003O(GuQwC diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IO index f15346f963093c9681d8be08d916f19f2a333906..3213c5ad6a9c98f4b2c0083732bda344a96f4fbc 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IQ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IQ index ab713bbe8ea5940b44414f289cf7eea02ff1426e..475492fe1dbbfe15ff4fc298c9b2c610ddb55264 100644 GIT binary patch delta 20 ccmdnVyo;H0&07Z6Dh39|jT<>PFfuX#07Vl8xc~qF delta 18 acmdnRypx%8&07Z6Dh39|4I4Q(FaiKMo&~o6 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IR index 35827c06664997565da3c5adfbf5e1cff4653646..a5b3394e96410a845f9e5f369d8fb632a1eb0910 100644 GIT binary patch delta 20 bcmaFB_K=Np&07Z6Dh3ATh>e`#%!~{GM~nqu delta 18 ZcmaFJ_JECZ&07Z6Dh3AT@Qs||%m6&g1zi9D diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IS b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IS index 233e357f349a465ed5064ce15180dd7aff7e2ecf..eb45cb4640d8649f79f15924158e55316873a45f 100644 GIT binary patch delta 20 bcmeBW?PKL!^Ok|Nih+Ttbt7jB6C(ovJo*I> delta 18 ZcmeBU?PcX$^Ok|Nih+TtWg}+`696*V1q}cI diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IT b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IT index 8c81e18d9e7b34b01d78f562f981d455d83b96d7..ae03581af25208ba88285de63796831f6087d1b7 100644 GIT binary patch delta 20 bcmeBR?_}p(^Ok|Nih+T-VIyZfGb1AaJXr+- delta 18 ZcmeBV?_lR#^Ok|Nih+T-ej{f+GXOGE1pfd4 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JE index 2e3c4d5dd1778260c6f048245ae794e6f82ca2cf..37dc706f12e7a1b42a0fe75ba13025bf36d6b799 100644 GIT binary patch delta 20 ccmZ3^x`LH+&07Z6Dh39o`5QUsF)=a#073KxcK`qY delta 18 acmZ3%x}24B&07Z6Dh39oc^f(BF#!NK0|j*e diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JM index 77c4efc804b6fa4d91ce5242a7bad094480391dd..eef5197ee5ff80f26cf68681434e14c50899f470 100644 GIT binary patch delta 20 bcmbQpGKqzA&07Z6Dh387&W)TLOpFWwI2r^U delta 18 ZcmbQlGLeOI&07Z6Dh387j*XlgOaL$41RDSV diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JO index 6c8e26589c3a93a115db3b1df8524b2be8e5d9ae..cc0d0913c4a60684ca3a3938224adafc6c9fcafe 100644 GIT binary patch delta 79 zcmZ3;GMj~S&07Z6Dh387p^2O_jOG*7=CQL|n8u`3n@#-Sr!H)vVQ*z diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JP b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JP index 9650864bb65388f3ebe687cc28c79f8938b2dc7a..4773220d5fcb7fc0c9cbeaff4114d638d0abd7f0 100644 GIT binary patch delta 20 ccmaE+{9Jj1i~!@Q$@>HxH^&KdFfuX#09Yai2mk;8 delta 18 acmaE^{7iX+i~!@w$@>HxH^&KdFaiKd3I_%N diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KE index bfd69a4b59959b68a2532dc05b9f64ccfdc80dd9..72d80a655ee8481db93cddf12da850d2afa47f32 100644 GIT binary patch delta 20 ccmX@ie1w^E&07Z6Dh39|-5WV~F)}g$07m@<;Q#;t delta 18 acmX@Ye3+SY&07Z6Dh39|T^l)fF#-TPI0fGT diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KG index 06d1f7d88c4e7efa5c3e52517be8259d64c4ad3a..c4e37cffe11ffc63f58e56118dfd4a6d29d024e7 100644 GIT binary patch delta 20 bcmcb{a-D^9&07Z6Dh387zm1%}OpFWwMNb7W delta 18 Zcmcc4a*c&^&07Z6Dh387-;JEUOaMCS1up;q diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KH b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KH index 0ddca187c0967987e7b3daa8cac77b10bec21aa2..f34f0eb1e7f09313e8c6929ca0ebfe50ab3d05a7 100644 GIT binary patch delta 20 ccmeyt{F9k;&07Z6Dh39|4;wk(Gcqy&08t_awEzGB delta 18 acmey#{DYZu&07Z6Dh39|_ZvCiGXelZwFa{Q diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KI index 377f39bb9245faed1229fa7cc4fa857666da7a11..2cf4365629b9ee88cc72f55e1375604ed1244d4e 100644 GIT binary patch delta 16 YcmbQiIFpfW&07Z6^2rm~CNVMq04{h13;+NC delta 14 WcmbQqID?UG&07Z6@<|ifCIJ8>UIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KM index a2d3de609d78addfb6991753b9682bf76c53a521..7c761435154f3c8e320f1252bf6e97045dd16975 100644 GIT binary patch delta 20 bcmbQmG@FTY&07Z6Dh38dp^cn^jEoEbIe-K^ delta 18 ZcmbQuG>eII&07Z6Dh38d!Ht}Pi~unQ1UUcz diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KN index 863b3eb33b54c39f49e97cae7173eaf7178c5333..746a95aa0bc1b6ce6ab7b88935e9f2bdf99ebfb6 100644 GIT binary patch delta 20 ccmZ3)yqKAD&07Z6Dh39|SsOWLGBPp%06?q-T>t<8 delta 18 acmZ3?yoi}|&07Z6Dh39|nHxE0G6DcK?*&@` diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KP b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KP index eccdf9e392a1f3282a3b38c41456d683464a7cfe..dbc742e48e3bcd31e9dbc50ec3b11dcf9ebd99ff 100644 GIT binary patch delta 16 YcmbQiIFpfW&07Z6^2rm~CNVMq04{h13;+NC delta 14 WcmbQqID?UG&07Z6@<|ifCIJ8>UIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KR index e66f15795f145fd34fd7e0714b63f7ae4b0c9472..f74cb4dbfba6e4dc64db905c4cfec8e91cfad6ff 100644 GIT binary patch delta 16 XcmZ3$vyf*4FAJmaWgs5A_)|f;a=o*{q0$HY( znl&asX``5w8slgKLt|ZYsQkpu+Co6VXk(LDAY~eD2oyInocKn8(R4B|W2`AygP{?^ z7*n7z(MHA~)j;zNjZDmREkG6kb!pa^LF|}3jWGbI{~4o>kbyZ+$N;3!)Eua%+NgGN zAd|cpBLf?dV`xyz$iQW8ZfIa&U} delta 281 zcmaKnF-`V#_u*^0S17;?H54xNl@5S4d)DBrl*&R+FU3HA!V z(oRgIp8b@9Zj(?AGPWQ8bme)HU$g7VO|!a?Q4hloq1A2%9ge-BpqbWjnVaXnxxYiu NqW{(Q|6I-&mp_->Lk$1` diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LA index 984aeba233d97c7b439f017c6e226ac2eabcc5f2..7f78cb8e11e86e522c73a4e15770fdc88d97998a 100644 GIT binary patch delta 20 bcmZo??qKFz^Ok|Nih+T#ej{fcBO?OJoG6DcR`vwaD diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LI index 37693c56691858097e4534b46831ecddc309da3e..e7921499b43cc516d432884c0d56ffe25c88fdb2 100644 GIT binary patch delta 20 ccmaFO`i7Nr&07Z6Dh39o#~V2xF)=a#08aP@hX4Qo delta 18 acmaFE`kIw<&07Z6Dh39oM;kdGF#!NU=LUrU diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LK b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LK index 4092102ba51a44a8fdc53c9198e526c57d217cdf..2b06a386f1a9ec4a42d81c6a43273d6cb4b4260a 100644 GIT binary patch delta 20 bcmeBX?qTL!^Ok|Nih+T#c_U{NBO?OP1XKV3 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LV b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LV index 631d6f20ca16ff4bb211021b7ac8e6cb45d6e036..80c3aa3da4109e5996072d570d54943052900cf2 100644 GIT binary patch delta 20 bcmZ3>w2p~$&07Z6Dh38d)s37gjEoEbJtG8% delta 18 ZcmZ3-w3dl;&07Z6Dh38dm5rP#i~uwe1cd+q diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LY index 6fb9f25d6c3878094a58ce7f91c95e4998a7ca86..0873564e789aba2ef7caf8b388cbd5ece5b90bfe 100644 GIT binary patch delta 20 bcmdnSw4I4_&07Z6Dh38dy^Wl@jEoEbKHLPW delta 18 Zcmdnaw2g^#&07Z6Dh38d-Hn{Oi~u!*1gQW3 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MA index bf696988079dea699289f4bb639ec068664e1e8e..dd0beb566f8d1aad17376e1c754431f0e7b7e582 100644 GIT binary patch delta 20 ccmX@jdWMyA&07Z6Dh39o!y7pdF)=a#07%#d2LJ#7 delta 18 acmX@ZdYYAU&07Z6Dh39oLmN2{F#!NP#|8xe diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MC b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MC index 61e560f2264cc8dac9cbd9d6cac61e20c6f66512..1a80b905ea231d80d792e9187b94474abc833b7d 100644 GIT binary patch delta 20 ccmX@Xe3F@S&07Z6Dh39|0~ delta 18 acmX@fe1e&C&07Z6Dh39|{Tn&=GXelS1qJf} diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MD b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MD index edc5d0f856f834d2488712e34d87e7426b78722b..17917ffed9d250e7dbd7134a54d04455d55a11b1 100644 GIT binary patch delta 20 bcmZ3+vYdr;&07Z6Dh387xs9B%OpFWwJRbyc delta 18 ZcmZ3^vW$gu&07Z6Dh387*^QjCOaL=F1aANU diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ME b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ME index 056305b5580202562aed1b1552e5a27e2f837a8c..352802e92c290d9b8ab8f4dd0342becc59c002ed 100644 GIT binary patch literal 650 zcmZ8eOHKnZ40WceiUbmDy06e6O{5~_?}QCv!4fWz4y&Gmrbyg}t8oWj(lUk4jAGBT z-?L+XebfA%sQV-$Ap~7zbDze|cE{_u7qoyE)@hFzy$z2KMj;-@V&PYp$D*_K)tYPr zjLi;zvbaNrZ5hTPB#UpDJ3t2t$5BcY@l&x{_QEP-oezw%F@R;wW?OP>otb@MKv|&? zpsD&6O&1^rh-`xHC>YT_1Oo?SlG62xQK9w9-PNQyY^wJC%~7k!QJpas%ystvGTE?Ix;8jzQ}^fvlcgolQbq$90kj_i0H>4< AzyJUM diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MF index 29c214b0b4140dc6206ca34cbd08bbd7ca11fe4d..2daec61e7d98698d2d8256a9a0056e36f643cb2a 100644 GIT binary patch delta 20 bcmbQnG@Xfa&07Z6Dh38dzKxu`jEoEbIJ^Wa delta 18 ZcmbQvG>wUK&07Z6Dh38d-i@5Ri~ulW1StRj diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MG index b0c8bf218cf515e6f4f7933844eb73bfc7e42841..7eef113edc21d9b11c2910ab609fdf5cdb215c4f 100644 GIT binary patch delta 20 bcmey!^ofac&07Z6Dh39|%#EBGjEoEbN+$)E delta 18 Zcmeyw^pS~k&07Z6Dh39|jE$Tbi~v6N1(g5* diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MH b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MH index 131f1980e27aa5a83afbea4e08947442467ca170..2df3a70c91e889a24c7151334fb71f11b0e51c3e 100644 GIT binary patch delta 16 YcmbQqIE#^O&07Z6@+lM9CNnYs04|>e5C8xG delta 14 WcmbQmIFpfW&07Z6^2rm~CIbK@eFY8x diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MK b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MK index 9b94a61ce554acef996fb69619f28e0fbe2e546a..040a7919a7f8d1c72a2a55a045f6f9d895732eab 100644 GIT binary patch delta 20 bcmX@Xa*~B}&07Z6Dh387hmD-}OpFWwLZJlt delta 18 ZcmX@fa)O0(&07Z6Dh387`;DCTOaM5n1or>{ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ML b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ML index d1efd0f24eb0d1f5c95990a48b289eb168387527..c7d6d187d1bee0a9e9915a7b3ed051940c573cae 100644 GIT binary patch delta 20 ccmbQwynvZ=&07Z6Dh39|=^HtxF)}g$06-Z9Q2+n{ delta 18 acmZ3$JfE3!&07Z6Dh39|X&X7GF#-TJbOlcU diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MM index 8c3505974930d70155f00db11e25c2d67346f50b..fbe65bcd22da51a70a39bf4ddc77952a407e7323 100644 GIT binary patch delta 20 bcmX@Xa*~B}&07Z6Dh387hmD-}OpFWwLZJlt delta 18 ZcmX@fa)O0(&07Z6Dh387`;DCTOaM5n1or>{ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MN index 0d76175c1de651f4673b07b86656880798faf632..ebbcc6cd5a68de02fc54272c4eb7ae71139dc97d 100644 GIT binary patch delta 20 ccmdnQx|x-8&07Z6Dh39oRU0{1GBGj$07MT3qW}N^ delta 18 acmdnYx`~x@&07Z6Dh39ol^Z!%G64WM#s#4O diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MO index a72a4bcc2af79f4f89f88775797365af7600ecdb..d0bb6aeb6f043b6cbb613520ae92593d1212275e 100644 GIT binary patch delta 20 bcmbQsG>?gM&07Z6Dh38d(T$uUjEoEbIuis( delta 18 ZcmbQoG?$5U&07Z6Dh38dk&T=pi~uo$1VsP< diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MP b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MP index 312659b090d71655f55ad30a71e990a3989b115c..7b51d36ac8fa97ce93367ed76cadc406113dd953 100644 GIT binary patch delta 20 ccmX@de4d$e&07Z6Dh39|V;eb-GBPp%07)1I4FCWD delta 18 acmX@le2$rO&07Z6Dh39|qZ>JoG6DcR`vwaD diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MQ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MQ index 6a495d763caa167e5c1f0b09ed3280671c3b696a..0c29b3d81854043b6494a6f2527014a023e67765 100644 GIT binary patch delta 16 YcmbQiIFpfW&07Z6^2rm~CNVMq04{h13;+NC delta 14 WcmbQqID?UG&07Z6@<|ifCIJ8>UIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MR index fd21ea71e720d6cd85075d8e223a5dbfe846fde7..dd9fa9e822b0f0c373d11b99b15112f617c79ab4 100644 GIT binary patch delta 20 ccmeyz{GXX~&07Z6Dh39|ZyPzkGBPp%08&T>%>V!Z delta 18 acmey*{EwM)&07Z6Dh39|uNyhPG6DcZs|L#e diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MS b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MS index c1ad3b365badb365004914e00781142603eb6ba7..b31c305a5ca4d33e1d1dcc8fc3f525736e6499fb 100644 GIT binary patch delta 20 bcmaFH^qh%v&07Z6Dh39|xQ(2#jEoEbNDKvQ delta 18 ZcmaFP^o)sf&07Z6Dh39|*o~aAi~v0|1!({P diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MT b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MT index 9dcbbbf657fc13b092ea4484d145439cba15c4b3..e4ef74a9a7c960cf23d1aba6d2e0da47c400cb8a 100644 GIT binary patch delta 20 ccmZ3(yq1}B&07Z6Dh39|B^x;xGcqy&078}pg#Z8m delta 18 acmZ3>yoQ-`&07Z6Dh39|#Tz*nGXelNi3NiI diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MU b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MU index a65c8e32707abf551953439c76b4d43fe9d21f35..cde515f3407b8f7a42cc8d2515a823b6d52c3874 100644 GIT binary patch delta 20 ccmdnNypx%8&07Z6Dh39|4I4SvGcqy&07T*iwEzGB delta 18 acmdnVyn~r@&07Z6Dh39|^&2_YGXelPbp^8k diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MV b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MV index 49e9b28b0b4166302c49b131a1b52c7d1b496dac..cef8e087fca652759783482f5661ed694c0d1cbf 100644 GIT binary patch literal 466 zcmZvYu};J=42GSa3Wb3UF(KWM;UZDVY1*WP0r3FbcuVNUQ$X@YJOnEb!#nWDoKSQk zL+sd}|JeTcruL0UeGx9D=r%eZ)|c0JpVP8?yk~|Va*~Kq)RpI*#DL6=(OGHVXK{JY%t}Kmk;R& DMpjr$ delta 154 zcmcb_{EW$H&07Z6Dh39|SOy@$$jHDQZER+485@&QZC1<3zzU?zYk?9BrW*EE#z1Uf zFwslZNmCOjVFFjc$iQx9ZeVC+YywoN22^DZ#L*CQYAm7+jC3tyHES%R&46@F3Rv&N crAiaON=*Ek&B!=8kx`15fe~mw&<$V!0NkY`TmS$7 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MW b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MW index 4529ee137e82000332d5a89d9de58c8e59ae5f66..36fe6c9811862c330240a3c173d1bb1523320b0d 100644 GIT binary patch delta 20 ccmeyv{Fj+?&07Z6Dh39|FB>^OGcqy&08!=!#Q*>R delta 18 acmey%{D+xy&07Z6Dh39|&l@>EGXelaSq8%Z diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MX b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MX index c857d1de51ae881a47beec17d9bb138733e08299..15746f77780332956a0d76828b4e1cc50642e3c3 100644 GIT binary patch delta 16 XcmaFP`+|1^FAL+X&3r63nHU)WH6;Zn delta 14 VcmaFC`UIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NE index 05e12c30e496efe012cb47f6cae8248cb4a81b83..62309e52ca73713199bcb19e5cbc6da66748f691 100644 GIT binary patch delta 20 ccmX@ke1e&C&07Z6Dh39|{Tn&=F)}g&07t?F@&Et; delta 18 acmX@Xe4Lqc&07Z6Dh39|eH%IVF#-TP+y(Cd diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NF index e4ef5e8fe6a261845267a523c4d19a58cffe9e82..ab792748002839a237accbf162e657d8b582b72a 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NG index 09939ff5dd08c38f482140b719476a60b016f82a..4e12b3693ad3f3236210a898be1c92e8e8050e1a 100644 GIT binary patch delta 20 bcmX@ic7%;{&07Z6Dh38->y4aN%!~{GLH`8n delta 18 ZcmX@Yc9@NG&07Z6Dh38-tBssi%m6qh1nB?( diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NI index 5eb33fe7c58d1e87d92376fe67a67628a6bb8c2c..437f7d196e9914841f40dcf1941b3e3f68288c43 100644 GIT binary patch delta 16 YcmbQiIFpfW&07Z6^2rm~CNVMq04{h13;+NC delta 14 WcmbQqID?UG&07Z6@<|ifCIJ8>UIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NL b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NL index 79c874169a50b2e79947d4f8d48d65dfa4fc71d9..f0a7b3062c3119ba0fc8d5435c99135a057e975f 100644 GIT binary patch delta 20 bcmaFM@{Wab&07Z6Dh39o)Qy}eOpFWwNwx)z delta 18 ZcmaFI@|J~j&07Z6Dh39ol#QGzOaMNa1&aUx diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NO index de77f88cd6f4c71c334f9fc6fc0d3cea187e2df2..b258badd93558da37029f1644bf59ff77ebe18ad 100644 GIT binary patch delta 20 bcmdnWvWUIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NU b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NU index d33aa7a2feecff99f124f1769f15ebfc1489332e..ac5a701f423944d5a608677f67e9e3b50d374a45 100644 GIT binary patch delta 16 Ycmcb{c%6}L&07Z6@{1GME-*3x05|Fe1ONa4 delta 14 Wcmcc4c#V;5&07Z6@(UB$E&u>4;06K! diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NZ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NZ index 20dc762bb83aa335dd285d65324cd680014bb5d0..199e3c2107383c045b8d138d150306db1ef450a3 100644 GIT binary patch delta 20 bcmZo-Yi8qI^Ok|Nih+UY*GA5tOpFWwK!XM4 delta 18 ZcmZo>YhvSE^Ok|Nih+UY=SI$-OaL^t1>*n! diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_OM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_OM index aa0e794f386f4c001ecc6489d3dc933424665f59..a3ce6c1089ab5ac105ea7fc7744b2a8ce5b28881 100644 GIT binary patch delta 20 bcmbQpJc*fe&07Z6Dh39|&W)TMjEoEbJ!=IS delta 18 ZcmbQlJdv4m&07Z6Dh39|j*Xlhi~ut>1s4DS diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PA index c8c2c769dc4b134b9672f8a31151433680a79199..ed88608192c02d9690f7fb556e5bc593b25691f6 100644 GIT binary patch delta 16 YcmbQiIFpfW&07Z6^2rm~CNVMq04{h13;+NC delta 14 WcmbQqID?UG&07Z6@<|ifCIJ8>UIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PE index 45de89dbf3c1c0a666bc453326cab70c27cf7a4a..6f97174c4750c2515e55ff38bf97f1cf911b906f 100644 GIT binary patch delta 20 ccmbQwynvZ=&07Z6Dh39|=^HtxF)}g$06-Z9Q2+n{ delta 18 acmZ3$JfE3!&07Z6Dh39|X&X7GF#-TJbOlcU diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PF index 30924a4ef8a4b7cdfff32e67e2b4d2707e790547..bbdd91bf8deddd0052a7974675a19e5929a9de9b 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PG index 067b4997cb4473471122c80c81588a33b0024bbc..767f47cabaffb2023e5668fab0bf8ffa891f2753 100644 GIT binary patch delta 20 ccmdnRyqlSG&07Z6Dh39|O&d8kGBPp%07XOvy#N3J delta 18 acmdnZyo;H0&07Z6Dh39|jT<>PG6DcO#|66p diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PH b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PH index 5810c29790d03c82aea50a58e0d4faa6d3c5b0a6..8eb72c8f23dc128b22b61c509d08dcb10fadebaf 100644 GIT binary patch delta 20 ccmdnVzKfl6&07Z6Dh3ATjT<>PFf%d$07bb4#Q*>R delta 18 acmdnRzLTAE&07Z6Dh3AT4I4Q(FarQOECs^= diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PK b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PK index a7a82f77099b16911ca79322d1de99e4e4450b8b..1c37c1c4138f0c6da01d4c338090d4565b4411bb 100644 GIT binary patch delta 20 ccmdnPyO(zZFAL-P$rqT_Hk+_?FflR!07^3k2LJ#7 delta 18 acmdnXyN7oJFAL+k$rqT_Hk+_?FaZEQ9R>ve diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PL b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PL index 2d51c348def9a6eabaab7e5266f33d34a5df38d3..012f5b7debfb17ad0121dd91a787741a86e90312 100644 GIT binary patch delta 20 bcmX@fa*Bm>&07Z6Dh387$Bmp0OpFWwLed2N delta 18 ZcmX@ba*~B}&07Z6Dh387hmD*LOaM651p5F0 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PM index e645cd2b010b4d1a7c3b7a416aef0ccbf909e4ef..00414182919acdad5e49da29bc80c18841403714 100644 GIT binary patch delta 16 YcmbQiIFpfW&07Z6^2rm~CNVMq04{h13;+NC delta 14 WcmbQqID?UG&07Z6@<|ifCIJ8>UIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PR index 335b318e83e4e82b5d904d1c46b8a6a6c1a75232..7adcde065e5417c3af065061663ac2b9a0126389 100644 GIT binary patch delta 20 bcmZo*Ze-?M^Ok|Nih+T#Vk2icBO?Oe36-R&07Z6Dh39|6B{{?Gcqy&07-fV6#xJL delta 18 acmcb}e1VyB&07Z6Dh39|;~P1TGXelTO$HMH diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PW b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PW index d65d876a58ce9d1bfb16ed5234c2f1ec3adcf40e..1b99676f02d75c6d63224013febae941ef4bb181 100644 GIT binary patch delta 16 XcmbQtIE9gI&07Z6^1g{|y^IV1Ewu#r delta 14 VcmbQjIGK@c&07Z6^4^JTy#OP_1oi*` diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PY index 07354365feae2d993a615b84f6b0b19563c506e4..ab59e417641dafdd8fa27092b184fb432a1938c6 100644 GIT binary patch delta 16 YcmbQqIE#^O&07Z6@+lM9CNnYs04|>e5C8xG delta 14 WcmbQmIFpfW&07Z6^2rm~CIbK@eFY8x diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_QA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_QA index 4717ebd1fc3aa4c61ad8891e3749b5ac7ba56b70..da69ee2916a967cc5843433a8dd1150c9cb91027 100644 GIT binary patch delta 20 bcmcc4bc2a=&07Z6Dh38d|Bak}jEoEbMJ)v{ delta 18 Zcmcb?be)NF&07Z6Dh38dzm1%Ji~u^!1uXyo diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RE index fa0ccb45d8851e8385cfddfdf71c1c9cf806a6aa..0a282a451498fa336d869ddece920f8cab520daf 100644 GIT binary patch delta 20 bcmbQlJeiqu&07Z6Dh39|u8o|XjEoEbJ)8v{ delta 18 ZcmbQtJc*fe&07Z6Dh39|&W)U%i~uuV1sebW diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RO index 595878ed5891588afc860e954981f26de26f8b15..d45708ae092898b8e1eb3721dd2815f5cfecdf74 100644 GIT binary patch delta 20 ccmX@ge2kfM&07Z6Dh39|y&F0AFfuX#07qX1=>Px# delta 18 acmX@ce3Y4U&07Z6Dh39|JsUaqFaiKOiUsEY diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RS b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RS index cc359b110f941c2a77a9b0c27272068029a1562a..6f97714be6676a7930b30cdc06b5f87a885e3db7 100644 GIT binary patch delta 20 bcmZ3=vW$gu&07Z6Dh387*^QhsOpFWwJMIK+ delta 18 ZcmZ3+vXq5$&07Z6Dh387nT?z>OaLqRq@>C;wwq7H0vm7#Y|s6f{%}H5nPefROS;%OpFWwMdAfL delta 18 Zcmcb`a+8H~&07Z6Dh39ofQ_61OaMD&1v>x$ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SB b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SB index 464b8ec69c932050f7d96229347b95b5c4d9d221..a640f688202e42c6f986252f11aafed90e71a27a 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SC b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SC index 3d74da04d4dc6d0a979cec034350d2a62e9dd510..64ab38bccc6f30b8b8da0d2c6b9fc43b3515b336 100644 GIT binary patch delta 20 bcmaFQ@_~hO&07Z6Dh39o^o^WpOpFWwN*D!| delta 18 Zcmeys@}7lr&07Z6Dh39ow2ho;OaMOX1(N^( diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SD b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SD index 34968f0ad5f861caf379de5efdcf5b062f28f707..37871a15b75431adef7f23c3ed650d9a9e3352fb 100644 GIT binary patch delta 20 bcmZ3^w1SCq&07Z6Dh38d`Hh@%jEoEbJN*Q2 delta 18 ZcmZ3%w48}^&07Z6Dh38dxs9B1i~utn1Z@BS diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SE index fb42a83c2752bb34dc36185bb067e4071e2b06a8..2c438131b2601f40316d5b18dfaa9e8b7648d9a3 100644 GIT binary patch delta 15 Wcmew;_(^aBKL_KZ$pRb?85saET?IV= delta 13 Ucmew)_)%~JKL_K($pRb?0Vd!DI{*Lx diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SG index 9071c3f4b866e7316efb15e0d72aaa25184d8d08..6020eb319d6c575c4293c4bed69cf23b3d907299 100644 GIT binary patch delta 20 bcmZ3_vVnzj&07Z6Dh387^^KfrOpFWwJ=g@5 delta 18 ZcmdnMvYv%=&07Z6Dh387wT+x=OaL^i1d{*& diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SH b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SH index c52c527eab2de9a66d9ff94758dc2e4a44ef7d24..e928407b4d65b2cf03bd024710076a910188015c 100644 GIT binary patch delta 16 Ycmey!_=%Bi&07Z6@;4LNUNbTP06Yfqxq&07Z6^4AmDUIPFxB?fK) diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SI index 927774b1e4c5a04bd51ae9b7118866da1aa74ff3..b9df92b7806335d9129b7f846c48dd64373c54c1 100644 GIT binary patch delta 20 bcmeBYoxsYu<}Cwj6$1lP`$o<-CPoGTJzNDB delta 18 ZcmbQh+Rw_l<}Cwj6$1lP+eXedCIB-l1r-1Q diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SK b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SK index b755b5cafa6f6fd95a288ba3a4578709c6eafe5f..50b4e3a5ca85eba87634ba499892adb26e57829f 100644 GIT binary patch delta 20 bcmZ3+vYdr;&07Z6Dh387xs9B%OpFWwJRbyc delta 18 ZcmZ3^vW$gu&07Z6Dh387*^QjCOaL=F1aANU diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SL b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SL index c3fd293ff002fa56ee7ba2d5682d4c19562948b3..5ab84328f2b5a8ffb63e190f423e1bb8abecfb2f 100644 GIT binary patch delta 20 bcmX@ebcl&_&07Z6Dh38d%Z;2CjEoEbK=%aK delta 18 ZcmX@abdZU2&07Z6Dh38di;bKXi~u)A1l0fl diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SM index ea97ce14efcd974fab65b487ec25d749fd43203e..4892c602a3bde0690bca6b8c19d08d76b0989fa1 100644 GIT binary patch delta 20 bcmX@ka)O0(&07Z6Dh387`;DA-OpJ^GLU9E4 delta 18 ZcmX@Xa-4;8&07Z6Dh387yN#T7OaM581oHp@ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SN index 535afa3541aab13d491c5d882ead1939cb00826e..095a4940232cfdd6d64c80fe7fbae7d2b915e6e3 100644 GIT binary patch delta 20 ccmX@Ze3qGW&07Z6Dh39|BO5snGcqy&07$k51poj5 delta 18 acmX@he1@5G&07Z6Dh39|!y7pdGXelSsRjc8 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SO index 334be741e0e005de981d270e293d42f9cc4c8c41..2db94507ca689f4700fc0420e07c262f0c85e49a 100644 GIT binary patch delta 20 bcmX@dbe@TG&07Z6Dh38dw~d^xjEoEbLv#fT delta 18 ZcmX@lbdHI0&07Z6Dh38d*NvR6i~u=X1qlEE diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SR index b563d07d2aa55171f9c0ea0b462ad6570d06204f..c1dc5a1e7d5558572a7ff9460b389cb451887081 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ST b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ST index 29b7d364448371d0a02039127312a97325ec8b34..9a8a7ecb72ee9a41a81a04dc8ac7715a3c93353d 100644 GIT binary patch delta 16 Ycmeyx_?wY!&07Z6@~;!wzA!QX06k^~lmGw# delta 14 Wcmey(_=}Nk&07Z6@-GwFz5oC)JO+{g diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SV b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SV index 0a299cfa5842d3317495971549f4599d66ad2256..0fc9f706a8a1625822216a6b48281301b98f1a10 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SY index 9c547de491f475cb62430145e17d60d4fc55e86f..2863ef19e2192e1f4239448c3079adcb7d898883 100644 GIT binary patch delta 20 ccmdnMypfr6&07Z6Dh39|6&pF1Gcqy&07F^@l>h($ delta 18 acmdnUyn&f>&07Z6Dh39|UIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TG index d6b9654534c7ef16617b7009b02dc17e516d24ac..523c84b3cf0ea4eea8186804a966038dede91049 100644 GIT binary patch delta 20 bcmdnVw2O&z&07Z6Dh38d!;PEX9i~u$M1hoJF diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TH b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TH index e7f2c336ab8df5029819afe1daeff0e1e9ff182a..119af7deca1d7507b4d0f706c2ad11d2e36bee3d 100644 GIT binary patch delta 20 bcmbQqGK+&07Z6Dh387$BmqhOaM6k1pfd4 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TK b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TK index 653d606513f619c4e753c17d988a70a9188f4178..87012f49c3da4999476d12023731ed30bd53586a 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TL b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TL index 8b4378c53bbb8a3932a96265bf0dd672c8cf281e..3e96e1801dbbf268eb71f357552f234afb38f5fb 100644 GIT binary patch delta 20 bcmX@jbcTs@&07Z6Dh38d=Z&0BjEoEbLg57e delta 18 ZcmX@Zbef5C&07Z6Dh38dr;VIWi~u;`1pNR2 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TM index c3c8de1c72fc8d28c5a776ca4a08b09b314942bb..b3b4ad8cf2fcdfdde3b46f65f2cae1aa70cbcbbe 100644 GIT binary patch delta 20 bcmdnWw2g^#&07Z6Dh38d-Hn_&jEoEbKC1+$ delta 18 ZcmdnSw3Uf-&07Z6Dh38dosFD2i~u!S1f>7~ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TN index b9ffbfd444b419a329bb6f3e04df23ce9a0b2d14..7a24c419aa69b1c67d8d5bf451e4117f1b7e1d1d 100644 GIT binary patch delta 20 bcmdnUw26sx&07Z6Dh38d&5fKIjEoEbJ?8|M delta 18 ZcmdnQw2_H(&07Z6Dh38djg6cdi~uyY1eE{) diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TO index 4497b3f4264e5553bcfabe98654e2d1fd55f55c0..10728f3131dd54ab84ff4dd12d313211ed587b02 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TR index 0d20cbb59cf1eac18e282009dca063ec24b47a55..32b88e1b39247be573cd28c32601fa8cdb3183f5 100644 GIT binary patch delta 20 bcmbQrI*pZc&07Z6Dh39o-i@3+OpFWwK7s`= delta 18 ZcmbQnI+c}k&07Z6Dh39oo{gM6OaL??1uXyo diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TT b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TT index bdbaf96cd5e1443e989ee45a8c7e234fd3c96c37..ddbdfc6af36a3476d8e5277bef391e6a098a1f9f 100644 GIT binary patch delta 53 zcmeyz+{D7U<}Cwj6$1m~&xxE0vVIn378>?eMnG&}SYs4zsB03dSz`v`n%8V}-p$C! F005K~4od(4 delta 48 zcmZo-`Nzz;<}Cwj6$1m~*NL18Qr;G378>?eMnG&}SYs4zsB03dSz`v|Zgktt2mnna B4PXEO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TV b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TV index 8cf631d5186f1731ff3bcb3e3fe3d1eb3d1beeb2..792d2973f42e3c3be6fed17a6bb1aeaa4eea896b 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TW b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TW index 63963cf5113e85046f2b8a5d5e490a1ba32ca157..08b417295d25c1ab7a482983eacb57f152e484ec 100644 GIT binary patch delta 20 ccmbQkJeQes&07Z6Dh39|DH}N_Gcqy&06&HWMF0Q* delta 18 acmbQsJcpTc&07Z6Dh39|$s0K*GXelK`2|A& diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TZ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TZ index 0f99acbf5b9c0f0ed3b75339469f4fc3c81f88ab..b5c29afddae5436b042b214d31f0658f2593a292 100644 GIT binary patch delta 20 ccmey({D+xy&07Z6Dh39|&l@>EF)}g$08zCD!2kdN delta 18 acmeyv{F|9`&07Z6Dh39|Pa8QuF#-TYFb2N> diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UA index a5d2806401f5a77e17c907d29fdb7d32b0913c10..f74e132aeeae8942dc081450e025272ca1376ffc 100644 GIT binary patch delta 26 bcmbQuF^6LV7mJXfCL;s0fr=p`0}KEFJNg3L delta 25 bcmbQkF`Hup7mJ{PCL;s0fr=p`0~7!NIQ;_J diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UG index 4eb5563f8c63982d2f41ded6c528007984176108..7ce2b578dc71ec8e9d74d2b72ae9bb0e4652e70b 100644 GIT binary patch delta 20 bcmeBS>1E+u^Ok|Nih+TNWg{mu6C(ovHzfoK delta 18 ZcmeBW>0#kq^Ok|Nih+TNc_Sw?696v|1P1^B diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_US b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_US index 25b36680c22856e4b7089d4f9930e9b7e9caee6a..03d97c8fc21b44eaa67847a8a9e8825b95e1c64d 100644 GIT binary patch delta 16 XcmZ3UIhvO diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UZ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UZ index 2a307b35d7b2003adeeec469ecca63ea6dd3455c..05c68545c28fa08231fd1bf4d1d736bf7e585527 100644 GIT binary patch delta 20 bcmX@WbdZU2&07Z6Dh38di;bM-jEoEbK*j{q delta 18 ZcmX@ebbyI-&07Z6Dh38d^NpP5i~u(s1knHh diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VA index a0be427a7bccd2b4d627d8476b832b2466f94d1a..0b7f9eed68dad06b54a7fdf84c660e71557d7b81 100644 GIT binary patch delta 16 Ycmey$_>GZm&07Z6@(&Z)-ZL@+06e4yfdBvi delta 14 Wcmeyy_?3}u&07Z6^7j+j-U9$Hp$2{c diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VC b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VC index ab0438382ae7f0668fa18129b73c10a2db836888..9d28676dc9065aebc9c8d521caac4292faa2cb75 100644 GIT binary patch delta 20 ccmeyt{F9k;&07Z6Dh39|4;wk(Gcqy&08t_awEzGB delta 18 acmey#{DYZu&07Z6Dh39|_ZvCiGXelZwFa{Q diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VE index 96b653fcbf5ed8f6a0180ebe5ca68ab80dc2b324..1db719685cfb9724d19285a2ca5dbd98e569b595 100644 GIT binary patch delta 20 bcmbQhJdv4m&07Z6Dh39|j*Xn{jEoEbJvs#y delta 18 ZcmbQpJb{^W&07Z6Dh39|_KlqFi~utY1rq=O diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VG b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VG index e7d7db703654e778ed50f8481a8f3faf1002ffcb..6d1fbe29a3badb76167f10d220b9f42cee774998 100644 GIT binary patch delta 20 ccmaFK{EC@#&07Z6Dh39|hZ{K`FfuX#08T>&c>n+a delta 18 acmaFG{F0e-&07Z6Dh39|2OBvbFaiKUP6l@X diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VI index 88428e8cadd355d0cb26850bac04f0cf5db6b345..fd9447d9080d0090ce736df2bf8da051211d8a5f 100644 GIT binary patch delta 20 bcmey*+`z)Q<}Cwj6$1m~_l=z27#SG=Ns0zi delta 18 ZcmZo*`OnO`<}Cwj6$1m~w~d_N7y&!w22cP1 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VN index a46320719d0a61037f8f9f3b72719fb0e67ccdb4..6f2b378b97f203082532f7badff80670299c4383 100644 GIT binary patch delta 20 ccmdnRzMGwM&07Z6Dh3ATO&d8kGBYv&07dEr$p8QV delta 18 acmdnZzKfl6&07Z6Dh3ATjT<>PG6MiQRRzZY diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VU b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VU index a79ddef1752ff685a6c720c673ddba4e5d60096e..2c79ade13862f3549743637034331cb95e9192d7 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_WF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_WF index 423e86d3fa66a31d91a1c2a5a280a4ae409b119a..43f11626140982fbe03d9a2ec03298feb2fb100a 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_WS b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_WS index 52fd0e7db6c10a1e3ad3ad1f8b51fb2efa98b744..9022baaaa4f77e96b62ab7c66d89e5afd45b0878 100644 GIT binary patch delta 20 bcmey)^n;0W&07Z6Dh39|{EeJ>jEoEbOHBo@ delta 18 Zcmeyt^qq-w&07Z6Dh39|yp5cBi~v9E1+4%8 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_YE b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_YE index e4e2e7874b3357948517c1f92f75b9ba003bbb3e..b18ec98b4ec37586623afb1673c77b714485781c 100644 GIT binary patch delta 20 ccmZ3+yquYH&07Z6Dh39|c^f(BGBPp%06}mCZ2$lO delta 18 acmZ3^yo{N1&07Z6Dh39|xf?m>G6DcLlLc!4 diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_YT b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_YT index 5d3b0f98af560db03327786980329ee55ae88720..ae7df495fca12f279204961fc49fbbcc011570e5 100644 GIT binary patch delta 16 XcmZo+YGqFfuX#08h&XnE(I) delta 18 acmeyw{E?Y+&07Z6Dh39|7aKWWFaiKVmIjvq diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZM index 99c815290638c0fa945d2e2c317067306acfc7cb..2b341abb2304c33372046617dee47d1890243af3 100644 GIT binary patch delta 20 bcmaFG^qPrt&07Z6Dh39|q>Y@3jEoEbNYDj) delta 18 ZcmaFO^oogd&07Z6Dh39|#EqPZi~v2?1$h7f diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZW b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ZW index 13aa7286e7685f0af08b0e4df0fba305c8e31000..45b6bc1db162c63794ad91da5d7b0cf25a9deadd 100644 GIT binary patch delta 16 XcmZqUY3JF%%fk3`Gat(jMn(nzD;xx% delta 14 VcmZqYY2(?z%fk3$Gat(jMgSq$1fBo@ diff --git a/java/test/com/google/i18n/phonenumbers/AsYouTypeFormatterTest.java b/java/test/com/google/i18n/phonenumbers/AsYouTypeFormatterTest.java index 4920676a7..6a48dcca7 100644 --- a/java/test/com/google/i18n/phonenumbers/AsYouTypeFormatterTest.java +++ b/java/test/com/google/i18n/phonenumbers/AsYouTypeFormatterTest.java @@ -391,10 +391,10 @@ public class AsYouTypeFormatterTest extends TestCase { assertEquals("0", formatter.inputDigit('0')); assertEquals("03", formatter.inputDigit('3')); assertEquals("030", formatter.inputDigit('0')); - assertEquals("030 1", formatter.inputDigit('1')); - assertEquals("030 12", formatter.inputDigit('2')); - assertEquals("030 123", formatter.inputDigit('3')); - assertEquals("030 1234", formatter.inputDigit('4')); + assertEquals("030/1", formatter.inputDigit('1')); + assertEquals("030/12", formatter.inputDigit('2')); + assertEquals("030/123", formatter.inputDigit('3')); + assertEquals("030/1234", formatter.inputDigit('4')); // 04134 1234 formatter.clear(); diff --git a/java/test/com/google/i18n/phonenumbers/ExampleNumbersTest.java b/java/test/com/google/i18n/phonenumbers/ExampleNumbersTest.java index 1d83fa79b..776bb22bd 100644 --- a/java/test/com/google/i18n/phonenumbers/ExampleNumbersTest.java +++ b/java/test/com/google/i18n/phonenumbers/ExampleNumbersTest.java @@ -65,7 +65,7 @@ public class ExampleNumbersTest extends TestCase { */ private void checkNumbersValidAndCorrectType(PhoneNumberType exampleNumberRequestedType, Set possibleExpectedTypes) { - for (String regionCode : phoneNumberUtil.getSupportedCountries()) { + for (String regionCode : phoneNumberUtil.getSupportedRegions()) { PhoneNumber exampleNumber = phoneNumberUtil.getExampleNumberForType(regionCode, exampleNumberRequestedType); if (exampleNumber != null) { @@ -149,7 +149,7 @@ public class ExampleNumbersTest extends TestCase { } public void testCanBeInternationallyDialled() throws Exception { - for (String regionCode : phoneNumberUtil.getSupportedCountries()) { + for (String regionCode : phoneNumberUtil.getSupportedRegions()) { PhoneNumber exampleNumber = null; PhoneNumberDesc desc = phoneNumberUtil.getMetadataForRegion(regionCode).getNoInternationalDialling(); diff --git a/java/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java b/java/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java index a9e51439a..432e6c819 100644 --- a/java/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java +++ b/java/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java @@ -55,7 +55,7 @@ public class PhoneNumberUtilTest extends TestCase { new PhoneNumber().setCountryCode(61).setNationalNumber(236618300L); private static final PhoneNumber BS_MOBILE = new PhoneNumber().setCountryCode(1).setNationalNumber(2423570000L); - private static final PhoneNumber BS_NUMBER = + private static final PhoneNumber BS_NUMBER = new PhoneNumber().setCountryCode(1).setNationalNumber(2423651234L); // Note that this is the same as the example number for DE in the metadata. private static final PhoneNumber DE_NUMBER = @@ -124,13 +124,17 @@ public class PhoneNumberUtilTest extends TestCase { CountryCodeToRegionCodeMapForTesting.getCountryCodeToRegionCodeMap()); } + public void testGetSupportedRegions() { + assertTrue(phoneUtil.getSupportedRegions().size() > 0); + } + public void testGetInstanceLoadUSMetadata() { PhoneMetadata metadata = phoneUtil.getMetadataForRegion(RegionCode.US); assertEquals("US", metadata.getId()); assertEquals(1, metadata.getCountryCode()); assertEquals("011", metadata.getInternationalPrefix()); assertTrue(metadata.hasNationalPrefix()); - assertEquals(2, metadata.getNumberFormatCount()); + assertEquals(2, metadata.numberFormatSize()); assertEquals("(\\d{3})(\\d{3})(\\d{4})", metadata.getNumberFormat(0).getPattern()); assertEquals("$1 $2 $3", metadata.getNumberFormat(0).getFormat()); @@ -151,8 +155,8 @@ public class PhoneNumberUtilTest extends TestCase { assertEquals(49, metadata.getCountryCode()); assertEquals("00", metadata.getInternationalPrefix()); assertEquals("0", metadata.getNationalPrefix()); - assertEquals(6, metadata.getNumberFormatCount()); - assertEquals(1, metadata.getNumberFormat(5).getLeadingDigitsPatternCount()); + assertEquals(6, metadata.numberFormatSize()); + assertEquals(1, metadata.getNumberFormat(5).leadingDigitsPatternSize()); assertEquals("900", metadata.getNumberFormat(5).getLeadingDigitsPattern(0)); assertEquals("(\\d{3})(\\d{3,4})(\\d{4})", metadata.getNumberFormat(5).getPattern()); @@ -181,6 +185,13 @@ public class PhoneNumberUtilTest extends TestCase { assertEquals("$1 $2 $3 $4", metadata.getIntlNumberFormat(3).getFormat()); } + public void testIsLeadingZeroPossible() { + assertTrue(phoneUtil.isLeadingZeroPossible(39)); // Italy + assertFalse(phoneUtil.isLeadingZeroPossible(1)); // USA + assertFalse(phoneUtil.isLeadingZeroPossible(800)); // Not in metadata file, just default to + // false. + } + public void testGetLengthOfGeographicalAreaCode() { // Google MTV, which has area code "650". assertEquals(3, phoneUtil.getLengthOfGeographicalAreaCode(US_NUMBER)); @@ -235,19 +246,19 @@ public class PhoneNumberUtilTest extends TestCase { // An invalid US number (1 digit shorter), which has no NDC. assertEquals(0, phoneUtil.getLengthOfNationalDestinationCode(US_SHORT_BY_ONE_NUMBER)); - // A number containing an invalid country code, which shouldn't have any NDC. + // A number containing an invalid country calling code, which shouldn't have any NDC. PhoneNumber number = new PhoneNumber().setCountryCode(123).setNationalNumber(6502530000L); assertEquals(0, phoneUtil.getLengthOfNationalDestinationCode(number)); } public void testGetNationalSignificantNumber() { - assertEquals("6502530000", PhoneNumberUtil.getNationalSignificantNumber(US_NUMBER)); + assertEquals("6502530000", phoneUtil.getNationalSignificantNumber(US_NUMBER)); // An Italian mobile number. - assertEquals("345678901", PhoneNumberUtil.getNationalSignificantNumber(IT_MOBILE)); + assertEquals("345678901", phoneUtil.getNationalSignificantNumber(IT_MOBILE)); // An Italian fixed line number. - assertEquals("0236618300", PhoneNumberUtil.getNationalSignificantNumber(IT_NUMBER)); + assertEquals("0236618300", phoneUtil.getNationalSignificantNumber(IT_NUMBER)); } public void testGetExampleNumber() { @@ -314,6 +325,7 @@ public class PhoneNumberUtilTest extends TestCase { assertEquals("900 253 0000", phoneUtil.format(US_PREMIUM, PhoneNumberFormat.NATIONAL)); assertEquals("+1 900 253 0000", phoneUtil.format(US_PREMIUM, PhoneNumberFormat.INTERNATIONAL)); + assertEquals("+1-900-253-0000", phoneUtil.format(US_PREMIUM, PhoneNumberFormat.RFC3966)); } public void testFormatBSNumber() { @@ -332,8 +344,9 @@ public class PhoneNumberUtilTest extends TestCase { public void testFormatDENumber() { PhoneNumber deNumber = new PhoneNumber(); deNumber.setCountryCode(49).setNationalNumber(301234L); - assertEquals("030 1234", phoneUtil.format(deNumber, PhoneNumberFormat.NATIONAL)); - assertEquals("+49 30 1234", phoneUtil.format(deNumber, PhoneNumberFormat.INTERNATIONAL)); + assertEquals("030/1234", phoneUtil.format(deNumber, PhoneNumberFormat.NATIONAL)); + assertEquals("+49 30/1234", phoneUtil.format(deNumber, PhoneNumberFormat.INTERNATIONAL)); + assertEquals("+49-30-1234", phoneUtil.format(deNumber, PhoneNumberFormat.RFC3966)); deNumber.clear(); deNumber.setCountryCode(49).setNationalNumber(291123L); @@ -444,6 +457,79 @@ public class PhoneNumberUtilTest extends TestCase { phoneUtil.formatOutOfCountryCallingNumber(IT_NUMBER, RegionCode.AU)); } + public void testFormatOutOfCountryKeepingAlphaChars() { + PhoneNumber alphaNumericNumber = new PhoneNumber(); + alphaNumericNumber.setCountryCode(1).setNationalNumber(8007493524L) + .setRawInput("1800 six-flag"); + assertEquals("0011 1 800 SIX-FLAG", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.AU)); + + alphaNumericNumber.setRawInput("1-800-SIX-flag"); + assertEquals("0011 1 800-SIX-FLAG", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.AU)); + + alphaNumericNumber.setRawInput("Call us from UK: 00 1 800 SIX-flag"); + assertEquals("0011 1 800 SIX-FLAG", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.AU)); + + alphaNumericNumber.setRawInput("800 SIX-flag"); + assertEquals("0011 1 800 SIX-FLAG", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.AU)); + + // Formatting from within the NANPA region. + assertEquals("1 800 SIX-FLAG", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.US)); + + assertEquals("1 800 SIX-FLAG", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.BS)); + + // Testing that if the raw input doesn't exist, it is formatted using + // formatOutOfCountryCallingNumber. + alphaNumericNumber.clearRawInput(); + assertEquals("00 1 800 749 3524", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.DE)); + + // Testing AU alpha number formatted from Australia. + alphaNumericNumber.setCountryCode(61).setNationalNumber(827493524L) + .setRawInput("+61 82749-FLAG"); + // This number should have the national prefix fixed. + assertEquals("082749-FLAG", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.AU)); + + alphaNumericNumber.setRawInput("082749-FLAG"); + assertEquals("082749-FLAG", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.AU)); + + alphaNumericNumber.setNationalNumber(18007493524L).setRawInput("1-800-SIX-flag"); + // This number should not have the national prefix prefixed, in accordance with the override for + // this specific formatting rule. + assertEquals("1-800-SIX-FLAG", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.AU)); + + // The metadata should not be permanently changed, since we copied it before modifying patterns. + // Here we check this. + alphaNumericNumber.setNationalNumber(1800749352L); + assertEquals("1800 749 352", + phoneUtil.formatOutOfCountryCallingNumber(alphaNumericNumber, RegionCode.AU)); + + // Testing a region with multiple international prefixes. + assertEquals("+61 1-800-SIX-FLAG", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.SG)); + + // Testing the case with an invalid country calling code. + alphaNumericNumber.setCountryCode(0).setNationalNumber(18007493524L) + .setRawInput("1-800-SIX-flag"); + // Uses the raw input only. + assertEquals("1-800-SIX-flag", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.DE)); + + // Testing the case of an invalid alpha number. + alphaNumericNumber.setCountryCode(1).setNationalNumber(80749L).setRawInput("180-SIX"); + // No country-code stripping can be done. + assertEquals("00 1 180-SIX", + phoneUtil.formatOutOfCountryKeepingAlphaChars(alphaNumericNumber, RegionCode.DE)); + } + public void testFormatWithCarrierCode() { // We only support this for AR in our test metadata, and only for mobile numbers starting with // certain values. @@ -487,7 +573,7 @@ public class PhoneNumberUtilTest extends TestCase { usNumber.setCountryCode(1).setNationalNumber(4241231234L).setPreferredDomesticCarrierCode("99"); assertEquals("424 123 1234", phoneUtil.format(usNumber, PhoneNumberFormat.NATIONAL)); assertEquals("424 123 1234", - phoneUtil.formatNationalNumberWithPreferredCarrierCode(usNumber, "15")); + phoneUtil.formatNationalNumberWithPreferredCarrierCode(usNumber, "15")); } public void testFormatByPattern() { @@ -557,6 +643,8 @@ public class PhoneNumberUtilTest extends TestCase { PhoneNumber nzNumber = new PhoneNumber().mergeFrom(NZ_NUMBER).setExtension("1234"); // Uses default extension prefix: assertEquals("03-331 6005 ext. 1234", phoneUtil.format(nzNumber, PhoneNumberFormat.NATIONAL)); + // Uses RFC 3966 syntax. + assertEquals("+64-3-331-6005;ext=1234", phoneUtil.format(nzNumber, PhoneNumberFormat.RFC3966)); // Extension prefix overridden in the territory information for the US: PhoneNumber usNumberWithExtension = new PhoneNumber().mergeFrom(US_NUMBER).setExtension("4567"); assertEquals("650 253 0000 extn. 4567", phoneUtil.format(usNumberWithExtension, @@ -805,7 +893,7 @@ public class PhoneNumberUtilTest extends TestCase { } public void testIsPossibleNumberWithReason() { - // FYI, national numbers for country code +1 that are within 7 to 10 digits are possible. + // National numbers for country calling code +1 that are within 7 to 10 digits are possible. assertEquals(PhoneNumberUtil.ValidationResult.IS_POSSIBLE, phoneUtil.isPossibleNumberWithReason(US_NUMBER)); @@ -1034,7 +1122,8 @@ public class PhoneNumberUtilTest extends TestCase { assertEquals("The number supplied was not stripped of the plus symbol.", strippedNumber.toString(), numberToStrip.toString()); - // If the number afterwards is a zero, we should not strip this - no country code begins with 0. + // If the number afterwards is a zero, we should not strip this - no country calling code begins + // with 0. numberToStrip = new StringBuffer("0090112-3123"); strippedNumber = new StringBuffer("00901123123"); assertEquals(CountryCodeSource.FROM_DEFAULT_COUNTRY, @@ -1056,16 +1145,16 @@ public class PhoneNumberUtilTest extends TestCase { try { String phoneNumber = "011112-3456789"; String strippedNumber = "123456789"; - int countryCode = 1; + int countryCallingCode = 1; StringBuffer numberToFill = new StringBuffer(); - assertEquals("Did not extract country code " + countryCode + " correctly.", - countryCode, + assertEquals("Did not extract country calling code " + countryCallingCode + " correctly.", + countryCallingCode, phoneUtil.maybeExtractCountryCode(phoneNumber, metadata, numberToFill, true, number)); assertEquals("Did not figure out CountryCodeSource correctly", CountryCodeSource.FROM_NUMBER_WITH_IDD, number.getCountryCodeSource()); // Should strip and normalize national significant number. - assertEquals("Did not strip off the country code correctly.", + assertEquals("Did not strip off the country calling code correctly.", strippedNumber, numberToFill.toString()); } catch (NumberParseException e) { @@ -1074,10 +1163,10 @@ public class PhoneNumberUtilTest extends TestCase { number.clear(); try { String phoneNumber = "+6423456789"; - int countryCode = 64; + int countryCallingCode = 64; StringBuffer numberToFill = new StringBuffer(); - assertEquals("Did not extract country code " + countryCode + " correctly.", - countryCode, + assertEquals("Did not extract country calling code " + countryCallingCode + " correctly.", + countryCallingCode, phoneUtil.maybeExtractCountryCode(phoneNumber, metadata, numberToFill, true, number)); assertEquals("Did not figure out CountryCodeSource correctly", @@ -1089,10 +1178,10 @@ public class PhoneNumberUtilTest extends TestCase { try { String phoneNumber = "2345-6789"; StringBuffer numberToFill = new StringBuffer(); - assertEquals("Should not have extracted a country code - no international prefix present.", - 0, - phoneUtil.maybeExtractCountryCode(phoneNumber, metadata, numberToFill, true, - number)); + assertEquals( + "Should not have extracted a country calling code - no international prefix present.", + 0, + phoneUtil.maybeExtractCountryCode(phoneNumber, metadata, numberToFill, true, number)); assertEquals("Did not figure out CountryCodeSource correctly", CountryCodeSource.FROM_DEFAULT_COUNTRY, number.getCountryCodeSource()); } catch (NumberParseException e) { @@ -1103,7 +1192,7 @@ public class PhoneNumberUtilTest extends TestCase { String phoneNumber = "0119991123456789"; StringBuffer numberToFill = new StringBuffer(); phoneUtil.maybeExtractCountryCode(phoneNumber, metadata, numberToFill, true, number); - fail("Should have thrown an exception, no valid country code present."); + fail("Should have thrown an exception, no valid country calling code present."); } catch (NumberParseException e) { // Expected. assertEquals("Wrong error type stored in exception.", @@ -1113,10 +1202,10 @@ public class PhoneNumberUtilTest extends TestCase { number.clear(); try { String phoneNumber = "(1 610) 619 4466"; - int countryCode = 1; + int countryCallingCode = 1; StringBuffer numberToFill = new StringBuffer(); - assertEquals("Should have extracted the country code of the region passed in", - countryCode, + assertEquals("Should have extracted the country calling code of the region passed in", + countryCallingCode, phoneUtil.maybeExtractCountryCode(phoneNumber, metadata, numberToFill, true, number)); assertEquals("Did not figure out CountryCodeSource correctly", @@ -1128,10 +1217,10 @@ public class PhoneNumberUtilTest extends TestCase { number.clear(); try { String phoneNumber = "(1 610) 619 4466"; - int countryCode = 1; + int countryCallingCode = 1; StringBuffer numberToFill = new StringBuffer(); - assertEquals("Should have extracted the country code of the region passed in", - countryCode, + assertEquals("Should have extracted the country calling code of the region passed in", + countryCallingCode, phoneUtil.maybeExtractCountryCode(phoneNumber, metadata, numberToFill, false, number)); assertFalse("Should not contain CountryCodeSource.", number.hasCountryCodeSource()); @@ -1142,8 +1231,8 @@ public class PhoneNumberUtilTest extends TestCase { try { String phoneNumber = "(1 610) 619 446"; StringBuffer numberToFill = new StringBuffer(); - assertEquals("Should not have extracted a country code - invalid number after extraction " + - "of uncertain country code.", + assertEquals("Should not have extracted a country calling code - invalid number after " + + "extraction of uncertain country calling code.", 0, phoneUtil.maybeExtractCountryCode(phoneNumber, metadata, numberToFill, false, number)); @@ -1155,8 +1244,8 @@ public class PhoneNumberUtilTest extends TestCase { try { String phoneNumber = "(1 610) 619 43"; StringBuffer numberToFill = new StringBuffer(); - assertEquals("Should not have extracted a country code - invalid number both before and " + - "after extraction of uncertain country code.", + assertEquals("Should not have extracted a country calling code - invalid number both " + + "before and after extraction of uncertain country calling code.", 0, phoneUtil.maybeExtractCountryCode(phoneNumber, metadata, numberToFill, true, number)); @@ -1177,10 +1266,10 @@ public class PhoneNumberUtilTest extends TestCase { assertEquals(NZ_NUMBER, phoneUtil.parse("03 331 6005", RegionCode.NZ)); // Testing international prefixes. - // Should strip country code. + // Should strip country calling code. assertEquals(NZ_NUMBER, phoneUtil.parse("0064 3 331 6005", RegionCode.NZ)); // Try again, but this time we have an international number with Region Code US. It should - // recognise the country code and parse accordingly. + // recognise the country calling code and parse accordingly. assertEquals(NZ_NUMBER, phoneUtil.parse("01164 3 331 6005", RegionCode.US)); assertEquals(NZ_NUMBER, phoneUtil.parse("+64 3 331 6005", RegionCode.US)); @@ -1191,8 +1280,8 @@ public class PhoneNumberUtilTest extends TestCase { assertEquals(DE_NUMBER, phoneUtil.parse("301/23456", RegionCode.DE)); PhoneNumber usNumber = new PhoneNumber(); - // Check it doesn't use the '1' as a country code when parsing if the phone number was already - // possible. + // Check it doesn't use the '1' as a country calling code when parsing if the phone number was + // already possible. usNumber.setCountryCode(1).setNationalNumber(1234567890L); assertEquals(usNumber, phoneUtil.parse("123-456-7890", RegionCode.US)); } @@ -1350,7 +1439,7 @@ public class PhoneNumberUtilTest extends TestCase { try { String invalidCountryCode = "+210 3456 56789"; phoneUtil.parse(invalidCountryCode, RegionCode.NZ); - fail("This is not a recognised country code: should fail: " + invalidCountryCode); + fail("This is not a recognised region code: should fail: " + invalidCountryCode); } catch (NumberParseException e) { // Expected this exception. assertEquals("Wrong error type stored in exception.", @@ -1359,8 +1448,8 @@ public class PhoneNumberUtilTest extends TestCase { } try { String someNumber = "123 456 7890"; - phoneUtil.parse(someNumber, "YY"); - fail("'Unknown' country code not allowed: should fail."); + phoneUtil.parse(someNumber, RegionCode.ZZ); + fail("'Unknown' region code not allowed: should fail."); } catch (NumberParseException e) { // Expected this exception. assertEquals("Wrong error type stored in exception.", @@ -1370,7 +1459,7 @@ public class PhoneNumberUtilTest extends TestCase { try { String someNumber = "123 456 7890"; phoneUtil.parse(someNumber, RegionCode.CS); - fail("Deprecated country code not allowed: should fail."); + fail("Deprecated region code not allowed: should fail."); } catch (NumberParseException e) { // Expected this exception. assertEquals("Wrong error type stored in exception.", @@ -1380,7 +1469,7 @@ public class PhoneNumberUtilTest extends TestCase { try { String someNumber = "123 456 7890"; phoneUtil.parse(someNumber, null); - fail("Null country code not allowed: should fail."); + fail("Null region code not allowed: should fail."); } catch (NumberParseException e) { // Expected this exception. assertEquals("Wrong error type stored in exception.", @@ -1390,7 +1479,7 @@ public class PhoneNumberUtilTest extends TestCase { try { String someNumber = "0044------"; phoneUtil.parse(someNumber, RegionCode.GB); - fail("No number provided, only country code: should fail"); + fail("No number provided, only region code: should fail"); } catch (NumberParseException e) { // Expected this exception. assertEquals("Wrong error type stored in exception.", @@ -1400,7 +1489,7 @@ public class PhoneNumberUtilTest extends TestCase { try { String someNumber = "0044"; phoneUtil.parse(someNumber, RegionCode.GB); - fail("No number provided, only country code: should fail"); + fail("No number provided, only region code: should fail"); } catch (NumberParseException e) { // Expected this exception. assertEquals("Wrong error type stored in exception.", @@ -1466,8 +1555,8 @@ public class PhoneNumberUtilTest extends TestCase { } public void testParseNumbersWithPlusWithNoRegion() throws Exception { - // "ZZ" is allowed only if the number starts with a '+' - then the country code can be - // calculated. + // RegionCode.ZZ is allowed only if the number starts with a '+' - then the country calling code + // can be calculated. assertEquals(NZ_NUMBER, phoneUtil.parse("+64 3 331 6005", RegionCode.ZZ)); // Test with full-width plus. assertEquals(NZ_NUMBER, phoneUtil.parse("\uFF0B64 3 331 6005", RegionCode.ZZ)); @@ -1514,6 +1603,7 @@ public class PhoneNumberUtilTest extends TestCase { assertEquals(ukNumber, phoneUtil.parse("+44 2034567890 X 456", RegionCode.GB)); assertEquals(ukNumber, phoneUtil.parse("+44 2034567890 x 456 ", RegionCode.GB)); assertEquals(ukNumber, phoneUtil.parse("+44 2034567890 X 456", RegionCode.GB)); + assertEquals(ukNumber, phoneUtil.parse("+44-2034567890;ext=456", RegionCode.GB)); PhoneNumber usWithExtension = new PhoneNumber(); usWithExtension.setCountryCode(1).setNationalNumber(8009013355L).setExtension("7246433"); @@ -1577,7 +1667,7 @@ public class PhoneNumberUtilTest extends TestCase { // Invalid region code supplied. try { phoneUtil.parseAndKeepRawInput("123 456 7890", RegionCode.CS); - fail("Deprecated country code not allowed: should fail."); + fail("Deprecated region code not allowed: should fail."); } catch (NumberParseException e) { // Expected this exception. assertEquals("Wrong error type stored in exception.", @@ -1614,8 +1704,8 @@ public class PhoneNumberUtilTest extends TestCase { } public void testIsNumberMatchMatches() throws Exception { - // Test simple matches where formatting is different, or leading zeroes, or country code has - // been specified. + // Test simple matches where formatting is different, or leading zeroes, or country calling code + // has been specified. assertEquals(PhoneNumberUtil.MatchType.EXACT_MATCH, phoneUtil.isNumberMatch("+64 3 331 6005", "+64 03 331 6005")); assertEquals(PhoneNumberUtil.MatchType.EXACT_MATCH, @@ -1665,10 +1755,10 @@ public class PhoneNumberUtilTest extends TestCase { // Non-matches. assertEquals(PhoneNumberUtil.MatchType.NO_MATCH, phoneUtil.isNumberMatch("03 331 6005", "03 331 6006")); - // Different country code, partial number match. + // Different country calling code, partial number match. assertEquals(PhoneNumberUtil.MatchType.NO_MATCH, phoneUtil.isNumberMatch("+64 3 331-6005", "+16433316005")); - // Different country code, same number. + // Different country calling code, same number. assertEquals(PhoneNumberUtil.MatchType.NO_MATCH, phoneUtil.isNumberMatch("+64 3 331-6005", "+6133316005")); // Extension different, all else the same. @@ -1697,8 +1787,8 @@ public class PhoneNumberUtilTest extends TestCase { phoneUtil.isNumberMatch("3 331-6005", "03 331 6005")); assertEquals(PhoneNumberUtil.MatchType.NSN_MATCH, phoneUtil.isNumberMatch(NZ_NUMBER, "03 331 6005")); - // Here the second number possibly starts with the country code for New Zealand, although we are - // unsure. + // Here the second number possibly starts with the country calling code for New Zealand, + // although we are unsure. PhoneNumber unchangedNzNumber = new PhoneNumber().mergeFrom(NZ_NUMBER); assertEquals(PhoneNumberUtil.MatchType.NSN_MATCH, phoneUtil.isNumberMatch(unchangedNzNumber, "(64-3) 331 6005")); @@ -1740,7 +1830,7 @@ public class PhoneNumberUtilTest extends TestCase { phoneUtil.isNumberMatch("1 234 345 6789", "345 6789")); assertEquals(PhoneNumberUtil.MatchType.SHORT_NSN_MATCH, phoneUtil.isNumberMatch("+1 (234) 345 6789", "345 6789")); - // NSN matches, country code omitted for one number, extension missing for one. + // NSN matches, country calling code omitted for one number, extension missing for one. assertEquals(PhoneNumberUtil.MatchType.SHORT_NSN_MATCH, phoneUtil.isNumberMatch("+64 3 331-6005", "3 331 6005#1234")); // One has Italian leading zero, one does not. @@ -1771,4 +1861,11 @@ public class PhoneNumberUtilTest extends TestCase { // We have no data for NZ - should return true. assertTrue(phoneUtil.canBeInternationallyDialled(NZ_NUMBER)); } + + public void testIsAlphaNumber() throws Exception { + assertTrue(phoneUtil.isAlphaNumber("1800 six-flags")); + assertTrue(phoneUtil.isAlphaNumber("1800 six-flags ext. 1234")); + assertFalse(phoneUtil.isAlphaNumber("1800 123-1234")); + assertFalse(phoneUtil.isAlphaNumber("1800 123-1234 extension: 1234")); + } } diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_AD b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_AD index f72b26475f8caf6e5c21ba4c63260e50e2a3ee6c..0554c1f78662899476ad636836e044975f9dba2e 100644 GIT binary patch delta 16 XcmbQlIGK@c&07Z6^4^JTJ&X(hEsg~A delta 14 VcmbQtIEj&M&07Z6@}7xoJpd!51o8j? diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_AO b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_AO index 486d96d7c777785cbb66fc9e9c8257ef7da87c90..8f829b8fb201a7cd80daeeee718254343d6d834c 100644 GIT binary patch delta 20 bcmZ3(w3dl;&07Z6Dh38dm5rRrjEoEbJn{sC delta 18 ZcmZ3>w1$au&07Z6Dh38d<&B)mi~uv~1c3km diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_AR b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_AR index e2efc8f10a0ea1875895130f5c56dd94606873f4..26edd008093e2b1a18c14d7acbb31c83b59b05a2 100644 GIT binary patch delta 20 bcmX@ic7%;{&07Z6Dh38->y4aN%!~{GLH`8n delta 18 ZcmX@Yc9@NG&07Z6Dh38-tBssi%m6qh1nB?( diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_AU b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_AU index 8c20ebf74b058ee2a6cb3b98c4ddbf4ea492d230..ecd675764e3f2981b159de3145e2e8ab808b02d9 100644 GIT binary patch delta 20 bcmaFH^qh%v&07Z6Dh39|xQ(2#jEoEbNDKvQ delta 18 ZcmaFP^o)sf&07Z6Dh39|*o~aAi~v0|1!({P diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_BS b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_BS index d1a31b0a7299b40bb3e82ad724b44d2c731be9a7..2c30b6123c704efb1441f046bdd1a900218910f2 100644 GIT binary patch delta 20 bcmey&^o5CY&07Z6Dh39|?2VjRjEoEbN{I!Z delta 18 Zcmeyu^qGls&07Z6Dh39|tc{#mi~v7K1)Tr@ diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_DE b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_DE index 82b22fb77d1051388f1b768209476034c0ae0e47..0c785345f3804cbd83cd1e10b366cd1cef25b723 100644 GIT binary patch delta 27 jcmX@ZdX|-Q&07Z6Dh39oBO5tqGBWCKUd*V;$jATyd|L;R delta 25 hcmX@hdWMyA&07Z6Dh39o!y7qgGBPS`Ud*V;2mox=2Y>(o diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_GB b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_GB index 1d2b408b809a6b4792a7c0c2070b4943ea192c06..1cbd1f34c26bc275d2c1ef54695b0ba50a66229b 100644 GIT binary patch delta 20 bcmZo;X=mYF^Ok|Nih+Ug-$u^AjEoEbK=cLg delta 18 ZcmZo?X=CAB^Ok|Nih+Ug??%qQi~uzg1?>O; diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_IT b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_IT index 3cc5f04c6490a55a6df7bd7da5220a615c647413..a75f0db2e717d81e6f0e77a2b5fb8c215b03e172 100644 GIT binary patch delta 20 ccmX@ce4Lqc&07Z6Dh39|eH%IVGBPp(07sDp?f?J) delta 18 acmX@ke2kfM&07Z6Dh39|y&F0AG6DcQvjyt_ diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_JP b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_JP index 7887d3237c928572c6aabbfca4eb119ce8ef1855..82581ad6d574f1daaaf27eb3c16a48da1a97afd3 100644 GIT binary patch delta 20 ccmdnYyoH%_&07Z6Dh39|)f+iiF)}g$07LBsp#T5? delta 18 acmdnOyqTGE&07Z6Dh39|RU0{1F#-TMs0E(@ diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_KR b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_KR index 7c2b9421e2a310d158bee492a1760cf31cf0c30b..7f29bcaddb4a076f789929e2b7bdfc73f9740340 100644 GIT binary patch delta 16 XcmbQnGo5DxFAF2*W&07Z6Dh38dt&N;oi~uzV1f2i? diff --git a/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_RE b/java/test/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting_RE index 6ec64af808cdaf374c495d5be78ebfafce492fcd..77a8f8fe13b021c4877dd4a11f7179f4fb68f65f 100644 GIT binary patch delta 20 bcmZo=Ze!+L^Ok|Nih+T#b|YsEBO?OSW?v^Ok|Nih+TVVItdqMg{;hH3ZB6 delta 14 VcmeBVYGq