mirror of
https://github.com/chubin/cheat.sh.git
synced 2026-06-20 21:26:44 +02:00
dashes in the query
This commit is contained in:
+6
-1
@@ -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"(?<!-)-", ' ', topic)
|
||||
|
||||
topic_words = topic.split()
|
||||
|
||||
topic = " ".join(topic_words)
|
||||
|
||||
lang = 'en'
|
||||
|
||||
Reference in New Issue
Block a user