RE_CONVERT_WHITESPACE = re.compile("[\0\r\n]")\r
\r
def processTextSymbols(text,expandPunctuation=False):\r
- if text:\r
- text = speechDictHandler.processText(text)\r
if (text is None) or (len(text)==0) or (isinstance(text,basestring) and (set(text)<=set(characterSymbols.blankList))):\r
return _("blank") \r
#Convert non-breaking spaces to spaces\r
text=text.replace(u'\xa0',u' ')\r
+ text = speechDictHandler.processText(text)\r
if expandPunctuation:\r
text = RE_PROCESS_SYMBOLS.sub(_processSymbol, text)\r
text = RE_CONVERT_WHITESPACE.sub(u" ", text)\r
\r
def processSymbol(symbol):\r
if isinstance(symbol,basestring):\r
- symbol=speechDictHandler.processText(symbol)\r
symbol=symbol.replace(u'\xa0',u' ')\r
newSymbol=characterSymbols.names.get(symbol,symbol)\r
return newSymbol\r