Skip to content

Commit 8105bd3

Browse files
committed
Tried to work around situations where IBMTTS would say 'comma hundred' or other weird things in English if numbers are separated by commas
1 parent edb3187 commit 8105bd3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

addon/synthDrivers/ibmeci.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@
9292
re.compile(br"(\d+)(\.+)(\d+)(\.+)(0{2,})(\.\d*)\s*\.*([-+*^/])", re.I): br"\1\2\3\4 \5\6\7",
9393
re.compile(br"(\d+)\s*([-+*^/])\s*(\d+)(,)(00\b)", re.I): br"\1\2\3\4 \5",
9494
re.compile(br"(\d+)\s*([-+*^/])\s*(\d+)(,)(0{4,})", re.I): br"\1\2\3\4 \5",
95+
#Work around various bugs where the synth can say "comma hundred" or other similarly weird things if numbers are separated by commas by removing them in some situations. These expressions aren't perfect, but should generally work.
96+
re.compile(br'\b(\d{1,3}),(000),(\d{1,3})\b'): br'\1\2\3',
97+
re.compile(br'\b(\d{1,3}),(000),(\d{1,3}),(\d{1,3})\b'): br'\1\2\3\4',
98+
re.compile(br'\b(\d{1,3}),(000),(\d{1,3}),(\d{1,3}),(\d{1,3})\b'): br'\1\2\3\4\5',
99+
re.compile(br'\b(\d{1,3}),(000),(\d{1,3}),(\d{1,3}),(\d{1,3}),(\d{1,3})\b'): br'\1\2\3\4\5\6',
95100
}
96101
spanish_fixes = {
97102
# Euros

0 commit comments

Comments
 (0)