Spaces:
Runtime error
Runtime error
| 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 | |