|
|
|
@ -30,11 +30,7 @@ def unescape_html(chatbot, statement):
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
# Replace HTML escape characters
|
|
|
|
|
if sys.version_info[0] < 3:
|
|
|
|
|
from HTMLParser import HTMLParser
|
|
|
|
|
html = HTMLParser()
|
|
|
|
|
else:
|
|
|
|
|
import html
|
|
|
|
|
import html
|
|
|
|
|
|
|
|
|
|
statement.text = html.unescape(statement.text)
|
|
|
|
|
|
|
|
|
@ -49,9 +45,6 @@ def convert_to_ascii(chatbot, statement):
|
|
|
|
|
import unicodedata
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
# Normalize unicode characters
|
|
|
|
|
if sys.version_info[0] < 3:
|
|
|
|
|
statement.text = unicode(statement.text) # NOQA
|
|
|
|
|
|
|
|
|
|
text = unicodedata.normalize('NFKD', statement.text)
|
|
|
|
|
text = text.encode('ascii', 'ignore').decode('utf-8')
|
|
|
|
|