re-add unidecode normalization
This commit is contained in:
parent
f3b1a4f479
commit
05dd821bec
|
@ -47,6 +47,7 @@ import supybot.callbacks as callbacks
|
|||
import requests
|
||||
import re
|
||||
from ftfy import fix_text
|
||||
from unidecode import unidecode
|
||||
from bs4 import BeautifulSoup
|
||||
import jellyfish
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
|
@ -165,8 +166,8 @@ class Jeopardy(callbacks.Plugin):
|
|||
points = self.points
|
||||
if len(clue) > 1 and airdate and answer and category and not invalid and id not in self.history[channel]:
|
||||
q = "#{0}*({1}) [${2}] \x02{3}: {4}\x0F*{5}*{6}".format(id, airdate[0], str(points), category, clue, answer, points)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).encode('utf-8').decode('unicode_escape')
|
||||
self.questions.append(q)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q)).encode('utf-8').decode('unicode_escape')
|
||||
self.questions.append(unidecode(q))
|
||||
n += 1
|
||||
except Exception:
|
||||
continue
|
||||
|
@ -219,8 +220,8 @@ class Jeopardy(callbacks.Plugin):
|
|||
points = self.points
|
||||
if len(clue) > 1 and airdate and answer and category and not invalid and id not in self.history[channel]:
|
||||
q = "#{0}*({1}) [${2}] \x02{3}: {4}\x0F*{5}*{6}".format(id, airdate[0], str(points), category, clue, answer, points)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).encode('utf-8').decode('unicode_escape')
|
||||
self.questions.append(q)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q)).encode('utf-8').decode('unicode_escape')
|
||||
self.questions.append(unidecode(q))
|
||||
n += 1
|
||||
j += 1
|
||||
k += 1
|
||||
|
|
Loading…
Reference in New Issue