INNER CODE UNIT · Python
has_chinese_punctuation
netease-youdao/EmotiVoice · frontend_cn.py:77
def has_chinese_punctuation(text):
match = re.search(chinese_punctuation_pattern, text)
return match is not None
def has_english_punctuation(text):
return text in string.punctuation
# with thanks to KimigaiiWuyi in https://github.com/netease-youdao/EmotiVoice/pull/17.
# Updated on November 20, 2023: EmotiVoice now incorporates cn2an (https://github.com/Ailln/cn2an) for number processing.
re_digits = re.compile('(\d[\d\.]*)')
def number_to_chinese(number):
an2cn = An2Cn()
result = an2cn.an2cn(number)
return result
def tn_chinese(text):
parts = re_digits.split(text)
words = []