Unverified Commit 6c85468c authored by Ben Busby's avatar Ben Busby
Browse files

Allow bang operator anywhere in query

Bang operator can now be placed anywhere in the query, to allow for peak
efficiency in stream of consciousness querying (i.e. `big !reddit
chungus` will search reddit for big chungus`).

Fixes #196
parent e066a194
......@@ -71,8 +71,9 @@ class RoutingUtils:
return self.query
def bang_operator(self, bangs_dict: dict) -> str:
split_query = self.query.split(' ')
for operator in bangs_dict.keys():
if self.query.split(' ')[0] != operator:
if operator not in split_query:
continue
return bangs_dict[operator]['url'].format(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment