From 0cee810b2375e72fd381b6c7b928963d05ea8ae3 Mon Sep 17 00:00:00 2001 From: WongLaw Date: Wed, 2 Nov 2022 07:03:59 +0000 Subject: [PATCH] Add rhythm tags for MFA, test=tts --- examples/other/mfa/local/generate_lexicon.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/other/mfa/local/generate_lexicon.py b/examples/other/mfa/local/generate_lexicon.py index e9445665b..3deb24701 100644 --- a/examples/other/mfa/local/generate_lexicon.py +++ b/examples/other/mfa/local/generate_lexicon.py @@ -182,12 +182,17 @@ if __name__ == "__main__": "--with-tone", action="store_true", help="whether to consider tone.") parser.add_argument( "--with-r", action="store_true", help="whether to consider erhua.") + parser.add_argument( + "--rhy-with-duration", + action="store_true", ) args = parser.parse_args() lexicon = generate_lexicon(args.with_tone, args.with_r) symbols = generate_symbols(lexicon) with open(args.output + ".lexicon", 'wt') as f: + if args.rhy_with_duration: + f.write("sp1 sp1\nsp2 sp2\nsp3 sp3\nsp4 sp4\n") for k, v in lexicon.items(): f.write(f"{k} {v}\n")