Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -217,6 +217,8 @@ def text_to_ipa(text, language=language):
|
|
| 217 |
preserve_punctuation=True,
|
| 218 |
with_stress=True
|
| 219 |
)
|
|
|
|
|
|
|
| 220 |
return ipa_text #preserve_case(text, ipa_text)
|
| 221 |
except Exception as e:
|
| 222 |
print(f"Error processing text: {text}. Error: {e}")
|
|
|
|
| 217 |
preserve_punctuation=True,
|
| 218 |
with_stress=True
|
| 219 |
)
|
| 220 |
+
# Remove language markings like (en), (cmn), (de), (pl), (ru)
|
| 221 |
+
ipa_text = re.sub(r'\([a-z]{2,3}\)', '', ipa_text)
|
| 222 |
return ipa_text #preserve_case(text, ipa_text)
|
| 223 |
except Exception as e:
|
| 224 |
print(f"Error processing text: {text}. Error: {e}")
|