Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,12 +17,14 @@ def process_ssml_text(ssml_text):
|
|
| 17 |
|
| 18 |
for line in lines:
|
| 19 |
# Create a new line by removing all SSML tags and just using the clean text
|
| 20 |
-
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
return '\n'.join(result)
|
| 28 |
|
|
|
|
| 17 |
|
| 18 |
for line in lines:
|
| 19 |
# Create a new line by removing all SSML tags and just using the clean text
|
| 20 |
+
if "<textnorm" in line:
|
| 21 |
+
|
| 22 |
+
clean_line = re.sub(r'<textnorm[^>]*>([^<]*)</textnorm>', r'\1', line)
|
| 23 |
|
| 24 |
+
# Replace specific symbols to match the expected output
|
| 25 |
+
clean_line = clean_line.replace('A☼M', 'A※M').replace('P☼M', 'P※M')
|
| 26 |
|
| 27 |
+
result.append(clean_line)
|
| 28 |
|
| 29 |
return '\n'.join(result)
|
| 30 |
|