From 110d821c4d92dbbcd4559920dbbcf04aab747ce6 Mon Sep 17 00:00:00 2001 From: yerfor Date: Sun, 4 Sep 2022 14:07:22 +0800 Subject: [PATCH] fix a bug when preprocessing "?/!" --- data_gen/tts/txt_processors/zh.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data_gen/tts/txt_processors/zh.py b/data_gen/tts/txt_processors/zh.py index aa9ae73..27f833a 100644 --- a/data_gen/tts/txt_processors/zh.py +++ b/data_gen/tts/txt_processors/zh.py @@ -92,7 +92,8 @@ def process(cls, txt, pre_align_args): if ph == '|' or ph == '#': i += 1 continue - elif ph in [',', '.']: + # elif ph in [',', '.']: + elif ph in [',', '.', '?', '!']: i += 1 txt_struct[i][1].append(ph) i += 1 @@ -105,6 +106,7 @@ def process(cls, txt, pre_align_args): if __name__ == '__main__': - t = 'simon演唱过后,simon还进行了simon精彩的文艺演出simon.' + # t = 'simon演唱过后,simon还进行了simon精彩的文艺演出simon.' + t = '你当我傻啊?脑子那么大怎么塞进去???' phs, txt = TxtProcessor.process(t, {'use_tone': True}) print(phs, txt)