Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -94,11 +94,13 @@ def normalize_text(text):
|
|
| 94 |
text = text.replace("KH", "qa").replace("Z", "S")
|
| 95 |
text = text.replace("SH", "SHa'a").replace("DH", "Dha'a")
|
| 96 |
|
| 97 |
-
|
|
|
|
| 98 |
text += " " # 4 space
|
| 99 |
|
| 100 |
return text
|
| 101 |
|
|
|
|
| 102 |
def tts(text):
|
| 103 |
paragraphs = text.strip().split("\n")
|
| 104 |
audio_list = []
|
|
|
|
| 94 |
text = text.replace("KH", "qa").replace("Z", "S")
|
| 95 |
text = text.replace("SH", "SHa'a").replace("DH", "Dha'a")
|
| 96 |
|
| 97 |
+
# ➤ Haddii jumladda ku dhammaato zamzam ama samsam, ku dar faaruq (space)
|
| 98 |
+
if re.search(r'(?i)(zamzam|samsam)[\s\.\,\!\?]*$', text.strip()):
|
| 99 |
text += " " # 4 space
|
| 100 |
|
| 101 |
return text
|
| 102 |
|
| 103 |
+
|
| 104 |
def tts(text):
|
| 105 |
paragraphs = text.strip().split("\n")
|
| 106 |
audio_list = []
|