Canton phonetic fix, test=tts

pull/2950/head
WongLaw 3 years ago
parent d9b041e999
commit c15e5eecc5

@ -25,7 +25,7 @@ if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
--output_dir=${train_output_path}/test_e2e \ --output_dir=${train_output_path}/test_e2e \
--phones_dict=dump/phone_id_map.txt \ --phones_dict=dump/phone_id_map.txt \
--speaker_dict=dump/speaker_id_map.txt \ --speaker_dict=dump/speaker_id_map.txt \
--spk_id=0 \ --spk_id=10 \
--inference_dir=${train_output_path}/inference --inference_dir=${train_output_path}/inference
fi fi
@ -48,6 +48,6 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
--output_dir=${train_output_path}/test_e2e \ --output_dir=${train_output_path}/test_e2e \
--phones_dict=dump/phone_id_map.txt \ --phones_dict=dump/phone_id_map.txt \
--speaker_dict=dump/speaker_id_map.txt \ --speaker_dict=dump/speaker_id_map.txt \
--spk_id=0 \ --spk_id=10 \
--inference_dir=${train_output_path}/inference --inference_dir=${train_output_path}/inference
fi fi

@ -15,16 +15,18 @@ def check(str):
return False return False
consonants = [ INITIALS = [
'p', 'b', 't', 'd', 'ts', 'dz', 'k', 'g', 'kw', 'gw', 'f', 'h', 'l', 'm', 'aa', 'aai', 'aak', 'aap', 'aat', 'aau', 'ai', 'au', 'ap', 'at', 'ak', 'a',
'ng', 'n', 's', 'y', 'w', 'c', 'z', 'j' 'p', 'b', 'e', 'ts', 't', 'dz', 'd', 'kw', 'k', 'gw', 'g', 'f', 'h', 'l',
'm', 'ng', 'n', 's', 'y', 'w', 'c', 'z', 'j', 'ong', 'on', 'ou', 'oi', 'ok',
'o', 'uk', 'ung'
] ]
def get_lines(canton): def get_lines(canton):
for consonant in consonants: for init in INITIALS:
if canton.startswith(consonant): if canton.startswith(init):
c, v = canton[:len(consonant)], canton[len(consonant):] c, v = canton[:len(init)], canton[len(init):]
return canton + ' ' + c + ' ' + v return canton + ' ' + c + ' ' + v
return canton + ' ' + canton return canton + ' ' + canton

@ -17,4 +17,5 @@
017 佢晨早啪奶茶,同场追加奶绿,又狂怼西米露,喫啫啫猪脚煲 017 佢晨早啪奶茶,同场追加奶绿,又狂怼西米露,喫啫啫猪脚煲
018 喂!三点几嚟,饮茶先啦,做咁多都冇用嘅,老细唔锡你嘅嚟 018 喂!三点几嚟,饮茶先啦,做咁多都冇用嘅,老细唔锡你嘅嚟
019 嗱嗱声即刻走去搵嘢做,人必须知道自己嘅用途 019 嗱嗱声即刻走去搵嘢做,人必须知道自己嘅用途
020 人人都揸住枝苏格兰场非工业用国际线路自动溶雪16哇佬风油軚垂直升降镭射彩色洗衣干衣气垫毛笔一枝 020 人人都揸住枝苏格兰场非工业用国际线路自动溶雪16哇佬风油軚垂直升降镭射彩色洗衣干衣气垫毛笔一枝
021 各个国家有各个国家嘅国歌

@ -21,8 +21,10 @@ import ToJyutping
from paddlespeech.t2s.frontend.zh_normalization.text_normlization import TextNormalizer from paddlespeech.t2s.frontend.zh_normalization.text_normlization import TextNormalizer
INITIALS = [ INITIALS = [
'p', 'b', 't', 'd', 'ts', 'dz', 'k', 'g', 'kw', 'gw', 'f', 'h', 'l', 'm', 'aa', 'aai', 'aak', 'aap', 'aat', 'aau', 'ai', 'au', 'ap', 'at', 'ak', 'a',
'ng', 'n', 's', 'y', 'w', 'c', 'z', 'j' 'p', 'b', 'e', 'ts', 't', 'dz', 'd', 'kw', 'k', 'gw', 'g', 'f', 'h', 'l',
'm', 'ng', 'n', 's', 'y', 'w', 'c', 'z', 'j', 'ong', 'on', 'ou', 'oi', 'ok',
'o', 'uk', 'ung'
] ]
INITIALS += ['sp', 'spl', 'spn', 'sil'] INITIALS += ['sp', 'spl', 'spn', 'sil']

Loading…
Cancel
Save