From c3019bfe25875c6352c6fa4a02179a82d5dc5d28 Mon Sep 17 00:00:00 2001 From: WongLaw Date: Fri, 24 Feb 2023 01:52:26 +0000 Subject: [PATCH] Canton phonetic fix, test=tts --- paddlespeech/t2s/frontend/canton_frontend.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/paddlespeech/t2s/frontend/canton_frontend.py b/paddlespeech/t2s/frontend/canton_frontend.py index 350e55935..f2c7175fe 100644 --- a/paddlespeech/t2s/frontend/canton_frontend.py +++ b/paddlespeech/t2s/frontend/canton_frontend.py @@ -34,8 +34,13 @@ def get_lines(cantons: List[str]): for canton in cantons: for consonant in INITIALS: if canton.startswith(consonant): - c, v = canton[:len(consonant)], canton[len(consonant):] - phones = phones + [c, v] + if canton.startswith("nga"): + c, v = canton[:len(consonant)], canton[len(consonant):] + phones = phones + [canton[2:]] + else: + c, v = canton[:len(consonant)], canton[len(consonant):] + phones = phones + [c, v] + break return phones