Update docstring for clean_gruut_phonemes

This commit is contained in:
Michael Hansen 2021-06-10 10:08:01 -04:00 committed by Eren Gölge
parent 07e8ff193a
commit da6f6a4a01
1 changed files with 13 additions and 5 deletions

View File

@ -34,13 +34,21 @@ GRUUT_TRANS_TABLE = str.maketrans("g", "ɡ")
def clean_gruut_phonemes(ph_list): def clean_gruut_phonemes(ph_list):
"""Decompose, substitute, and clean gruut phonemes for TTS. """Decompose, substitute, and clean gruut phonemes for TTS.
Parameters: gruut phonemes may contain any IPA characters (e.g., "" for the nasalized
ph_list (list[str]): list of phonemes from gruut "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: Returns:
clean_list (list[str]): decomposed/clean list of phonemes for TTS 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)
""" """
cleaned_phonemes = [] cleaned_phonemes = []