From c16963ee09c05cb988a88ae230fdbb458b5cfced Mon Sep 17 00:00:00 2001 From: Lara Scheidegger Date: Tue, 24 May 2011 07:57:29 +0000 Subject: [PATCH] JAVA: Metadata changes, introduction of PhoneNumberOfflineGeocoder class and small fixes. --- java/release_notes.txt | 10 + .../i18n/phonenumbers/PhoneNumberMatcher.java | 35 +- .../PhoneNumberOfflineGeocoder.java | 78 ++ .../google/i18n/phonenumbers/Phonenumber.java | 5 +- .../data/PhoneNumberMetadataProto_CY | Bin 346 -> 373 bytes .../data/PhoneNumberMetadataProto_CZ | Bin 414 -> 456 bytes .../data/PhoneNumberMetadataProto_ES | Bin 395 -> 475 bytes .../data/PhoneNumberMetadataProto_GB | Bin 2743 -> 2818 bytes .../data/PhoneNumberMetadataProto_GF | Bin 147 -> 379 bytes .../data/PhoneNumberMetadataProto_GQ | Bin 428 -> 418 bytes .../data/PhoneNumberMetadataProto_JM | Bin 552 -> 628 bytes .../data/PhoneNumberMetadataProto_KP | Bin 153 -> 462 bytes .../data/PhoneNumberMetadataProto_MQ | Bin 343 -> 365 bytes .../data/PhoneNumberMetadataProto_NC | Bin 153 -> 305 bytes .../data/PhoneNumberMetadataProto_PA | Bin 153 -> 858 bytes .../data/PhoneNumberMetadataProto_PF | Bin 147 -> 356 bytes .../data/PhoneNumberMetadataProto_PW | Bin 148 -> 352 bytes .../data/PhoneNumberMetadataProto_PY | Bin 154 -> 834 bytes .../data/PhoneNumberMetadataProto_SB | Bin 147 -> 322 bytes .../data/PhoneNumberMetadataProto_SR | Bin 147 -> 423 bytes .../data/PhoneNumberMetadataProto_TN | Bin 306 -> 305 bytes .../data/PhoneNumberMetadataProto_TO | Bin 147 -> 432 bytes .../data/PhoneNumberMetadataProto_UY | Bin 153 -> 454 bytes .../data/PhoneNumberMetadataProto_VI | Bin 601 -> 603 bytes .../data/PhoneNumberMetadataProto_VU | Bin 147 -> 352 bytes .../phonenumbers/PhoneNumberMatcherTest.java | 19 + .../PhoneNumberOfflineGeocoderTest.java | 64 + resources/PhoneNumberMetaData.xml | 1118 +++++++++++++++-- 28 files changed, 1208 insertions(+), 121 deletions(-) create mode 100644 java/src/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoder.java create mode 100644 java/test/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoderTest.java diff --git a/java/release_notes.txt b/java/release_notes.txt index 59f43ef3e..1963e5619 100644 --- a/java/release_notes.txt +++ b/java/release_notes.txt @@ -1,3 +1,13 @@ +May 24th, 2011 +* Code changes: + - Phonenumber now implements Serializable. + - findNumbers doesn't accept numbers with mis-matched brackets as phone-numbers + - An offline phone number geocoder has been added. The current implementation just returns the + region name for the phone number; more detailed geocoding will be added later. +* Metadata changes: + - New countries: GF, KP, NC, PA, PF, PW, PY, SB, SR, TO, UY, VU + - Updates: CY, CZ, ES, GB, GQ, JM, MQ, TN, VI + May 9th, 2011 * Code changes: - Fixed potential for a null-ptr exception in getExampleNumber diff --git a/java/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java b/java/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java index 09eb35c4b..68ad3adab 100644 --- a/java/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java +++ b/java/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java @@ -69,6 +69,13 @@ final class PhoneNumberMatcher implements Iterator { private static final Pattern SLASH_SEPARATED_DATES = Pattern.compile("(?:(?:[0-3]?\\d/[01]?\\d)|(?:[01]?\\d/[0-3]?\\d))/(?:[12]\\d)?\\d{2}"); + /** + * Pattern to check that brackets match. Opening brackets should be closed within a phone number. + * This also checks that there is something inside the brackets. Having no brackets at all is also + * fine. + */ + private static final Pattern MATCHING_BRACKETS; + /** * Matches white-space, which may indicate the end of a phone number and the start of something * else (such as a neighbouring zip-code). @@ -76,8 +83,25 @@ final class PhoneNumberMatcher implements Iterator { private static final Pattern GROUP_SEPARATOR = Pattern.compile("\\p{Z}+"); static { - /* Builds the PATTERN regular expression. The building blocks below exist to make the pattern - * more easily understood. */ + /* Builds the MATCHING_BRACKETS and PATTERN regular expressions. The building blocks below exist + * to make the pattern more easily understood. */ + + String openingParens = "(\\[\uFF08\uFF3B"; + String closingParens = ")\\]\uFF09\uFF3D"; + String nonParens = "[^" + openingParens + closingParens + "]"; + + /* Limit on the number of pairs of brackets in a phone number. */ + String bracketPairLimit = limit(0, 3); + /* + * An opening bracket at the beginning may not be closed, but subsequent ones should be. It's + * also possible that the leading bracket was dropped, so we shouldn't be surprised if we see a + * closing bracket first. We limit the sets of brackets in a phone number to four. + */ + MATCHING_BRACKETS = Pattern.compile( + "(?:[" + openingParens + "])?" + "(?:" + nonParens + "+" + "[" + closingParens + "])?" + + nonParens + "+" + + "(?:[" + openingParens + "]" + nonParens + "+[" + closingParens + "])" + bracketPairLimit + + nonParens + "*"); /* Limit on the number of leading (plus) characters. */ String leadLimit = limit(0, 2); @@ -97,7 +121,7 @@ final class PhoneNumberMatcher implements Iterator { /* A digits block without punctuation. */ String digitSequence = "\\p{Nd}" + limit(1, digitBlockLimit); /* Punctuation that may be at the start of a phone number - brackets and plus signs. */ - String leadClass = "[(\\[" + PhoneNumberUtil.PLUS_CHARS + "]"; + String leadClass = "[" + openingParens + PhoneNumberUtil.PLUS_CHARS + "]"; /* Phone number pattern allowing optional punctuation. */ PATTERN = Pattern.compile( @@ -321,6 +345,11 @@ final class PhoneNumberMatcher implements Iterator { */ private PhoneNumberMatch parseAndVerify(String candidate, int offset) { try { + // Check the candidate doesn't contain any formatting which would indicate that it really + // isn't a phone number. + if (!MATCHING_BRACKETS.matcher(candidate).matches()) { + return null; + } PhoneNumber number = util.parse(candidate, preferredRegion); if (leniency.verify(number, util)) { return new PhoneNumberMatch(offset, candidate, number); diff --git a/java/src/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoder.java b/java/src/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoder.java new file mode 100644 index 000000000..fcd1be20c --- /dev/null +++ b/java/src/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoder.java @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2011 Google Inc. + * + * 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. + */ +package com.google.i18n.phonenumbers; + +import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber; + +import java.util.Locale; + +/** + * A offline geocoder which provides geographical information related to a phone number. + * + * @author Shaopeng Jia + */ +public class PhoneNumberOfflineGeocoder { + private static PhoneNumberOfflineGeocoder instance = null; + private PhoneNumberUtil phoneUtil; + + /** + * For testing purposes, we allow the phone number util variable to be injected. + */ + PhoneNumberOfflineGeocoder(PhoneNumberUtil phoneUtil) { + this.phoneUtil = phoneUtil; + } + + /** + * Gets a {@link PhoneNumberOfflineGeocoder} instance to carry out international phone number + * geocoding. + * + *

