Browse Source

Merge branch 'master' into master

pull/2631/head
Corentin Noël 1 year ago
committed by GitHub
parent
commit
10f896a220
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
263 changed files with 34441 additions and 34042 deletions
  1. +1
    -1
      .github/workflows/codeql.yml
  2. +40
    -0
      .github/workflows/cpp-unit-test.yml
  3. +0
    -0
      .github/workflows/java-unit-test.yml
  4. +54
    -0
      .github/workflows/osv-scanner-unified.yml
  5. +4
    -4
      .github/workflows/scorecards.yml
  6. +2
    -1
      .gitignore
  7. +1
    -1
      FALSEHOODS.md
  8. +1
    -12
      FAQ.md
  9. +1
    -1
      README.md
  10. +13670
    -13621
      cpp/src/phonenumbers/lite_metadata.cc
  11. +14263
    -14212
      cpp/src/phonenumbers/metadata.cc
  12. +246
    -227
      cpp/src/phonenumbers/phonenumberutil.cc
  13. +129
    -113
      cpp/src/phonenumbers/phonenumberutil.h
  14. +3465
    -3443
      cpp/src/phonenumbers/short_metadata.cc
  15. +1
    -5
      cpp/src/phonenumbers/stringutil.cc
  16. +4
    -5
      cpp/src/phonenumbers/stringutil.h
  17. +2
    -1
      java/build.xml
  18. +14
    -12
      java/carrier/pom.xml
  19. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/1671_en
  20. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/221_en
  21. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/228_en
  22. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/229_en
  23. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/256_en
  24. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/262_en
  25. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/27_en
  26. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/34_en
  27. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/351_en
  28. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/372_en
  29. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/380_en
  30. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/385_en
  31. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/44_en
  32. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/45_en
  33. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/47_en
  34. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/48_en
  35. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/508_en
  36. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/57_en
  37. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/590_en
  38. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/594_en
  39. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/596_en
  40. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/65_en
  41. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/81_en
  42. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/852_en
  43. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/852_zh
  44. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/963_en
  45. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/972_en
  46. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/976_en
  47. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/992_en
  48. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/995_en
  49. BIN
      java/carrier/src/com/google/i18n/phonenumbers/carrier/data/998_en
  50. +7
    -7
      java/demo/pom.xml
  51. +1
    -1
      java/demo/src/main/webapp/WEB-INF/appengine-web.xml
  52. +18
    -14
      java/geocoder/pom.xml
  53. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1327_en
  54. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1345_en
  55. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/1942_en
  56. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/261_en
  57. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/372_en
  58. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/380_en
  59. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/380_uk
  60. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/51_en
  61. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/86_en
  62. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/86_zh
  63. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/95_en
  64. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/960_en
  65. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/geocoding/data/config
  66. BIN
      java/geocoder/src/com/google/i18n/phonenumbers/timezones/data/map_data
  67. +19
    -11
      java/internal/prefixmapper/pom.xml
  68. +19
    -7
      java/libphonenumber/pom.xml
  69. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_870
  70. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AR
  71. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BJ
  72. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BL
  73. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CA
  74. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CO
  75. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DE
  76. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DK
  77. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EE
  78. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FI
  79. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GE
  80. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GF
  81. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GP
  82. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GU
  83. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HK
  84. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HN
  85. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_HR
  86. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IL
  87. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JP
  88. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KY
  89. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MF
  90. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MG
  91. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MM
  92. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MN
  93. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MQ
  94. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MV
  95. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NO
  96. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PA
  97. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PE
  98. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PL
  99. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PM
  100. BIN
      java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RE

+ 1
- 1
.github/workflows/codeql.yml View File

@ -49,7 +49,7 @@ jobs:
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0
with:
version: '3.x'


+ 40
- 0
.github/workflows/cpp-unit-test.yml View File

@ -0,0 +1,40 @@
# This workflow builds and unit tests both main C++ API and also build/data tools for metadata generation.
name: Testing C++ API
on: pull_request
permissions:
contents: read
jobs:
cpp-test:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up C++ environment
run: |
sudo apt-get install \
cmake cmake-curses-gui libprotobuf-dev libgtest-dev libre2-dev \
libicu-dev libboost-dev libboost-thread-dev libboost-system-dev \
protobuf-compiler
- name: Build C++
run: |
cd cpp
mkdir build
cd build
cmake ..
make
- name: Test C++ Build Tools
run: |
./cpp/build/tools/generate_geocoding_data_test
- name: Test C++ API
run: |
./cpp/build/libphonenumber_test

.github/workflows/unit-test.yml → .github/workflows/java-unit-test.yml View File


+ 54
- 0
.github/workflows/osv-scanner-unified.yml View File

