From 036f6207313b1b47ea7702ac6b521595ee53dbea Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sun, 23 Sep 2018 19:13:13 +0000 Subject: [PATCH] dashes in the query --- lib/get_answer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/get_answer.py b/lib/get_answer.py index fbc39c7..d84d3d4 100644 --- a/lib/get_answer.py +++ b/lib/get_answer.py @@ -282,7 +282,12 @@ def _get_answer_for_question(topic): Find answer for the `topic` question. """ - topic_words = topic.replace('+', ' ').strip().split() + topic_words = topic.replace('+', ' ').strip() + # some clients send queries with - instead of + so we have to rewrite them to + topic = re.sub(r"(?