Gregniuki commited on
Commit
9d6b4a7
·
verified ·
1 Parent(s): 2f2f8bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
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}")