@ -0,0 +1,54 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: OSV-Scanner
on:
pull_request:
branches: ["master"]
schedule:
- cron: "12 12 * * 1"
push:
branches: ["master"]
permissions:
# Required to upload SARIF file to CodeQL. See: https://github.com/github/codeql-action/issues/2117
actions: read
# Require writing security events to upload SARIF file to security tab
security-events: write
# Read commit contents
contents: read
jobs:
scan-scheduled:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
# If you want to copy this config, highly suggest pinning this version to a release rather than tracking the main branch
uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@8bd1ce1c4be9d98053ffd9e6e14585276a36762c" # v1.9.1
with:
# Just scan the root directory and docs, since everything else is fixtures
scan-args: |-
-r
--skip-git
./
scan-pr:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
# If you want to copy this config, highly suggest pinning this version to a release rather than tracking the main branch
uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@8bd1ce1c4be9d98053ffd9e6e14585276a36762c" # v1.9.1
with:
# Just scan the root directory and docs, since everything else is fixtures
scan-args: |-
-r
--skip-git
./

+ 4
- 4
.github/workflows/scorecards.yml View File

@ -36,12 +36,12 @@ jobs:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: "Checkout code"
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # v2.0.6
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: results.sarif
results_format: sarif
@ -63,7 +63,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: SARIF file
path: results.sarif
@ -71,6 +71,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2.21.3
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
with:
sarif_file: results.sarif

+ 2
- 1
.gitignore View File

@ -1,4 +1,5 @@
target/
!tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar
build/
lib/
generated/
generated/

+ 1
- 1
FALSEHOODS.md View File

@ -249,7 +249,7 @@ surprising how many false assumptions programmers continue to make about them.
countries a leading 0 is significant and forms part of the number itself
(see *A leading zero in numbers formatted for domestic usage can always be
discarded when dialing from abroad*). Moreover, a phone number may contain
other diallable characters (see *Phone numbers contain only digits*) or an
other dialable characters (see *Phone numbers contain only digits*) or an
extension portion, dialled after waiting for a tone.
**Tip:** Use the library to parse and format numbers to handle this


+ 1
- 12
FAQ.md View File

