From da6f6a4a01763256341cc55e633f55c47f49ce2b Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Thu, 10 Jun 2021 10:08:01 -0400 Subject: [PATCH] Update docstring for clean_gruut_phonemes --- TTS/tts/utils/text/__init__.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/TTS/tts/utils/text/__init__.py b/TTS/tts/utils/text/__init__.py index 14319c44..3d2f5004 100644 --- a/TTS/tts/utils/text/__init__.py +++ b/TTS/tts/utils/text/__init__.py @@ -34,13 +34,21 @@ GRUUT_TRANS_TABLE = str.maketrans("g", "ɡ") def clean_gruut_phonemes(ph_list): """Decompose, substitute, and clean gruut phonemes for TTS. - Parameters: - ph_list (list[str]): list of phonemes from gruut + gruut phonemes may contain any IPA characters (e.g., "ẽ" for the nasalized + "e"), and may be composed of multiple characters (e.g., "aɪ" in the English + "r[i]ce"). + + TTS phonemes come from a fixed set of symbols, and do not include every + possible variation of every vowel/consonant. Here, we decompose dipthongs, + etc. into single characters and then filter out Unicode combining characters + such as ties. This ensures that (most) phonemes will exist in the TTS symbol + table. + + Args: + ph_list (list[str]): list of phonemes from gruut Returns: - clean_list (list[str]): decomposed/clean list of phonemes for TTS - Dipthongs, etc. are decomposed into single characters - Unicode combining characters are removed (e.g., ties) + clean_list (list[str]): decomposed/clean list of phonemes for TTS """ cleaned_phonemes = []