ukrainian-tts / formatter.py
Yurii Paniv
Add text_preformatter
c7de0f6
raw history blame
No virus
579 Bytes
def preprocess_text(text):
# replace apostrophe
text = text.replace("`", "'")
text = text.replace("ʼ", "'")
# numbers
text = text.replace("1", "один ")
text = text.replace("2", "два ")
text = text.replace("3", "три ")
text = text.replace("4", "чотири ")
text = text.replace("5", "п'ять ")
text = text.replace("6", "шість ")
text = text.replace("7", "сім ")
text = text.replace("8", "вісім ")
text = text.replace("9", "дев'ять ")
text = text.replace("0", "нуль ")
return text