static String normalize(String number){
  Matcher m=VALID_ALPHA_PHONE_PATTERN.matcher(number);
  if (m.matches()) {
    return normalizeHelper(number,ALPHA_PHONE_MAPPINGS,true);
  }
 else {
    return normalizeDigitsOnly(number);
  }
}

static String normalize ( String number ) { Matcher m = VALID_ALPHA_PHONE_PATTERN . matcher ( number ) ; if ( m . matches ( ) ) { return normalizeHelper ( number , ALPHA_PHONE_MAPPINGS , true ) ; } else { return normalizeDigitsOnly ( number ) ; } }
normalizes a string of characters representing a phone number . this performs the following conversions : punctuation is stripped . for alpha / vanity numbers : letters are converted to their numeric representation on a telephone keypad . the keypad used here is the one defined in itu recommendation e . 161 . this is only done if there are 3 or more letters in the number , to lessen the risk that such letters are typos . for other numbers : wide - ascii digits are converted to normal ascii ( european ) digits . arabic - indic numerals are converted to european numerals . spurious alpha characters are stripped .
