From 931fd226babe69b35c6e3a6a288e5e0c901736a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=AE=AA=E8=B1=AA?= Date: Fri, 6 May 2022 16:54:31 +0800 Subject: [PATCH] reformat --- espnet2/text/phoneme_tokenizer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/espnet2/text/phoneme_tokenizer.py b/espnet2/text/phoneme_tokenizer.py index 3af10ac6b94..4580cc5d726 100644 --- a/espnet2/text/phoneme_tokenizer.py +++ b/espnet2/text/phoneme_tokenizer.py @@ -200,7 +200,9 @@ def pypinyin_g2p_phone(text) -> List[str]: for p in [ get_initials(phone[0], strict=True), # When using the new pypinyin, the previous code will drop the finals - get_finals(phone[0][:-1], strict=True) + phone[0][-1] if phone[0][-1].isdigit() else get_finals(phone[0], strict=True), + get_finals(phone[0][:-1], strict=True) + phone[0][-1] + if phone[0][-1].isdigit() + else get_finals(phone[0], strict=True), ] # Remove the case of individual tones as a phoneme if len(p) != 0 and not p.isdigit()