@ -362,20 +362,9 @@ right thing if the phone number object is as intended.
@Mexico,
Mexico used to have such additional prefixes (1, 02, 045, ...) for dialling
mobile numbers internationally, fixed-line to mobile nationally.. As these
dialling patterns were deprecated, we have continued to maintain mobile and
dialling patterns were deprecated, we removed them but still maintain mobile and
fixed-line ranges at higher level, returning type as [`FIXED_LINE_OR_MOBILE`](#fixed_line_or_mobile)
### <a href="#mx_legacy_formats">Why Mexico (MX) numbers in older dialling formats are accepted as valid ones?</a>
Though library has stopped supporting below older dialling codes in the canonical
form and formatting results, we are lenient in parsing the number, i.e removing
all older codes.
- 1 -> in E.164 international diallings
- 01, 02, 044 and 045 -> for local/national diallings
This is because we found the older dialling codes supported even after deprecation
period, so we decided to support them for longer time. However, we will stop this as
part of [this issue](https://issuetracker.google.com/issues/205606725). More details there.
### <a name="#unsupported_regions">Why are Bouvet Island (BV), Pitcairn Island (PN), Antarctica (AQ) etc. not supported?</a>
We only support a country if:


+ 1
- 1
README.md View File

@ -55,7 +55,7 @@ Cream Sandwich).
The [Java demo](https://libphonenumber.appspot.com/) is updated with a slight
delay after the GitHub release.
Last demo update: v8.13.45.
Last demo update: v8.13.52.
Note: Even though the library (main branch/[maven release](https://repo1.maven.org/maven2/com/googlecode/libphonenumber/libphonenumber/8.12.56/))
is at v8.12.57, because of some deployment issues, we were unable to update the


+ 13670
- 13621
cpp/src/phonenumbers/lite_metadata.cc
File diff suppressed because it is too large
View File


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


+ 246
- 227
cpp/src/phonenumbers/phonenumberutil.cc
File diff suppressed because it is too large
View File


+ 129
- 113
cpp/src/phonenumbers/phonenumberutil.h View File

@ -32,7 +32,6 @@
#include "absl/container/node_hash_set.h"
#include "absl/container/node_hash_map.h"
#include "absl/strings/string_view.h"
class TelephoneNumber;
@ -40,6 +39,7 @@ namespace i18n {
namespace phonenumbers {
using google::protobuf::RepeatedPtrField;
using std::string;
class AsYouTypeFormatter;
class Logger;
@ -181,7 +181,7 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// @returns an unordered set of the two-letter region codes for every
// geographical region the library supports
void GetSupportedRegions(
std::set<std::string>* regions) const;
std::set<string>* regions) const;
// Returns all global network calling codes the library has metadata for.
// @returns an unordered set of the country calling codes for every
@ -202,7 +202,7 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
//
// No types will be returned for invalid or unknown region codes.
void GetSupportedTypesForRegion(
const std::string& region_code,
const string& region_code,
std::set<PhoneNumberType>* types) const;
// Returns the types for a country-code belonging to a non-geographical entity
@ -232,26 +232,26 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// checks - to work out if this number is actually valid for a region, it
// should be parsed and methods such as IsPossibleNumberWithReason or
// IsValidNumber should be used.
bool IsAlphaNumber(const std::string& number) const;
bool IsAlphaNumber(const string& number) const;
// Converts all alpha characters in a number to their respective digits on
// a keypad, but retains existing formatting.
void ConvertAlphaCharactersInNumber(std::string* number) const;
void ConvertAlphaCharactersInNumber(string* number) const;
// Normalizes a string of characters representing a phone number. This
// converts wide-ascii and arabic-indic numerals to European numerals, and
// strips punctuation and alpha characters.
void NormalizeDigitsOnly(std::string* number) const;
void NormalizeDigitsOnly(string* number) const;
// Normalizes a string of characters representing a phone number. This strips
// all characters which are not diallable on a mobile phone keypad (including
// all non-ASCII digits).
void NormalizeDiallableCharsOnly(std::string* number) const;
void NormalizeDiallableCharsOnly(string* number) const;
// Gets the national significant number of a phone number. Note a national
// significant number doesn't contain a national prefix or any formatting.
void GetNationalSignificantNumber(
const PhoneNumber& number, std::string* national_significant_num) const;
void GetNationalSignificantNumber(const PhoneNumber& number,
string* national_significant_num) const;
// Gets the length of the geographical area code from the PhoneNumber object
// passed in, so that clients could use it to split a national significant
@ -335,7 +335,7 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// before the area code when dialing a mobile number from that country from
// abroad.
void GetCountryMobileToken(int country_calling_code,
std::string* mobile_token) const;
string* mobile_token) const;
// Formats a phone number in the specified format using default rules. Note
// that this does not promise to produce a phone number that the user can
@ -343,15 +343,17 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// 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.
void Format(const PhoneNumber& number, PhoneNumberFormat number_format,
std::string* formatted_number) const;
void Format(const PhoneNumber& number,
PhoneNumberFormat number_format,
string* formatted_number) const;
// Formats a phone number in the specified format using client-defined
// formatting rules.
void FormatByPattern(
const PhoneNumber& number, PhoneNumberFormat number_format,
const PhoneNumber& number,
PhoneNumberFormat number_format,
const RepeatedPtrField<NumberFormat>& user_defined_formats,
std::string* formatted_number) const;
string* formatted_number) const;
// Formats a phone number in national format for dialing using the carrier as
// specified in the carrier_code. The carrier_code will always be used
@ -359,8 +361,8 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// carrier code stored. If carrier_code contains an empty string, return the
// number in national format without any carrier code.
void FormatNationalNumberWithCarrierCode(const PhoneNumber& number,
const std::string& carrier_code,
std::string* formatted_number) const;
const string& carrier_code,
string* formatted_number) const;
// Formats a phone number in national format for dialing using the carrier as
// specified in the preferred_domestic_carrier_code field of the PhoneNumber
@ -373,8 +375,9 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// in should take precedence over the number's preferred_domestic_carrier_code
// when formatting.
void FormatNationalNumberWithPreferredCarrierCode(
const PhoneNumber& number, const std::string& fallback_carrier_code,
std::string* formatted_number) const;
const PhoneNumber& number,
const string& fallback_carrier_code,
string* formatted_number) const;
// Returns a number formatted in such a way that it can be dialed from a
// mobile phone in a specific region. If the number cannot be reached from
@ -382,8 +385,9 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// outside of the country), the method returns an empty string.
void FormatNumberForMobileDialing(
const PhoneNumber& number,
const std::string& region_calling_from, bool with_formatting,
std::string* formatted_number) const;
const string& region_calling_from,
bool with_formatting,
string* formatted_number) const;
// Formats a phone number for out-of-country dialing purposes.
//
@ -393,8 +397,9 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// have multiple international prefixes, the number in its INTERNATIONAL
// format will be returned instead.
void FormatOutOfCountryCallingNumber(
const PhoneNumber& number, const std::string& calling_from,
std::string* formatted_number) const;
const PhoneNumber& number,
const string& calling_from,
string* formatted_number) const;
// Formats a phone number using the original phone number format (e.g.
// INTERNATIONAL or NATIONAL) that the number is parsed from, provided that
@ -406,8 +411,8 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// When the number is an invalid number, the method returns the raw input when
// it is available.
void FormatInOriginalFormat(const PhoneNumber& number,
const std::string& region_calling_from,
std::string* formatted_number) const;
const string& region_calling_from,
string* formatted_number) const;
// Formats a phone number for out-of-country dialing purposes.
//
@ -427,8 +432,9 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// 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.
void FormatOutOfCountryKeepingAlphaChars(
const PhoneNumber& number, const std::string& calling_from,
std::string* formatted_number) const;
const PhoneNumber& number,
const string& calling_from,
string* formatted_number) const;
// Attempts to extract a valid number from a phone number that is too long to
// be valid, and resets the PhoneNumber object passed in to that valid
@ -465,17 +471,17 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// since it has its own region code, "IM", which may be undesirable.
bool IsValidNumberForRegion(
const PhoneNumber& number,
const std::string& region_code) const;
const string& region_code) const;
// Returns the region where a phone number is from. This could be used for
// geocoding at the region level. Only guarantees correct results for valid,
// full numbers (not short-codes, or invalid numbers).
void GetRegionCodeForNumber(const PhoneNumber& number,
std::string* region_code) const;
string* region_code) const;
// Returns the country calling code for a specific region. For example,
// this would be 1 for the United States, and 64 for New Zealand.
int GetCountryCodeForRegion(const std::string& region_code) const;
int GetCountryCodeForRegion(const string& region_code) const;
// Returns the region code that matches the specific country code. Note that
// it is possible that several regions share the same country calling code
@ -485,7 +491,7 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// (such as in the case of non-geographical calling codes like 800) the
// RegionCode 001 will be returned (corresponding to the value for World in
// the UN M.49 schema).
void GetRegionCodeForCountryCode(int country_code, std::string* region_code) const;
void GetRegionCodeForCountryCode(int country_code, string* region_code) const;
// Populates a list with the region codes that match the specific country
// calling code. For non-geographical country calling codes, the region code
@ -493,20 +499,20 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// is left unchanged.
void GetRegionCodesForCountryCallingCode(
int country_calling_code,
std::list<std::string>* region_codes) const;
std::list<string>* region_codes) const;
// Checks if this is a region under the North American Numbering Plan
// Administration (NANPA).
bool IsNANPACountry(const std::string& region_code) const;
bool IsNANPACountry(const string& region_code) const;
// Returns the national dialling prefix for a specific region. For example,
// this would be 1 for the United States, and 0 for New Zealand. Set
// strip_non_digits to true to strip symbols like "~" (which indicates a wait
// for a dialling tone) from the prefix returned. If no national prefix is
// present, we return an empty string.
void GetNddPrefixForRegion(const std::string& region_code,
void GetNddPrefixForRegion(const string& region_code,
bool strip_non_digits,
std::string* national_prefix) const;
string* national_prefix) const;
// Checks whether a phone number is a possible number. It provides a more
// lenient check than IsValidNumber() in the following sense:
@ -592,8 +598,8 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// as 253 0000, it could only be dialed from within a smaller area in the US
// (Mountain View, CA, to be more specific).
bool IsPossibleNumberForString(
absl::string_view number,
const std::string& region_dialing_from) const;
const string& number,
const string& region_dialing_from) const;
// Returns true if the number can be dialled from outside the region, or
// unknown. If the number can only be dialled from within the region, returns
@ -617,7 +623,7 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// the region was unknown, or the region 001 is passed in. For 001
// (representing non-geographical numbers), call
// GetExampleNumberForNonGeoEntity instead.
bool GetExampleNumber(const std::string& region_code,
bool GetExampleNumber(const string& region_code,
PhoneNumber* number) const;
// Gets an invalid number for the specified region. This is useful for
@ -629,14 +635,14 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
//
// Returns false when an unsupported region or the region 001 (Earth) is
// passed in.
bool GetInvalidExampleNumber(const std::string& region_code,
bool GetInvalidExampleNumber(const string& region_code,
PhoneNumber* number) const;
// Gets a valid number of the specified type for the specified region.
// Returns false if the region was unknown or 001, or if no example number of
// that type could be found. For 001 (representing non-geographical numbers),
// call GetExampleNumberForNonGeoEntity instead.
bool GetExampleNumberForType(const std::string& region_code,
bool GetExampleNumberForType(const string& region_code,
PhoneNumberType type,
PhoneNumber* number) const;
@ -691,15 +697,15 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// number (e.g.too few or too many digits) or if no default region was
// supplied and the number is not in international format (does not start with
// +).
ErrorType Parse(absl::string_view number_to_parse,
const std::string& default_region,
ErrorType Parse(const string& number_to_parse,
const string& default_region,
PhoneNumber* number) const;
// 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 number_to_parse as well as the country_code_source
// field.
ErrorType ParseAndKeepRawInput(absl::string_view number_to_parse,
const std::string& default_region,
ErrorType ParseAndKeepRawInput(const string& number_to_parse,
const string& default_region,
PhoneNumber* number) const;
// Takes two phone numbers and compares them for equality.
@ -723,8 +729,8 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// PhoneNumber secondNumber). No default region is known.
// Returns INVALID_NUMBER if either number cannot be parsed into a phone
// number.
MatchType IsNumberMatchWithTwoStrings(absl::string_view first_number,
absl::string_view second_number) const;
MatchType IsNumberMatchWithTwoStrings(const string& first_number,
const string& second_number) const;
// Takes two phone numbers and compares them for equality. This is a
// convenience wrapper for IsNumberMatch(PhoneNumber firstNumber,
@ -732,7 +738,7 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// Returns INVALID_NUMBER if second_number cannot be parsed into a phone
// number.
MatchType IsNumberMatchWithOneString(const PhoneNumber& first_number,
absl::string_view second_number) const;
const string& second_number) const;
// Overrides the default logging system. This takes ownership of the provided
// logger.
@ -743,7 +749,7 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// numbers in the specific region "as you type".
// The deletion of the returned instance is under the responsibility of the
// caller.
AsYouTypeFormatter* GetAsYouTypeFormatter(const std::string& region_code) const;
AsYouTypeFormatter* GetAsYouTypeFormatter(const string& region_code) const;
friend bool ConvertFromTelephoneNumberProto(
const TelephoneNumber& proto_to_convert,
@ -752,16 +758,16 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
TelephoneNumber* resulting_proto);
protected:
bool IsNumberMatchingDesc(const std::string& national_number,
bool IsNumberMatchingDesc(const string& national_number,
const PhoneNumberDesc& number_desc) const;
PhoneNumberUtil::PhoneNumberType GetNumberTypeHelper(
const std::string& national_number, const PhoneMetadata& metadata) const;
const string& national_number, const PhoneMetadata& metadata) const;
private:
scoped_ptr<Logger> logger_;
typedef std::pair<int, std::list<std::string>*> IntRegionsPair;
typedef std::pair<int, std::list<string>*> IntRegionsPair;
// The minimum and maximum length of the national significant number.
static const size_t kMinLengthForNsn = 2;
@ -806,11 +812,11 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
country_calling_code_to_region_code_map_;
// The set of regions that share country calling code 1.
scoped_ptr<absl::node_hash_set<std::string> > nanpa_regions_;
scoped_ptr<absl::node_hash_set<string> > nanpa_regions_;
static const int kNanpaCountryCode = 1;
// A mapping from a region code to a PhoneMetadata for that region.
scoped_ptr<absl::node_hash_map<std::string, PhoneMetadata> > region_to_metadata_map_;
scoped_ptr<absl::node_hash_map<string, PhoneMetadata> > region_to_metadata_map_;
// A mapping from a country calling code for a non-geographical entity to the
// PhoneMetadata for that country calling code. Examples of the country
@ -823,144 +829,154 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
// Returns a regular expression for the possible extensions that may be found
// in a number, for use when matching.
const std::string& GetExtnPatternsForMatching() const;
const string& GetExtnPatternsForMatching() const;
// Checks if a number matches the plus chars pattern.
bool StartsWithPlusCharsPattern(const std::string& number) const;
bool StartsWithPlusCharsPattern(const string& number) const;
void SetItalianLeadingZerosForPhoneNumber(const std::string& national_number,
PhoneNumber* phone_number) const;
void SetItalianLeadingZerosForPhoneNumber(
const string& national_number, PhoneNumber* phone_number) const;
// Checks whether a string contains only valid digits.
bool ContainsOnlyValidDigits(const std::string& s) const;
bool ContainsOnlyValidDigits(const string& s) const;
// Checks if a format is eligible to be used by the AsYouTypeFormatter. This
// method is here rather than in asyoutypeformatter.h since it depends on the
// valid punctuation declared by the phone number util.
bool IsFormatEligibleForAsYouTypeFormatter(const std::string& format) const;
bool IsFormatEligibleForAsYouTypeFormatter(const string& format) const;
// Helper function to check if the national prefix formatting rule has the
// first group only, i.e., does not start with the national prefix.
bool FormattingRuleHasFirstGroupOnly(
const std::string& national_prefix_formatting_rule) const;
const string& national_prefix_formatting_rule) const;
// Trims unwanted end characters from a phone number string.
void TrimUnwantedEndChars(std::string* number) const;
void TrimUnwantedEndChars(string* number) const;
// Helper function to check region code is not unknown or null.
bool IsValidRegionCode(const std::string& region_code) const;
bool IsValidRegionCode(const string& region_code) const;
// Helper function to check the country calling code is valid.
bool HasValidCountryCallingCode(int country_calling_code) const;
const i18n::phonenumbers::PhoneMetadata* GetMetadataForRegion(
const std::string& region_code) const;
const string& region_code) const;
const i18n::phonenumbers::PhoneMetadata* GetMetadataForNonGeographicalRegion(
int country_calling_code) const;
const i18n::phonenumbers::PhoneMetadata* GetMetadataForRegionOrCallingCode(
int country_calling_code,
const std::string& region_code) const;
const string& region_code) const;
// As per GetCountryCodeForRegion, but assumes the validity of the region_code
// has already been checked.
int GetCountryCodeForValidRegion(const std::string& region_code) const;
int GetCountryCodeForValidRegion(const string& region_code) const;
const NumberFormat* ChooseFormattingPatternForNumber(
const RepeatedPtrField<NumberFormat>& available_formats,
const std::string& national_number) const;
const string& national_number) const;
void FormatNsnUsingPatternWithCarrier(
const std::string& national_number,
const string& national_number,
const NumberFormat& formatting_pattern,
PhoneNumberUtil::PhoneNumberFormat number_format,
const std::string& carrier_code, std::string* formatted_number) const;
const string& carrier_code,
string* formatted_number) const;
void FormatNsnUsingPattern(const std::string& national_number,
const NumberFormat& formatting_pattern,
PhoneNumberUtil::PhoneNumberFormat number_format,
std::string* formatted_number) const;
void FormatNsnUsingPattern(
const string& national_number,
const NumberFormat& formatting_pattern,
PhoneNumberUtil::PhoneNumberFormat number_format,
string* formatted_number) const;
// Check if raw_input, which is assumed to be in the national format, has a
// national prefix. The national prefix is assumed to be in digits-only form.
bool RawInputContainsNationalPrefix(
const std::string& raw_input, const std::string& national_prefix,
const std::string& region_code) const;
const string& raw_input,
const string& national_prefix,
const string& region_code) const;
bool HasFormattingPatternForNumber(const PhoneNumber& number) const;
// Simple wrapper of FormatNsnWithCarrier for the common case of
// no carrier code.
void FormatNsn(const std::string& number, const PhoneMetadata& metadata,
void FormatNsn(const string& number,
const PhoneMetadata& metadata,
PhoneNumberFormat number_format,
std::string* formatted_number) const;
string* formatted_number) const;
void FormatNsnWithCarrier(const std::string& number,
void FormatNsnWithCarrier(const string& number,
const PhoneMetadata& metadata,
PhoneNumberFormat number_format,
const std::string& carrier_code,
std::string* formatted_number) const;
const string& carrier_code,
string* formatted_number) const;
void MaybeAppendFormattedExtension(const PhoneNumber& number,
const PhoneMetadata& metadata,
PhoneNumberFormat number_format,
std::string* extension) const;
void MaybeAppendFormattedExtension(
const PhoneNumber& number,
const PhoneMetadata& metadata,
PhoneNumberFormat number_format,
string* extension) const;
void GetRegionCodeForNumberFromRegionList(
const PhoneNumber& number,
const std::list<std::string>& region_codes,
std::string* region_code) const;
const std::list<string>& region_codes,
string* region_code) const;
// Strips the IDD from the start of the number if present. Helper function
// used by MaybeStripInternationalPrefixAndNormalize.
bool ParsePrefixAsIdd(const RegExp& idd_pattern, std::string* number) const;
bool ParsePrefixAsIdd(const RegExp& idd_pattern, string* number) const;
void Normalize(std::string* number) const;
void Normalize(string* number) const;
PhoneNumber::CountryCodeSource MaybeStripInternationalPrefixAndNormalize(
const std::string& possible_idd_prefix, std::string* number) const;
const string& possible_idd_prefix,
string* number) const;
bool MaybeStripNationalPrefixAndCarrierCode(const PhoneMetadata& metadata,
std::string* number,
std::string* carrier_code) const;
bool MaybeStripNationalPrefixAndCarrierCode(
const PhoneMetadata& metadata,
string* number,
string* carrier_code) const;
void ExtractPossibleNumber(absl::string_view number,
std::string* extracted_number) const;
void ExtractPossibleNumber(const string& number,
string* extracted_number) const;
bool IsViablePhoneNumber(const std::string& number) const;
bool IsViablePhoneNumber(const string& number) const;
bool MaybeStripExtension(std::string* number, std::string* extension) const;
bool MaybeStripExtension(string* number, string* extension) const;
int ExtractCountryCode(std::string* national_number) const;
int ExtractCountryCode(string* national_number) const;
ErrorType MaybeExtractCountryCode(
const PhoneMetadata* default_region_metadata, bool keepRawInput,
std::string* national_number, PhoneNumber* phone_number) const;
bool CheckRegionForParsing(const std::string& number_to_parse,
const std::string& default_region) const;
ErrorType ParseHelper(absl::string_view number_to_parse,
const std::string& default_region,
bool keep_raw_input, bool check_region,
const PhoneMetadata* default_region_metadata,
bool keepRawInput,
string* national_number,
PhoneNumber* phone_number) const;
bool CheckRegionForParsing(
const string& number_to_parse,
const string& default_region) const;
ErrorType ParseHelper(const string& number_to_parse,
const string& default_region,
bool keep_raw_input,
bool check_region,
PhoneNumber* phone_number) const;
absl::optional<absl::string_view> ExtractPhoneContext(
absl::string_view number_to_extract_from,
std::size_t index_of_phone_context) const;
absl::optional<string> ExtractPhoneContext(
const string& number_to_extract_from,
size_t index_of_phone_context) const;
bool IsPhoneContextValid(
absl::optional<absl::string_view> phone_context) const;
bool IsPhoneContextValid(absl::optional<string> phone_context) const;
ErrorType BuildNationalNumberForParsing(absl::string_view number_to_parse,
std::string* national_number) const;
ErrorType BuildNationalNumberForParsing(const string& number_to_parse,
string* national_number) const;
bool IsShorterThanPossibleNormalNumber(const PhoneMetadata* country_metadata,
const std::string& number) const;
const string& number) const;
};
} // namespace phonenumbers
} // namespace i18n
#endif // I18N_PHONENUMBERS_PHONENUMBERUTIL_H_
#endif // I18N_PHONENUMBERS_PHONENUMBERUTIL_H_

