Update punctuationManager.py

This commit is contained in:
chrys87 2016-09-22 16:53:31 +02:00 committed by GitHub
parent 217ec6a2c0
commit 5550d31b58

View File

@ -32,7 +32,7 @@ class punctuationManager():
def removeUnused(self, text): def removeUnused(self, text):
return text.translate(text.maketrans(string.punctuation, ' '*len(string.punctuation))) return text.translate(text.maketrans(string.punctuation, ' '*len(string.punctuation)))
def useCustomDict(self, text, customDict): def useCustomDict(self, text, customDict):
resultText = text resultText = str(text)
if customDict: if customDict:
for key,item in customDict.items(): for key,item in customDict.items():
resultText = resultText.replace(str(key),str(item)) resultText = resultText.replace(str(key),str(item))