Jeopardy: regex tweaks.
This commit is contained in:
parent
46965ab1bb
commit
3619fdb8cf
|
|
@ -164,6 +164,7 @@ class Jeopardy(callbacks.Plugin):
|
|||
q = "{0}*({1}) [${2}] \x02{3}: {4}\x0F*{5}*{6}".format(id, airdate, points, category, clue, answer, points)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).encode('utf-8').decode('unicode_escape')
|
||||
q = re.sub('([,;:.!?])(\w|\"|\'|\()(?!\.)', '\g<1> \g<2>', q)
|
||||
q = re.sub('(\$\d+[,.]) (\d+)', '\g<1>\g<2>', q)
|
||||
q = " ".join(q.split())
|
||||
self.questions.append(q)
|
||||
asked.append(id)
|
||||
|
|
@ -173,6 +174,7 @@ class Jeopardy(callbacks.Plugin):
|
|||
q = "{0}*({1}) [${2}] \x02{3}: {4}\x0F*{5}*{6}".format(id, airdate, points, category, clue, answer, points)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).encode('utf-8').decode('unicode_escape')
|
||||
q = re.sub('([,;:.!?])(\w|\"|\'|\()(?!\.)', '\g<1> \g<2>', q)
|
||||
q = re.sub('(\$\d+[,.]) (\d+)', '\g<1>\g<2>', q)
|
||||
q = " ".join(q.split())
|
||||
self.questions.append(q)
|
||||
asked.append(id)
|
||||
|
|
@ -231,6 +233,7 @@ class Jeopardy(callbacks.Plugin):
|
|||
q = "{0}*({1}) [${2}] \x02{3}: {4}\x0F*{5}*{6}".format(id, airdate, points, category, clue, answer, points)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).encode('utf-8').decode('unicode_escape')
|
||||
q = re.sub('([,;:.!?])(\w|\"|\'|\()(?!\.)', '\g<1> \g<2>', q)
|
||||
q = re.sub('(\$\d+[,.]) (\d+)', '\g<1>\g<2>', q)
|
||||
q = " ".join(q.split())
|
||||
self.questions.append(q)
|
||||
asked.append(id)
|
||||
|
|
@ -241,6 +244,7 @@ class Jeopardy(callbacks.Plugin):
|
|||
q = "{0}*({1}) [${2}] \x02{3}: {4}\x0F*{5}*{6}".format(id, airdate, points, category, clue, answer, points)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).encode('utf-8').decode('unicode_escape')
|
||||
q = re.sub('([,;:.!?])(\w|\"|\'|\()(?!\.)', '\g<1> \g<2>', q)
|
||||
q = re.sub('(\$\d+[,.]) (\d+)', '\g<1>\g<2>', q)
|
||||
q = " ".join(q.split())
|
||||
self.questions.append(q)
|
||||
asked.append(id)
|
||||
|
|
|
|||
Loading…
Reference in New Issue