The {@link PhoneNumberOfflineGeocoder} is implemented as a singleton. Therefore, calling + * this method multiple times will only result in one instance being created. + * + * @return a {@link PhoneNumberOfflineGeocoder} instance + */ + public static synchronized PhoneNumberOfflineGeocoder getInstance() { + if (instance == null) { + instance = new PhoneNumberOfflineGeocoder(PhoneNumberUtil.getInstance()); + } + return instance; + } + + /** + * Returns the customary display name in the given language for the given territory the phone + * number is from. + */ + private String getCountryNameForNumber(PhoneNumber number, Locale language) { + String regionCode = phoneUtil.getRegionCodeForNumber(number); + return (regionCode == null || regionCode.equals("ZZ")) + ? "" : new Locale("", regionCode).getDisplayCountry(language); + } + + /** + * Returns a text description in the given language for the given phone number. The + * description might consist of the name of the country where the phone number is from and/or the + * name of the geographical area the phone number is from. + * + * @param number the phone number for which we want to get a text description + * @param language the language in which the description should be written + * @return a text description in the given language for the given phone number + */ + public String getDescriptionForNumber(PhoneNumber number, Locale language) { + // TODO: Implement logic to figure out fine-grained geographical information based + // on area code here. + return getCountryNameForNumber(number, language); + } +} diff --git a/java/src/com/google/i18n/phonenumbers/Phonenumber.java b/java/src/com/google/i18n/phonenumbers/Phonenumber.java index 788703ce7..3f7d23e25 100644 --- a/java/src/com/google/i18n/phonenumbers/Phonenumber.java +++ b/java/src/com/google/i18n/phonenumbers/Phonenumber.java @@ -22,9 +22,12 @@ package com.google.i18n.phonenumbers; +import java.io.Serializable; + public final class Phonenumber { private Phonenumber() {} - public static class PhoneNumber { + public static class PhoneNumber implements Serializable { + private static final long serialVersionUID = 1L; public enum CountryCodeSource { FROM_NUMBER_WITH_PLUS_SIGN, FROM_NUMBER_WITH_IDD, diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CY index 03e18fb4872753daf55c27c91f6fda25ab941f4b..fb374ed8a338a88a2656dd845302a9d6e8c903b3 100644 GIT binary patch literal 373 zcmZWlF%H5o40I}0ss!pA7&^2=B{z^bVL^zU9R)Vncma?f@iqQ{okG<@6vff`&S(4i zg8T-cuE38{Fb~>L>rcn?ouY!Aql=t@nGU+Og4+RCP-wke8B0#2KA4u0bVBjAOC+Wg z4v{OEaRr7@2;$)}U@9GA3-yi!t6!JR0PtFQM#>d^O*}uM-Shu*qUe~V{^;cm=sOT zn3QU>iH#P5qLyGu15+~#OQ1?K&54JSB)Ki44b5W>Kx%3k8CZd|C6MN{G@LBOs69E5 G(H8*N79J@8 delta 67 zcmX@XJdc@k&07Z6Dh39|sS`QlB_+)aq78K|Vq;RO&1!4Rqm7KsEkPXfi9Hsayp{&h V24)tPu@kQ*O^#wzoSe@X2>_qb6gdC@ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES index 17bf1857160df0381e5d879f74f825ca64b1742e..2ae03c96b7a977772034276f228ed27d91936088 100644 GIT binary patch delta 149 zcmeBXzRk?J<}Cwj6$1m~rHPz!^>G^ZRu(`UZD<^8P!nxr5gTowYY|%$ZDJl9ZK!J* zTVon+U}$V&24b2;884459& delta 53 zcmZn?+b+66h=Xy-WMK|H0Y(O1qZ-p_Q?u9_^JoLJ*v(BG%8WdW44mfChPtNa7M8J_ JPji|x0sv)s4Fv!I diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GF index fd17d8d466778a438469ed071c0aad72ae76e9b2..b84bf2031b1b84037c72fa88b924d6d0862da702 100644 GIT binary patch literal 379 zcmb`DJrcqo5QUdGDIBk0k%A&AnBiw3!A5Pgv#=#}If12;8+kSF;F73?wo>dq-t2z6 zaDPB~1z;DTz!)rpb+I3A-N>M%>_@U;XFb;2jgms#&m%akGYhkcY7w2s)K(II7GhdvS~uXq*&Y9FC2f`bKX;XW{iNJc~k uG}2@=fw*AMg;YJC>SMdR{$FIrp#>R7A2JOiE6M!rfKy@=G>q!?KCXWChcN&E delta 77 zcmeyuvVw(k&07Z6Dh387`H7qw^0^k~W*YWZKx7(iplf6nTVocJq8XD?ZCYCc6r4E0 dk5O~tJtfAN$&8E=9H!Cc7O_Ct&3cS(i~vDg6&(No diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KP b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KP index dbc742e48e3bcd31e9dbc50ec3b11dcf9ebd99ff..aa771a1a7c81b8463b76e8b47dd413ab556413bb 100644 GIT binary patch literal 462 zcmb_YF;2rk5S)!=un>w+B>EICVhKxkdro{ugQ$^El-AJk3b^|b-{3j?fjOHffhJ9w zncJJ$+0}l2qkISC3j`6|*q67Dkm8{Jm9IVt=H$(tPmyd*q78E$wdmJbqv!J1BdFA> z>(-l|wrd*(R{NlfDL`;#!;x$D{3syg;B&oOT|L|nrq!+udAz3Rrk_67(GNzcG!37b*VvB+hwiG+U0XXte`M85m?Z9 V!mS7Q7_WcgIqZMDKQ!d6fFCoRQtki% literal 153 zcmZ4UmVvc=G6MqxBO{1_VMYcfKSwYDlAt=9fyq07fq^-QfyuxCXelF{0NM`)0I;_W AjsO4v diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MQ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MQ index bf62c3e802460f4395d99fd8d1e8cf536d8cf78a..889f6494185153fe862b54ee6767eb7ee8092278 100644 GIT binary patch delta 108 zcmcc4^p=Tp&07Z6Dh39|l!=_Orq-sGW*YWZ2GK^krm;2AhDNalHOA2frn;7~H73yp zMkcxzKw(o|^Vpb_8Vk!B%V?m;M0Ytk6*I8LXaijnb4!qfp_z|6vOV&gRc DSU?_f delta 86 zcmaFMbe)NF&07Z6Dh38dzlof(it478W*YWZ#?c1m7M8I!CecO~u{F`Ay5_MlDK(bS jX66&41=cbWJQl;^xr?x+bwT7C_2u;`D0(1gsc} diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NC b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NC index c8091d15fe63d08ffb2462308f0bd8a03d2d4712..cfa92c51616b96a8dd3a391cd5d7633239d8eaee 100644 GIT binary patch literal 305 zcmZ4UmVvd3fq_wj0Z1@1GVn$l>6)19TE@ntRGZc^GOz+^vs$1OgRF+Vl~J^TF;K3? z*tEtZ+ECX#w#LFj6R5%ju9A^~&B(ye$k+s^LmH^VJlX`L!6Mo~*BnS&#-w1VH#dc< zXYzAoWB?K%+o;Y4n&`~Hz_gx$$-n^UR|sHa5Y+%W->6m-m15vfG1OBr(o-=8sbd5q Gs1^VZhcV9p literal 153 zcmZ4UmVvc=G6MqxBO{1_VMYcfKSwYDlAt;pXreO%1Jim2CIbVYrHpU_Xg?GH0J(_` A-~a#s diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PA index ed88608192c02d9690f7fb556e5bc593b25691f6..ad660fc2180d50a2de6b5b1947c8a11d688b529a 100644 GIT binary patch literal 858 zcmbVLNlpVX5NroUAc1%Vhm6EXUfLTMln)>fM`v!l0-QUK;cL8r3ssX00>OzxY{%WM zs;=&NdzbaI$jO6<7-Qt3xv@^WraKPldT2IG zU7PYMwwR}$V$aRGG?uBC7O_^~YMqAefdGII6Vi82-8DPng*K}oMz-|@Y2iS`kZVr4 zdt`!Wp|eUR@Fnmyn?M52OhyYjpps63gBLE05$Fm+B#o&s7H27rDu@jRq+ao$5DZBGiwMUMAl7jt z(D_hWm`$X8kUXFringrT7PiM*>wHi&?h!ODx$fO8iE_wCu|6y>d!kA>T^8%1lQk;U zWKz>PGynwgTmOxmr2|z2*LlGV%v171O!*Q+_j0bYDIWY_N$?f3!Sm%4^86y?48}(q TWB5-FsmS>w)udw%K}9|Rf8)fB delta 48 ncmcb`Hj`0o&07Z6^2rPg42+B*0*WUuVDgxJfk~eSBme^d?so@U diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PF index bbdd91bf8deddd0052a7974675a19e5929a9de9b..cd67c8b64c7eea9ed3bffa5ecb98ecbbf15dae24 100644 GIT binary patch literal 356 zcmb`DI}XAy42GRZMTmioy+em~sK~VM9xe$esQN_ru&qx=>$@Q$iJ-=ws7KYr;QT&QCN;#^FDqby zN*jwbqh{3Xc(_f`2G!!kMASOi*7ppXIc%791k39=Ctl`XdYvB?5!n{!wutNt@^%4` eFOW*n_l!rtrp{Y7zXg_+E-O=3mit7G3HbnoWI AeEV4e5L};hM54$KB2iG_0_nV7drca|2O_8_j_dM@Wc{BMe2qUa21G*}%ibM( zcEdS diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PY index ab59e417641dafdd8fa27092b184fb432a1938c6..628bd873327adc9aae9b0b8eb8cef35ae2768ad4 100644 GIT binary patch literal 834 zcma))O-{ow6ojAC1}G908~vp6$P9C!{MJU`&$bIL_noaS@Zj`K5)brx&8?nJOtskeENX98}Zw9vnTk z+*sgRsvEUyG+!NRdGG&q83e8OjcNsKh1gHT{^0%+&!+5xR!dVePL?**|fTx6d{!Pe&tON Z>&i+ChhYD7pz3-is$Nu^vMuhkd|!A4JAMEF literal 147 zcmZ4UmVvdrmw|zSkr70|Fe3w#pCgz6Nl=~5z!dDnz`(SWfyuxCXeGpAFat;c0A6Yh AZ~y=R diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SR index c1dc5a1e7d5558572a7ff9460b389cb451887081..a2150452b7da47f08fe68ac28f5ce82b54455c3c 100644 GIT binary patch literal 423 zcma)(Jx;_h5QU$OvbzP)AubS!jkK2HpRofC;sO+)tsHkb1vppX1YC_fFiwm}2QFqt z_V?b5?awbXZ-Dp!2O)47jT+K8z0=9h0(-9fDa?F^yW``7iCWo|ZR}M@*^N^s7SNEg zAI7O;+HF( zj(lzWrylb41(0XRzUNn1*9ESRY-Q)JCN!;9t>IIFE55T!KUWuJ3%DtuS^3|D!y;3y XU6hi1#kclu?zZ+#^!x{vTgUkZcNj?~ literal 147 zcmZ4UmVvdrmw|zSkr70|Fe3w#pCgz6Nl=~5z!V(Bz`zvBz+_+mv=U-5m;odJSt<=M diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TN index 7a24c419aa69b1c67d8d5bf451e4117f1b7e1d1d..b4c07475c6c8eba304058fe9355db4c7d0211581 100644 GIT binary patch delta 37 tcmdnQw2_H(&07Z6Dh38djftGL0-_rBR?$Y5u`ww%Cea3lu@l2@0|35c3cdgU delta 38 ucmdnUw26sx&07Z6Dh38d&54}0f?^u>Rz}eVy5_MpCI&T@F)0(nZUX?s^a|$y diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TO index 10728f3131dd54ab84ff4dd12d313211ed587b02..256eebfae547bb8db1fab7914359af8617ab6ad7 100644 GIT binary patch literal 432 zcmb`DF>b>!3`HpiM$sV|I%Lj}AqL`tq9x1eQuG4p(oNBpQ?&AJ3Uuk!dWU?<4&Vb+ zgGh+)Q~dn>qxzG`{17f!|RJ&uDOdANOlM=<>>pw zIYhSZl=2YSrv{=9;#$QTg{^exutkRueSmt1p*Jf~ b$W5Z%ELy`qjL-g;Jix^#ci!;Kl!43*N;OPE delta 49 pcmdnMJeg5+&07Z6@?Hi821Z5@0l^awdQLniF`0`|kOw3J0|5K^2hjik diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UY index b717cb18782ce42dbc3eaa1e6aa46e1bb703fb0d..ebf41e1088b189804fa6f6d7ac4cda55ffcabf28 100644 GIT binary patch literal 454 zcmbV}y-ve06ot=CNr_Z`B&6;cGBi?yY{w9%3+fAW0|}XKU09fypnfA>fk)yUICeu+ ziLI9Hdo6$W`0DuU2l)pe-{2;KOK+^}w=cWT`(+md=ghjL3%taQiHESa-ZWi8jsQVn zv}rjl(Tm>ewmIk!%30_bi{6gN%qg$#qKqAg^qx~{)F9Bfe?&hL*=8-^7MnXcNA~y( zWKXzOi-(o=hqm{srlwK?;hL7OZ|}EdJkTd#f~!SpydDDbN|%+1CgO}1ZY5^GJl>m- nuyzb65?xkpDwxtNdL@{sO2?`sKHxUg$Ktu?@35mklr+aLPE1b6 literal 153 zcmZ4UmVvc=G6MqxBO{1_VMYcfKSwYDlAt=9fhjbSfq^NEfyuxCXelF{0NM`)0JC%r AqyPW_ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VI index e658ba13c42f1eb42959a25ece6d7c3d6c4d9afe..3f93a89787c7442cf81362bc3d93bf4dfff7904c 100644 GIT binary patch delta 62 zcmcb~a+`&7&07Z6Dh39opoyHCLY2lQ1{(HOMnG&}SYs4zU^eky7Z%Zt_o^8IC2$eN delta 60 ycmcc3a+8H~&07Z6Dh39ofQg)%f)&Ol1{(HOMnG&}SYs4zF!4bbrr^d0)r%jaTR%airrPf`K6H?i!6UYw%Meu^2AOP#7Gesa zA0;>qK4+e@){Qo3Qh{^0o+k|{n!4qFGWn<)Q*%RR?VI)N!F6D*1DzcYb6`9F)P+$P uVtx%8wHW-irR;nn%I=gYh4m~4E2?Hva - + $1 $2 - [27-9]\d{7} + [257-9]\d{7} \d{8} @@ -3952,29 +3952,36 @@ 22345678 - - - 7777\d{4}| - 9(?: - [69]\d| - 7[67] - )\d{5} - + + 9[5-79]\d{6} 96123456 - 8000\d{4} + 800\d{5} 80001234 - 9009\d{4} - 90091234 + 90[09]\d{5} + 90012345 + + 80[1-9]\d{5} + 80112345 + 700\d{5} 70012345 + + + + (?: + 50| + 77 + )\d{6} + + 77123456 + @@ -4069,8 +4076,13 @@ - 60[1-8]\d{6}| - 7[2379]\d{7} + (?: + 60[1-8]| + 7(?: + 0[25]| + [2379]\d + ) + )\d{6} 601123456 @@ -4079,7 +4091,13 @@ 800123456 - 90[0689]\d{6} + + + 9(?: + 0[05689]| + 76 + )\d{6} + 900123456 @@ -4090,6 +4108,10 @@ 70[01]\d{6} 700123456 + + 9[17]0\d{6} + 910123456 + @@ -4960,8 +4982,23 @@ \d{9} - [89][1-8]\d{7} - 812345678 + + (?: + 8(?: + [13]0| + [28][0-8]| + [47][1-9]| + 5[01346-9]| + 6[0457-9] + )| + 9(?: + [1238][0-8]| + [47][1-9]| + [56]\d + ) + )\d{6} + + 810123456 6\d{8} @@ -5583,12 +5620,26 @@ nationalPrefix="0" preferredExtnPrefix=" x" nationalPrefixFormattingRule="$NP$FG" mainCountryForCode="true"> - + 2| 5[56]| - 7[06] + 7(?: + 0| + 6[013-9] + ) + + + 2| + 5[56]| + 7(?: + 0| + 6(?: + [013-9]| + 2[0-35-9] + ) + ) $1 $2 $3 @@ -5650,9 +5701,20 @@ 1 $1 $2 - + - 7[1-5789] + + 7(?: + [1-5789]| + 62 + ) + + + 7(?: + [1-5789]| + 624 + ) + $1 $2 @@ -6337,7 +6399,49 @@ - + + + + + + + $1 $2 $3 $4 + + + + [56]\d{8} + \d{9} + + + + 594(?: + 10| + 2[012457-9]| + 3[0-57-9]| + 4[3-9]| + 5[7-9]| + 6[0-3]| + 9[014] + )\d{4} + + 594101234 + + + + 694(?: + [04][0-7]| + 1[0-5]| + 2[0-46-9]| + 38| + 9\d + )\d{4} + + 694201234 + + @@ -6779,7 +6883,7 @@ - + [235] $1 $2 $3 @@ -6790,9 +6894,7 @@ [23589]\d{8} - - \d{6,9} + \d{9} @@ -9402,38 +9504,53 @@ 876(?: - (?: - 5[0-26]| - 6\d - )\d{5}| - (?: - 7(?: - 0[2-689]| - [1-6]\d| - 8[056]| - 9[45] - )| - 9(?: - 0[1-8]| - 1[02378]| - [2-8]\d| - 9[2-468] - ) - )\d{4} - ) + 5(?: + 0[12]| + 1[0-468]| + 2[35]| + 63 + )| + 6(?: + 0[1-3579]| + 1[027]| + 2[3-5]| + 34| + [45]0| + 63| + 7[05]| + 8[04]| + 9[4-9] + ) + 7(?: + 0[2-689]| + [1-6]\d| + 8[056]| + 9[45] + )| + 9(?: + 0[1-8]| + 1[02378]| + [2-8]\d| + 9[2-468] + ) + )\d{4} 8765123456 - + 876(?: (?: 2[178]| [348]\d| - 5[78] )\d| + 5(?: + 27| + 66| + [78]\d + )| 7(?: 0[07]| 7\d| @@ -10846,8 +10963,63 @@ - + + + + + 1 + $1 $2 $3 + + + 2 + $1 $2 $3 + + + 8 + $1 $2 $3 + + + + + 1\d{9}| + [28]\d{7} + + + \d{6,8}| + \d{10} + + + + + + 2(?: + [0-24-9]\d{2}| + 3(?: + [0-79]\d| + 8[02-9] + ) + )\d{4} + + \d{8} + 23821234 + + + + + 2\d{7}| + 85\d{6} + + \d{6,8} + 21234567 + + + 19[123]\d{7} + \d{10} + 1921234567 + @@ -13113,6 +13285,7 @@ + @@ -13127,10 +13300,13 @@ 596(?: - 3[0789]| - 4[28]| + 0[2-5]| + [12]0| + 3[05-9]| + 4[024-8]| [5-7]\d| - 9[67] + 89| + 9[4-8] )\d{4} 596301234 @@ -13138,9 +13314,9 @@ 696(?: - [2-49]\d| - 7[0-4]| - 8[0-6] + [0-479]\d| + 5[01]| + 8[0-689] )\d{4} 696201234 @@ -14032,8 +14208,59 @@ - + + + + + + $1.$2.$3 + + + + [2-47-9]\d{5} + \d{6} + + + + + (?: + 2[03-9]| + 35| + 4[1-7]| + 88 + )\d{4} + + 201234 + + + + (?: + 7[4-9]| + 8[0-79]| + 9\d + )\d{4} + + 751234 + + + + + 1(?: + 0(?: + 0[06]| + 1[02-46]| + 20| + 3[0125]| + 42| + 5[058]| + 77 + )| + [5-8] + ) + + \d{2,4} + 15 + @@ -14725,62 +14952,260 @@ + + - - - - - - - - 1 - $1 $2 - - - [4-8] - $1 $2 + + [1-57-9] + $1-$2 - - - 9 - $1 $2 $3 + + 6 + $1-$2 - [14-9]\d{7,8} - \d{6,9} + [1-9]\d{6,7} + \d{7,8} + + + (?: - 1\d| - 4[1-4]| - 5[1-46]| - 6[1-7]| - 7[2-46]| - 8[2-4] - )\d{6} - - \d{6,8} - 11234567 - - - 9\d{8} - \d{9} - 912345678 - - - - - - - - + 1(?: + 0[02-579]| + 19| + 23| + 3[03]| + 4[479]| + 5[57]| + 65| + 7[016-8]| + 8[58]| + 9[1-49] + )| + 2(?: + [0235679]\d| + 1[0-7]| + 4[04-9]| + 8[028] + )| + 3(?: + 0[0-7]| + 1[14-7]| + 2[0-3]| + 3[03]| + 4[0457]| + 5[56]| + 6[068]| + 7[078]| + 80| + 9[0-79] + )| + 4(?: + 3[013-59]| + 4\d| + 7[0-689] + )| + 5(?: + [01]\d| + 2[0-7]| + [56]0| + 79 + )| + 7(?: + 09| + 2[0-267]| + [34]0| + 5[6-9]| + 7[0-24-7]| + 8[89]| + 99 + )| + 8(?: + [34]\d| + 5[0-5]| + 8[02] + )| + 9(?: + 0[78]| + 1[0178]| + 2[0378]| + 3[379]| + 40| + 5[0489]| + 6[06-9]| + 7[046-9]| + 8[36-8]| + 9[1-9] + ) + )\d{4} + + \d{7} + 2001234 + + + + + (?: + 161| + 21[89]| + 8(?: + 1[01]| + 7[23] + ) + )\d{4}| + 6(?: + [04-8]\d| + 1[0-5]| + 2[0-4]| + 3[7-9]| + 9[0-8] + )\d{5} + + 60012345 + + + 80[09]\d{4} + \d{7} + 8001234 + + + + + (?: + 779| + 8(?: + 2[235]| + 60| + 7[578]| + 86| + 95 + )| + 9(?: + 0[0-2]| + 81 + ) + )\d{4} + + \d{7} + 8601234 + + + + 10[2-4]| + 911 + + \d{3} + 102 + + + + + + + + + + 1 + $1 $2 + + + [4-8] + $1 $2 + + + + 9 + $1 $2 $3 + + + + [14-9]\d{7,8} + \d{6,9} + + + + (?: + 1\d| + 4[1-4]| + 5[1-46]| + 6[1-7]| + 7[2-46]| + 8[2-4] + )\d{6} + + \d{6,8} + 11234567 + + + 9\d{8} + \d{9} + 912345678 + + + + + + + + + $1 $2 $3 + + + + [2-9]\d{5} + \d{6} + + + + (?: + 36| + 44 + )\d{4} + + 441234 + + + + + (?: + 36\d| + 4(?: + [02-9]\d| + 1[02-9] + )| + [5689]\d{2} + )\d{3} + + 401234 + + + + (?: + [27]\d{3}| + 3[0-49]\d{2}| + 411[3-6] + )\d{2} + + 212345 + + + + @@ -15587,12 +16012,188 @@ - + + + + + $1 $2 + + + + [2-8]\d{6} + \d{7} + + + + 2552255| + (?: + 277| + 345| + 488| + 5(?: + 35| + 44| + 87 + )| + 6(?: + 22| + 54| + 79 + )| + 7(?: + 33| + 47 + )| + 8(?: + 24| + 55| + 76 + ) + )\d{4} + + 2771234 + + + + (?: + 6[234689]0| + 77[45789] + )\d{4} + + 6201234 + + + + 911 + \d{3} + 911 + - + + + + + + + + + (?: + [26]1| + 3[289]| + 4[124678]| + 7[123]| + 8[1236] + ) + + $1 $2 + + + [2-9]0 + $1 $2 + + + 9[1-9] + $1 $2 + + + + 8700 + $1 $2 $3 + + + + [2-8][1-9] + $1 $2 + + + + + 5[0-5]\d{4,7}| + [2-46-9]\d{5,8} + + \d{5,9} + + + + (?: + [26]1| + 3[289]| + 4[124678]| + 7[123]| + 8[1236] + )\d{5,7}| + (?: + 2(?: + 2[4568]| + 7[15]| + 9[1-5] + )| + 3(?: + 18| + 3[167]| + 4[2357]| + 51 + )| + 4(?: + 18| + 2[45]| + 3[12]| + 5[13]| + 64| + 71| + 9[1-47] + )| + 5(?: + [1-4]\d| + 5[0234] + )| + 6(?: + 3[1-3]| + 44| + 7[1-4678] + )| + 7(?: + 17| + 4[0-4]| + 6[1-578]| + 75| + 8[0-8] + )| + 858 + )\d{5,6} + + 212345678 + + + + 9(?: + 61| + 7[12356]| + 8[1-5]| + 9[1235] + )\d{6} + + \d{9} + 961456789 + + + 8700[0-4]\d{4} + \d{9} + 870012345 + + + [2-9]0\d{4,7} + \d{6,9} + 201234567 + + + 1[1-4]\d + \d{3} + 123 + @@ -15996,7 +16597,71 @@ - + + + + + [1-8]\d{4,6} + \d{5,7} + + + + + (?: + 1[4-79]| + [23]\d| + 4[01]| + 5[03]| + 6[0-37] + )\d{3} + + \d{5} + 40123 + + + + 7(?: + 4\d| + 5[025-7] + )\d{4}| + 8[48]\d{5} + + \d{7} + 7421234 + + + 1[38]\d{3} + \d{5} + 18123 + + + 5[12]\d{3} + \d{5} + 51123 + + + + 1(?: + 0[02-79]| + 1[12]| + 2[0-26]| + 4[189]| + 68 + )| + 9(?: + [01]1| + 22| + 33| + 55| + 77| + 88| + 99 + ) + + \d{3} + 100 + @@ -16918,7 +17583,64 @@ + + + + + + [2-4]| + 5[2-58] + + $1-$2 + + + 56 + $1-$2-$3 + + + [6-8] + $1-$2 + + + + [2-8]\d{5,6} + \d{6,7} + + + + + (?: + 2[1-3]| + 3[0-7]| + 4\d| + 5[2-58]| + 68\d + )\d{4} + + 211234 + + + + + (?: + 7[1245]| + 8[1-9] + )\d{5} + + \d{7} + 7412345 + + + 56\d{4} + \d{6} + 561234 + + + 1\d{2,3} + \d{3,4} + 1234 + @@ -17525,9 +18247,8 @@ (?: - 2[0-7]| - 40| - 9\d + [29]\d| + 4[01] )\d{6} 20123456 @@ -17541,7 +18262,65 @@ - + + + + + + + [1-6]| + 7[0-4]| + 8[05] + + $1-$2 + + + + 7[5-9]| + 8[7-9] + + $1 $2 + + + 0 + $1 $2 + + + + [02-8]\d{4,6} + \d{5,7} + + + + (?: + 2\d| + 3[1-8]| + 4[1-4]| + [56]0| + 7[0149]| + 8[05] + )\d{3} + + \d{5} + 20123 + + + + + (?: + 7[578]| + 8[7-9] + )\d{5} + + \d{7} + 7715123 + + + 0800\d{3} + \d{7} + 0800222 + @@ -18361,8 +19140,67 @@ - + + + + + + + + + [24] + $1 $2 + + + + 9[1-9] + $1 $2 $3 + + + [89]0 + $1 $2 + + + + [2489]\d{6,7} + \d{7,8} + + + + 2\d{7}| + 4[2-7]\d{6} + + 21231234 + + + 9[13-9]\d{6} + \d{8} + 94231234 + + + 80[05]\d{4} + \d{7} + 8001234 + + + 90[0-8]\d{4} + \d{7} + 9001234 + + + + 1(?: + 0[4-9]| + 1[2368]| + 2[0-3568] + )| + 911 + + \d{3} + 104 + @@ -18661,7 +19499,7 @@ 340(?: 2(?: 01| - 2[07]| + 2[067]| 36| 44| 77 @@ -18698,7 +19536,7 @@ 340(?: 2(?: 01| - 2[07]| + 2[067]| 36| 44| 77 @@ -18887,7 +19725,53 @@ + + + + + [57] + $1 $2 + + + + [2-578]\d{4,6} + \d{5,7} + + + + (?: + 2[2-9]\d| + 3(?: + [67]\d| + 8[0-8] + )| + 48[4-9]| + 88\d + )\d{2} + + \d{5} + 22123 + + + + (?: + 5(?: + 7[2-5]| + [3-69]\d + )| + 7[013-7]\d + )\d{4} + + \d{7} + 5912345 + + + + 30\d{3} + \d{5} + 30123 +