Jeopardy: question regex tweak

This commit is contained in:
Gordon Shumway 2020-02-21 17:32:50 -05:00 committed by GitHub
parent efb40612ff
commit 27b9642b29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,7 +271,7 @@ class Jeopardy(callbacks.Plugin):
def normalize(self, q):
q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).replace(r"\'", "'").replace(r'\"', '"')
q = re.sub('([,;:.!?)])([a-zA-Z]|\"|\'|\()(?![.\'])', '\g<1> \g<2>', q)
q = re.sub('([,;:.!?)])([a-zA-Z]|\()(?![.\'])', '\g<1> \g<2>', q)
q = " ".join(q.split())
return q