remove duplicate spaces

This commit is contained in:
KamioRinn 2025-06-27 11:15:34 +08:00
parent ed96ffd752
commit 05bcf9c859
3 changed files with 187 additions and 187 deletions

View File

@ -121,7 +121,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):
with self.bert_lock: with self.bert_lock:
if language in {"all_zh", "all_yue", "all_ja", "all_ko", "zh", "ja", "ko", "yue", "en", "auto", "auto_yue"}: text = re.sub(r' {2,}', ' ', text)
textlist = [] textlist = []
langlist = [] langlist = []
if language == "all_zh": if language == "all_zh":

View File

@ -586,7 +586,7 @@ from text import chinese
def get_phones_and_bert(text, language, version, final=False): def get_phones_and_bert(text, language, version, final=False):
if language in {"all_zh", "all_yue", "all_ja", "all_ko", "zh", "ja", "ko", "yue", "en", "auto", "auto_yue"}: text = re.sub(r' {2,}', ' ', text)
textlist = [] textlist = []
langlist = [] langlist = []
if language == "all_zh": if language == "all_zh":

2
api.py
View File

@ -532,7 +532,7 @@ from text import chinese
def get_phones_and_bert(text, language, version, final=False): def get_phones_and_bert(text, language, version, final=False):
if language in {"all_zh", "all_yue", "all_ja", "all_ko", "zh", "ja", "ko", "yue", "en", "auto", "auto_yue"}: text = re.sub(r' {2,}', ' ', text)
textlist = [] textlist = []
langlist = [] langlist = []
if language == "all_zh": if language == "all_zh":