shukdevdatta123 commited on
Commit
47f5fb9
·
verified ·
1 Parent(s): 4d9dba9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -78,8 +78,8 @@ def translate_text(api_key, text, target_language):
78
 
79
  # Function to clean pronunciation text
80
  def clean_pronunciation(pronunciation_text):
81
- # Remove introductory phrases like "Sure! The Romaji pronunciation..."
82
- pronunciation_cleaned = re.sub(r"^Sure! The pronunciation for the text.*?is[:]*", "", pronunciation_text).strip()
83
  return pronunciation_cleaned
84
 
85
  # Function to generate audio file from text using gTTS
 
78
 
79
  # Function to clean pronunciation text
80
  def clean_pronunciation(pronunciation_text):
81
+ # Remove introductory phrases like "Certainly! The pronunciation for the Arabic text..."
82
+ pronunciation_cleaned = re.sub(r"^(Certainly!|Sure!|The pronunciation for the .+? text.*?is[:]*\s*)", "", pronunciation_text).strip()
83
  return pronunciation_cleaned
84
 
85
  # Function to generate audio file from text using gTTS