add fix for 3 chinese chars, and 2nd char tone should not be 5, test=tts

pull/2369/head
david.95 3 years ago
parent b9758adb21
commit 7edc39d03c

@ -156,7 +156,8 @@ class ToneSandhi():
return finals
def _split_word(self, word: str) -> List[str]:
if len(word)==3 and word[-1:] =='': # three chars, like 老头子,the second char tone should not be 5
if len(word) == 3 and word[
-1:] == '': # three chars, like 老头子,the second char tone should not be 5
return [word]
word_list = jieba.cut_for_search(word)
word_list = sorted(word_list, key=lambda i: len(i), reverse=False)

Loading…
Cancel
Save