Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python/phonenumbers/phonenumberutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ def _copy_number_format(other):


def _extract_possible_number(number):
# type: (str) -> str
"""Attempt to extract a possible number from the string passed in.

This currently strips all leading characters that cannot be used to
Expand Down Expand Up @@ -588,6 +589,7 @@ def _extract_possible_number(number):


def _is_viable_phone_number(number):
# type: (str) -> bool
"""Checks to see if a string could possibly be a phone number.

At the moment, checks to see that the string begins with at least 2
Expand All @@ -609,6 +611,7 @@ def _is_viable_phone_number(number):


def _normalize(number):
# type: (str) -> str
"""Normalizes a string of characters representing a phone number.

This performs the following conversions:
Expand Down Expand Up @@ -637,6 +640,7 @@ def _normalize(number):


def normalize_digits_only(number, keep_non_digits=False):
# type: (str, bool) -> str
"""Normalizes a string of characters representing a phone number.

This converts wide-ascii and arabic-indic numerals to European numerals,
Expand All @@ -661,6 +665,7 @@ def normalize_digits_only(number, keep_non_digits=False):


def normalize_diallable_chars_only(number):
# type: (str) -> str
"""Normalizes a string of characters representing a phone number.

This strips all characters which are not diallable on a mobile phone
Expand All @@ -675,6 +680,7 @@ def normalize_diallable_chars_only(number):


def convert_alpha_characters_in_number(number):
# type: (str) -> str
"""Convert alpha chars in a number to their respective digits on a keypad,
but retains existing formatting."""
return _normalize_helper(number, _ALPHA_PHONE_MAPPINGS, False)
Expand Down Expand Up @@ -2772,6 +2778,7 @@ def _set_italian_leading_zeros_for_phone_number(national_number, numobj):

def parse(number, region=None, keep_raw_input=False,
numobj=None, _check_region=True):
# type: (str, str, bool, PhoneNumber, bool) -> PhoneNumber
"""Parse a string and return a corresponding PhoneNumber object.

The method is quite lenient and looks for a number in the input text
Expand Down