Jeopardy: minor regex tweak.
This commit is contained in:
parent
657ee74863
commit
2292e5fe9d
|
|
@ -169,7 +169,7 @@ class Jeopardy(callbacks.Plugin):
|
|||
if clue and airdate and answer and category and not invalid and id not in asked and id not in self.history[channel]:
|
||||
q = "{0}|{1}|{2}|{3}|{4}|{5}".format(id, airdate, points, category, clue, answer)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).replace(r"\'", "'").replace(r'\"', '"')
|
||||
q = re.sub('([,;:.!?])(\w|\"|\'|\()(?![.\'])', '\g<1> \g<2>', q)
|
||||
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)
|
||||
|
|
@ -179,7 +179,7 @@ class Jeopardy(callbacks.Plugin):
|
|||
if clue and airdate and answer and category and not invalid and id not in asked:
|
||||
q = "{0}|{1}|{2}|{3}|{4}|{5}".format(id, airdate, points, category, clue, answer)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).replace(r"\'", "'").replace(r'\"', '"')
|
||||
q = re.sub('([,;:.!?])(\w|\"|\'|\()(?![.\'])', '\g<1> \g<2>', q)
|
||||
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)
|
||||
|
|
@ -238,7 +238,7 @@ class Jeopardy(callbacks.Plugin):
|
|||
if clue and airdate and answer and category and not invalid and id not in asked and id not in self.history[channel]:
|
||||
q = "{0}|{1}|{2}|{3}|{4}|{5}".format(id, airdate, points, category, clue, answer)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).replace(r"\'", "'").replace(r'\"', '"')
|
||||
q = re.sub('([,;:.!?])(\w|\"|\'|\()(?![.\'])', '\g<1> \g<2>', q)
|
||||
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)
|
||||
|
|
@ -249,7 +249,7 @@ class Jeopardy(callbacks.Plugin):
|
|||
if clue and airdate and answer and category and not invalid and id not in asked:
|
||||
q = "{0}|{1}|{2}|{3}|{4}|{5}".format(id, airdate, points, category, clue, answer)
|
||||
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).replace(r"\'", "'").replace(r'\"', '"')
|
||||
q = re.sub('([,;:.!?])(\w|\"|\'|\()(?![.\'])', '\g<1> \g<2>', q)
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue