Jeopardy: Normalize whitespace.

This commit is contained in:
oddluck 2020-02-02 12:48:00 +00:00
parent 3018ec832e
commit 7d6a37a043
1 changed files with 2 additions and 0 deletions

View File

@ -166,6 +166,7 @@ class Jeopardy(callbacks.Plugin):
if len(clue) > 1 and airdate and answer and category and not invalid and id not in self.history[channel]: 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 = "#{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') q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).encode('utf-8').decode('unicode_escape')
q = " ".join(q.split())
self.questions.append(q) self.questions.append(q)
n += 1 n += 1
except Exception: except Exception:
@ -220,6 +221,7 @@ class Jeopardy(callbacks.Plugin):
if len(clue) > 1 and airdate and answer and category and not invalid and id not in self.history[channel]: 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 = "#{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') q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).encode('utf-8').decode('unicode_escape')
q = " ".join(q.split())
self.questions.append(q) self.questions.append(q)
n += 1 n += 1
j += 1 j += 1