Update cleaner.py (#1472)

删除不必要的循环
This commit is contained in:
Strive-for-excellence 2024-08-14 22:17:20 +08:00 committed by GitHub
parent 24ccc892af
commit b3e8eb40c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,9 +50,7 @@ def clean_text(text, language, version=None):
else:
phones = language_module.g2p(norm_text)
word2ph = None
for ph in phones:
phones = ['UNK' if ph not in symbols else ph for ph in phones]
phones = ['UNK' if ph not in symbols else ph for ph in phones]
return phones, word2ph, norm_text