Skip to content

Commit 0735e65

Browse files
Merge pull request #103 from jimregan/mmconv-cleaner
add a cleaner for IPA data (pre-phonetised)
2 parents f9843cf + 863bfbd commit 0735e65

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

matcha/text/cleaners.py

+14
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,20 @@ def english_cleaners2(text):
114114
return phonemes
115115

116116

117+
def ipa_simplifier(text):
118+
replacements = [
119+
("ɐ", "ə"),
120+
("ˈə", "ə"),
121+
("ʤ", "dʒ"),
122+
("ʧ", "tʃ"),
123+
("ᵻ", "ɪ"),
124+
]
125+
for replacement in replacements:
126+
text = text.replace(replacement[0], replacement[1])
127+
phonemes = collapse_whitespace(text)
128+
return phonemes
129+
130+
117131
# I am removing this due to incompatibility with several version of python
118132
# However, if you want to use it, you can uncomment it
119133
# and install piper-phonemize with the following command:

0 commit comments

Comments
 (0)