From 6757cec50b93708bc06d8e7c4b2171bb91d0635e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Tue, 21 Jan 2025 22:26:35 +0800 Subject: [PATCH] Update tone_sandhi.py --- paddlespeech/t2s/frontend/tone_sandhi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddlespeech/t2s/frontend/tone_sandhi.py b/paddlespeech/t2s/frontend/tone_sandhi.py index ec1b61302..bc021d5aa 100644 --- a/paddlespeech/t2s/frontend/tone_sandhi.py +++ b/paddlespeech/t2s/frontend/tone_sandhi.py @@ -268,7 +268,7 @@ class ToneSandhi(): for (word, pos) in seg: orig_finals = lazy_pinyin( word, neutral_tone_with_five=True, style=Style.FINALS_TONE3) - # after pypinyin==0.41.0, 嗯 will be processed as "", so we need to change it to "n2" + # after pypinyin==0.44.0, '嗯' need to be n2, cause the initial and final consonants cannot be empty at the same time en_index = [index for index, c in enumerate(word) if c == "嗯"] for i in en_index: orig_finals[i] = "n2"