Spaces:
Running
Running
Update app.py
Browse files
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 "
|
82 |
-
pronunciation_cleaned = re.sub(r"^Sure
|
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
|