Added wrapper classes for spell checker so new libraries can be added
This commit is contained in:
@@ -28,13 +28,13 @@ class ToHtml(Tokenizer):
|
||||
def doAutoReplace(self):
|
||||
Tokenizer.doAutoReplace(self)
|
||||
|
||||
theDict = {
|
||||
repDict = {
|
||||
"<" : "<",
|
||||
">" : ">",
|
||||
"&" : "&",
|
||||
}
|
||||
xRep = re.compile("|".join([re.escape(k) for k in theDict.keys()]), flags=re.DOTALL)
|
||||
self.theText = xRep.sub(lambda x: theDict[x.group(0)], self.theText)
|
||||
xRep = re.compile("|".join([re.escape(k) for k in repDict.keys()]), flags=re.DOTALL)
|
||||
self.theText = xRep.sub(lambda x: repDict[x.group(0)], self.theText)
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -60,11 +60,11 @@ class Tokenizer():
|
||||
|
||||
def doAutoReplace(self):
|
||||
if len(self.theProject.autoReplace) > 0:
|
||||
theDict = {}
|
||||
repDict = {}
|
||||
for aKey, aVal in self.theProject.autoReplace.items():
|
||||
theDict["<%s>" % aKey] = aVal
|
||||
xRep = re.compile("|".join([re.escape(k) for k in theDict.keys()]), flags=re.DOTALL)
|
||||
self.theText = xRep.sub(lambda x: theDict[x.group(0)], self.theText)
|
||||
repDict["<%s>" % aKey] = aVal
|
||||
xRep = re.compile("|".join([re.escape(k) for k in repDict.keys()]), flags=re.DOTALL)
|
||||
self.theText = xRep.sub(lambda x: repDict[x.group(0)], self.theText)
|
||||
return
|
||||
|
||||
def tokenizeText(self):
|
||||
|
||||
Reference in New Issue
Block a user