mirror of
https://github.com/storytold/storyteller-ml.git
synced 2026-10-17 00:23:14 +00:00
18 lines
584 B
Python
18 lines
584 B
Python
from tts.text.normalization.BaseNormalization import BaseNormalization
|
|
from tts.text.normalization.common_cleaners import collapse_whitespace
|
|
from tts.text.normalization.common_cleaners import convert_to_ascii
|
|
from tts.text.normalization.common_cleaners import lowercase
|
|
|
|
class EnglishNormalization(BaseNormalization):
|
|
|
|
def normalize(self, raw_input_text: str) -> str:
|
|
text = convert_to_ascii(raw_input_text)
|
|
text = lowercase(text)
|
|
|
|
# TODO: Expand abbreviations
|
|
# TODO: Expand numbers
|
|
|
|
text = collapse_whitespace(text)
|
|
|
|
return text
|