309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
+
+
-
+
|
sText = self.sText
if " " in sText:
sText = sText.replace(" ", ' ') # nbsp
if " " in sText:
sText = sText.replace(" ", ' ') # nnbsp
if "'" in sText:
sText = sText.replace("'", "’")
if "‐" in sText:
sText = sText.replace("‐", "-") # Hyphen (U+2010)
if "‑" in sText:
sText = sText.replace("‑", "-") # nobreakdash
sText = sText.replace("‑", "-") # Non-Breaking Hyphen (U+2011)
if "@@" in sText:
sText = re.sub("@@+", "", sText)
return sText
def parseText (self, sText, sText0, bParagraph, nOffset, sCountry, dOptions, bShowRuleId, bDebug, bContext):
"parse the text with rules"
bChange = False
|