尝试修复混合模式下短单词发音不清晰的问题 (#1286)

* Add pause before short words

* Add 'conda'
This commit is contained in:
KamioRinn 2024-07-10 10:11:09 +08:00 committed by GitHub
parent 95d3c0d220
commit 46cd596027
2 changed files with 7 additions and 1 deletions

View File

@ -22,6 +22,11 @@ def clean_text(text, language):
phones, word2ph = language_module.g2p(norm_text)
assert len(phones) == sum(word2ph)
assert len(norm_text) == len(word2ph)
elif language == "en":
phones = language_module.g2p(norm_text)
if len(phones) < 4:
phones = [','] * (4 - len(phones)) + phones
word2ph = None
else:
phones = language_module.g2p(norm_text)
word2ph = None

View File

@ -1,2 +1,3 @@
CHATGPT CH AE1 T JH IY1 P IY1 T IY1
JSON JH EY1 S AH0 N
JSON JH EY1 S AH0 N
CONDA K AA1 N D AH0