Merge pull request #103 from jimregan/mmconv-cleaner

add a cleaner for IPA data (pre-phonetised)
This commit is contained in:
Shivam Mehta
2024-11-13 22:15:47 -08:00
committed by GitHub

View File

@@ -114,6 +114,20 @@ def english_cleaners2(text):
return phonemes return phonemes
def ipa_simplifier(text):
replacements = [
("ɐ", "ə"),
("ˈə", "ə"),
("ʤ", ""),
("ʧ", ""),
("", "ɪ"),
]
for replacement in replacements:
text = text.replace(replacement[0], replacement[1])
phonemes = collapse_whitespace(text)
return phonemes
# I am removing this due to incompatibility with several version of python # I am removing this due to incompatibility with several version of python
# However, if you want to use it, you can uncomment it # However, if you want to use it, you can uncomment it
# and install piper-phonemize with the following command: # and install piper-phonemize with the following command: