mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-05-21 22:02:32 +08:00
Fix g2pw bug (#1872)
This commit is contained in:
parent
a70e1ad30c
commit
793b0043de
@ -144,11 +144,16 @@ def read_dict():
|
|||||||
return polyphonic_dict
|
return polyphonic_dict
|
||||||
|
|
||||||
|
|
||||||
def correct_pronunciation(word,word_pinyins):
|
def correct_pronunciation(word, word_pinyins):
|
||||||
if word in pp_dict:
|
new_pinyins = pp_dict.get(word, "")
|
||||||
word_pinyins = pp_dict[word]
|
if new_pinyins == "":
|
||||||
|
for idx, w in enumerate(word):
|
||||||
return word_pinyins
|
w_pinyin = pp_dict.get(w, "")
|
||||||
|
if w_pinyin != "":
|
||||||
|
word_pinyins[idx] = w_pinyin[0]
|
||||||
|
return word_pinyins
|
||||||
|
else:
|
||||||
|
return new_pinyins
|
||||||
|
|
||||||
|
|
||||||
pp_dict = get_dict()
|
pp_dict = get_dict()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user