add docstring for normalizer
This commit is contained in:
parent
c2bc4b0474
commit
63285dc80f
|
@ -19,6 +19,8 @@ from parakeet.frontend.normalizer.numbers import normalize_numbers
|
|||
|
||||
|
||||
def normalize(sentence):
|
||||
""" Normalize English text.
|
||||
"""
|
||||
# preprocessing
|
||||
sentence = unicode(sentence)
|
||||
sentence = normalize_numbers(sentence)
|
||||
|
|
|
@ -75,6 +75,8 @@ def _expand_number(m):
|
|||
|
||||
|
||||
def normalize_numbers(text):
|
||||
""" Normalize numbers in English text.
|
||||
"""
|
||||
text = re.sub(_comma_number_re, _remove_commas, text)
|
||||
text = re.sub(_pounds_re, r'\1 pounds', text)
|
||||
text = re.sub(_dollars_re, _expand_dollars, text)
|
||||
|
|
Loading…
Reference in New Issue