Spaces:
Running
Running
Yurii Paniv
commited on
Commit
·
86e7d18
1
Parent(s):
9601b1b
Bugfixes
Browse files
ukrainian_tts/formatter.py
CHANGED
@@ -24,8 +24,8 @@ def preprocess_text(text):
|
|
24 |
"—": "-",
|
25 |
"―": "-",
|
26 |
}
|
27 |
-
for symbol in symbols.
|
28 |
-
text = text.replace(symbol,
|
29 |
# numbers
|
30 |
text = re.sub(r"(\d)\s+(\d)", r"\1\2", text)
|
31 |
|
@@ -92,9 +92,9 @@ def preprocess_text(text):
|
|
92 |
"y": "і",
|
93 |
"z": "з",
|
94 |
}
|
95 |
-
for english_char in english.keys():
|
96 |
# uppercase
|
97 |
-
text = text.replace(english_char.upper(),
|
98 |
-
text = text.replace(english_char,
|
99 |
|
100 |
return text
|
|
|
24 |
"—": "-",
|
25 |
"―": "-",
|
26 |
}
|
27 |
+
for symbol, value in symbols.items():
|
28 |
+
text = text.replace(symbol, value)
|
29 |
# numbers
|
30 |
text = re.sub(r"(\d)\s+(\d)", r"\1\2", text)
|
31 |
|
|
|
92 |
"y": "і",
|
93 |
"z": "з",
|
94 |
}
|
95 |
+
for english_char, english_value in english.keys():
|
96 |
# uppercase
|
97 |
+
text = text.replace(english_char.upper(), english_value.upper())
|
98 |
+
text = text.replace(english_char, english_value)
|
99 |
|
100 |
return text
|