Update english.py

This commit is contained in:
Cosmo Clara 2024-10-18 01:07:25 +08:00 committed by GitHub
parent 5aeb544c90
commit 6520951c74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -237,6 +237,7 @@ def text_normalize(text):
text = normalize_numbers(text)
text = ''.join(char for char in unicodedata.normalize('NFD', text)
if unicodedata.category(char) != 'Mn') # Strip accents
text = re.sub("%", " percent", text) # 将 % 转化为 “percent”
text = re.sub("[^ A-Za-z'.,?!\-]", "", text)
text = re.sub(r"(?i)i\.e\.", "that is", text)
text = re.sub(r"(?i)e\.g\.", "for example", text)