Skip to content

Commit 8304cc2

Browse files
authored
Date parser fix (#21)
* Fixed a weird date parser bug. Strings like '03 Marble' should be pronounced properly now * Fixed UK formatted dates * Added a missing abbreviation for September
1 parent 4f4ce06 commit 8304cc2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

addon/synthDrivers/ibmeci.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ def unicode(s): return s
3838
# Does not occur in normal use, however if a dictionary entry contains the Mc prefix, and NVDA splits it up, the synth will crash.
3939
# Also fixes ViaVoice, as the parser is more strict there and doesn't like spaces in Mc names.
4040
re.compile(r"\b(Mc)\s+([A-Z][a-z]+)"): r"\1\2",
41+
# Fixes a weird issue with the date parser. Without this fix, strings like "03 Marble" will be pronounced as "march threerd ble".
42+
re.compile(r"\b(\d+) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Sept|Oct|Nov|Dec)([a-z]+)"): r"\1 \2\3",
43+
# Don't break UK formatted dates.
44+
re.compile(r"\b(\d+) (January|February|March|April|May|June|July|August|September|October|November|December)"): r"\1 \2",
4145
# Crash words, formerly part of anticrash_res.
4246
re.compile(r'\b(.*?)c(ae|\xe6)sur(e)?', re.I): r'\1seizur',
4347
re.compile(r"\b(|\d+|\W+)h'(r|v)[e]", re.I): r"\1h \2e",

0 commit comments

Comments
 (0)