Update tone_sandhi.py

pull/3972/head
张春乔 8 months ago committed by GitHub
parent 058950dae8
commit 6757cec50b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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"

Loading…
Cancel
Save