Skip to content

Commit 036f620

Browse files
committed
dashes in the query
1 parent 7771269 commit 036f620

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/get_answer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,12 @@ def _get_answer_for_question(topic):
282282
Find answer for the `topic` question.
283283
"""
284284

285-
topic_words = topic.replace('+', ' ').strip().split()
285+
topic_words = topic.replace('+', ' ').strip()
286+
# some clients send queries with - instead of + so we have to rewrite them to
287+
topic = re.sub(r"(?<!-)-", ' ', topic)
288+
289+
topic_words = topic.split()
290+
286291
topic = " ".join(topic_words)
287292

288293
lang = 'en'

0 commit comments

Comments
 (0)