+ 3465
- 3443
cpp/src/phonenumbers/short_metadata.cc
File diff suppressed because it is too large
View File


+ 1
- 5
cpp/src/phonenumbers/stringutil.cc View File

@ -134,10 +134,6 @@ StringHolder::StringHolder(uint64 n)
: absl::AlphaNum(n)
{}
StringHolder::StringHolder(absl::string_view sv)
: absl::AlphaNum(sv)
{}
StringHolder::~StringHolder() {}
// StrCat
@ -297,4 +293,4 @@ void StrAppend(string* dest, const StringHolder& s1, const StringHolder& s2,
}
} // namespace phonenumbers
} // namespace i18n
} // namespace i18n

+ 4
- 5
cpp/src/phonenumbers/stringutil.h View File

@ -80,10 +80,9 @@ int GlobalReplaceSubstring(const string& substring, const string& replacement,
class StringHolder: public absl::AlphaNum {
public:
// Don't make the constructors explicit to make the StrCat usage convenient.
StringHolder(const string& s); // NOLINT(runtime/explicit)
StringHolder(const char* s); // NOLINT(runtime/explicit)
StringHolder(uint64_t n); // NOLINT(runtime/explicit)
StringHolder(absl::string_view sv); // NOLINT(runtime/explicit)
StringHolder(const string& s); // NOLINT(runtime/explicit)
StringHolder(const char* s); // NOLINT(runtime/explicit)
StringHolder(uint64_t n); // NOLINT(runtime/explicit)
~StringHolder();
const absl::string_view GetString() const {
@ -200,4 +199,4 @@ void StrAppend(string* dest, const StringHolder& s1, const StringHolder& s2,
} // namespace phonenumbers
} // namespace i18n
#endif // I18N_PHONENUMBERS_STRINGUTIL_H_
#endif // I18N_PHONENUMBERS_STRINGUTIL_H_

+ 2
- 1
java/build.xml View File

@ -77,8 +77,9 @@
<arg value="--output-dir=${libphonenumber.test.dir}/com/google/i18n/phonenumbers"/>
<arg value="--data-prefix=data/PhoneNumberMetadataProtoForTesting"/>
<arg value="--mapping-class=CountryCodeToRegionCodeMapForTesting"/>
<arg value="--copyright=2010"/>
<arg value="--copyright=2011"/>
<arg value="--lite-build=false"/>
<arg value="--build-regioncode=true"/>
</exec>
</target>


+ 14
- 12
java/carrier/pom.xml View File

@ -1,16 +1,15 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>carrier</artifactId>
<version>1.230-SNAPSHOT</version>
<version>1.237-SNAPSHOT</version>
<packaging>jar</packaging>
<url>https://github.com/google/libphonenumber/</url>
<parent>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber-parent</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
</parent>
<build>
@ -24,8 +23,10 @@
</resources>
<testResources>
<testResource>
<directory>test/com/google/i18n/phonenumbers/carrier/testing_data</directory>
<targetPath>com/google/i18n/phonenumbers/carrier/testing_data</targetPath>
<directory>test/com/google/i18n/phonenumbers/carrier/testing_data
</directory>
<targetPath>com/google/i18n/phonenumbers/carrier/testing_data
</targetPath>
</testResource>
</testResources>
<plugins>
@ -35,24 +36,25 @@
<version>5.1.9</version>
<configuration>
<instructions>
<Fragment-Host>com.googlecode.libphonenumber</Fragment-Host>
<Fragment-Host>com.googlecode.libphonenumber</Fragment-Host>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>default-jar</id>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestFile>
${project.build.outputDirectory}/META-INF/MANIFEST.MF
</manifestFile>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
@ -79,12 +81,12 @@
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>prefixmapper</artifactId>
<version>2.240-SNAPSHOT</version>
<version>2.247-SNAPSHOT</version>
</dependency>
</dependencies>


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/1671_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/221_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/228_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/229_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/256_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/262_en View File


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


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/34_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/351_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/372_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/380_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/385_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/44_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/45_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/47_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/48_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/508_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/57_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/590_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/594_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/596_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/65_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/81_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/852_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/852_zh View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/963_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/972_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/976_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/992_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/995_en View File


BIN
java/carrier/src/com/google/i18n/phonenumbers/carrier/data/998_en View File


+ 7
- 7
java/demo/pom.xml View File

@ -3,21 +3,21 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>demo</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
<packaging>war</packaging>
<url>https://github.com/google/libphonenumber/</url>
<parent>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber-parent</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
</parent>
<properties>
<app.deploy.project>libphonenumber-hrd</app.deploy.project>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
<archiveClasses>true</archiveClasses>
<soy.root>${project.basedir}/src/main/resources/com/google/phonenumbers/demo</soy.root>
@ -68,17 +68,17 @@
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>geocoder</artifactId>
<version>2.240-SNAPSHOT</version>
<version>2.247-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>carrier</artifactId>
<version>1.230-SNAPSHOT</version>
<version>1.237-SNAPSHOT</version>
</dependency>
</dependencies>


+ 1
- 1
java/demo/src/main/webapp/WEB-INF/appengine-web.xml View File

@ -2,7 +2,7 @@
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>libphonenumber-hrd</application>
<version>1</version>
<runtime>java11</runtime>
<runtime>java17</runtime>
<threadsafe>true</threadsafe>
<!-- Configure java.util.logging -->


+ 18
- 14
java/geocoder/pom.xml View File

@ -1,16 +1,15 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>geocoder</artifactId>
<version>2.240-SNAPSHOT</version>
<version>2.247-SNAPSHOT</version>
<packaging>jar</packaging>
<url>https://github.com/google/libphonenumber/</url>
<parent>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber-parent</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
</parent>
<build>
@ -28,12 +27,16 @@
</resources>
<testResources>
<testResource>
<directory>test/com/google/i18n/phonenumbers/geocoding/testing_data</directory>
<targetPath>com/google/i18n/phonenumbers/geocoding/testing_data</targetPath>
<directory>test/com/google/i18n/phonenumbers/geocoding/testing_data
</directory>
<targetPath>com/google/i18n/phonenumbers/geocoding/testing_data
</targetPath>
</testResource>
<testResource>
<directory>test/com/google/i18n/phonenumbers/timezones/testing_data</directory>
<targetPath>com/google/i18n/phonenumbers/timezones/testing_data</targetPath>
<directory>test/com/google/i18n/phonenumbers/timezones/testing_data
</directory>
<targetPath>com/google/i18n/phonenumbers/timezones/testing_data
</targetPath>
</testResource>
</testResources>
<plugins>
@ -43,24 +46,25 @@
<version>5.1.9</version>
<configuration>
<instructions>
<Fragment-Host>com.googlecode.libphonenumber</Fragment-Host>
<Fragment-Host>com.googlecode.libphonenumber</Fragment-Host>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>default-jar</id>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestFile>
${project.build.outputDirectory}/META-INF/MANIFEST.MF
</manifestFile>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
@ -87,12 +91,12 @@
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>prefixmapper</artifactId>
<version>2.240-SNAPSHOT</version>
<version>2.247-SNAPSHOT</version>
</dependency>
</dependencies>


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


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


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


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


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


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


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


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


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


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


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


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


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


BIN
java/geocoder/src/com/google/i18n/phonenumbers/timezones/data/map_data View File


+ 19
- 11
java/internal/prefixmapper/pom.xml View File

@ -1,16 +1,15 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>prefixmapper</artifactId>
<version>2.240-SNAPSHOT</version>
<version>2.247-SNAPSHOT</version>
<packaging>jar</packaging>
<url>https://github.com/google/libphonenumber/</url>
<parent>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber-parent</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@ -19,8 +18,11 @@
<testSourceDirectory>test</testSourceDirectory>
<testResources>
<testResource>
<directory>../../geocoder/test/com/google/i18n/phonenumbers/geocoding/testing_data</directory>
<targetPath>com/google/i18n/phonenumbers/geocoding/testing_data</targetPath>
<directory>
../../geocoder/test/com/google/i18n/phonenumbers/geocoding/testing_data
</directory>
<targetPath>com/google/i18n/phonenumbers/geocoding/testing_data
</targetPath>
</testResource>
</testResources>
<plugins>
@ -30,24 +32,30 @@
<version>5.1.9</version>
<configuration>
<instructions>
<Fragment-Host>com.googlecode.libphonenumber</Fragment-Host>
<Fragment-Host>com.googlecode.libphonenumber</Fragment-Host>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>default-jar</id>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestFile>
${project.build.outputDirectory}/META-INF/MANIFEST.MF
</manifestFile>
<manifestEntries>
<Automatic-Module-Name>
com.google.i18n.phonenumbers.prefixmapper
</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@ -75,7 +83,7 @@
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
</dependency>
</dependencies>


+ 19
- 7
java/libphonenumber/pom.xml View File

@ -1,16 +1,15 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
<packaging>jar</packaging>
<url>https://github.com/google/libphonenumber/</url>
<parent>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber-parent</artifactId>
<version>8.13.46-SNAPSHOT</version>
<version>8.13.53-SNAPSHOT</version>
</parent>
<build>
@ -35,20 +34,26 @@
<version>5.1.9</version>
<configuration>
<instructions>
<Eclipse-ExtensibleAPI>true</Eclipse-ExtensibleAPI>
<Eclipse-ExtensibleAPI>true</Eclipse-ExtensibleAPI>
<Export-Package>com.google.i18n.phonenumbers</Export-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>default-jar</id>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestFile>
${project.build.outputDirectory}/META-INF/MANIFEST.MF
</manifestFile>
<manifestEntries>
<Automatic-Module-Name>
com.google.i18n.phonenumbers.libphonenumber
</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</execution>
@ -61,7 +66,14 @@
<configuration>
<classifier>no-metadata</classifier>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestFile>
${project.build.outputDirectory}/META-INF/MANIFEST.MF
</manifestFile>
<manifestEntries>
<Automatic-Module-Name>
com.google.i18n.phonenumbers.libphonenumber
</Automatic-Module-Name>
</manifestEntries>
</archive>
<excludes>
<exclude>com/google/i18n/phonenumbers/data/*</exclude>


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save