Browse Source

Add hash as a diallable char.

reviewable/pr1312/r1
Tiago Salem Herrmann 9 years ago
parent
commit
90b74eb35d
2 changed files with 3 additions and 2 deletions
  1. +1
    -0
      cpp/src/phonenumbers/phonenumberutil.cc
  2. +2
    -2
      cpp/test/phonenumbers/phonenumberutil_test.cc

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

@ -288,6 +288,7 @@ class PhoneNumberRegExpsAndMappings {
void InitializeMapsAndSets() {
diallable_char_mappings_.insert(std::make_pair('+', '+'));
diallable_char_mappings_.insert(std::make_pair('*', '*'));
diallable_char_mappings_.insert(std::make_pair('#', '#'));
// Here we insert all punctuation symbols that we wish to respect when
// formatting alpha numbers, as they show the intended number groupings.
all_plus_number_grouping_symbols_.insert(


+ 2
- 2
cpp/test/phonenumbers/phonenumberutil_test.cc View File

@ -2500,9 +2500,9 @@ TEST_F(PhoneNumberUtilTest, NormaliseStripAlphaCharacters) {
}
TEST_F(PhoneNumberUtilTest, NormaliseStripNonDiallableCharacters) {
string input_number("03*4-56&+a#234");
string input_number("03*4-56&+1a#234");
NormalizeDiallableCharsOnly(&input_number);
static const string kExpectedOutput("03*456+234");
static const string kExpectedOutput("03*456+1#234");
EXPECT_EQ(kExpectedOutput, input_number)
<< "Conversion did not correctly remove non-diallable characters";
}


Loading…
Cancel
Save