sanjay7178 commited on
Commit
d48a95f
·
verified ·
1 Parent(s): 92913f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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
- clean_line = re.sub(r'<textnorm[^>]*>([^<]*)</textnorm>', r'\1', line)
 
 
21
 
22
- # Replace specific symbols to match the expected output
23
- clean_line = clean_line.replace('A☼M', 'A※M').replace('P☼M', 'P※M')
24
 
25
- result.append(clean_line)
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