VITS2-Chinese / text /cleaners.py
kevinwang676's picture
Upload folder using huggingface_hub
de332ab
raw
history blame contribute delete
447 Bytes
import re
from text.mandarin import number_to_chinese, chinese_to_bopomofo, latin_to_bopomofo, chinese_to_romaji, chinese_to_lazy_ipa, chinese_to_ipa, chinese_to_ipa2
def chinese_cleaners(text):
'''Pipeline for Chinese text'''
text = text.replace("[ZH]", "")
text = number_to_chinese(text)
text = chinese_to_bopomofo(text)
text = latin_to_bopomofo(text)
text = re.sub(r'([Λ‰ΛŠΛ‡Λ‹Λ™])$', r'\1。', text)
return text