chat: Fix crash
This commit is contained in:
parent
f9c4a31271
commit
33918d1ec0
1 changed files with 4 additions and 1 deletions
|
@ -14,7 +14,10 @@ class WhiteList:
|
||||||
self.numWords = len(self.words)
|
self.numWords = len(self.words)
|
||||||
|
|
||||||
def cleanText(self, text):
|
def cleanText(self, text):
|
||||||
text = text.decode('utf-8').strip('.,?!')
|
if type(text) == bytes:
|
||||||
|
text = text.decode('utf-8').strip('.,?!')
|
||||||
|
else:
|
||||||
|
text = text.strip('.,?!')
|
||||||
text = text.lower().encode('utf-8')
|
text = text.lower().encode('utf-8')
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue