Update TextPreprocessor.py

删除了英文预处理的过滤器
This commit is contained in:
Cosmo Clara 2024-10-31 18:32:10 +08:00 committed by GitHub
parent 331d176798
commit c315203dcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,12 +119,7 @@ class TextPreprocessor:
def get_phones_and_bert(self, text:str, language:str, version:str, final:bool=False): def get_phones_and_bert(self, text:str, language:str, version:str, final:bool=False):
if language in {"en", "all_zh", "all_ja", "all_ko", "all_yue"}: if language in {"en", "all_zh", "all_ja", "all_ko", "all_yue"}:
language = language.replace("all_","") language = language.replace("all_","")
if language == "en": formattext = text
LangSegment.setfilters(["en"])
formattext = " ".join(tmp["text"] for tmp in LangSegment.getTexts(text))
else:
# 因无法区别中日韩文汉字,以用户输入为准
formattext = text
while " " in formattext: while " " in formattext:
formattext = formattext.replace(" ", " ") formattext = formattext.replace(" ", " ")
if language == "zh": if language == "zh":