Skip to content

Commit

Permalink
Added nofetch token for queries
Browse files Browse the repository at this point in the history
  • Loading branch information
fbanados committed Nov 27, 2024
1 parent 4b8c87b commit 0ae5de2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/morphodict/search/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def treat_query(query_string):


class Query:
BOOL_KEYS = ["verbose", "auto", "espt"]
BOOL_KEYS = ["verbose", "auto", "espt", "nofetch"]

def __init__(self, query_string):
self.raw_query_string = query_string
Expand Down Expand Up @@ -94,3 +94,4 @@ def __repr__(self) -> str:
auto: Optional[bool] = None
cvd: Optional[CvdSearchType] = None
espt: Optional[bool] = None
nofetch: Optional[bool] = None
3 changes: 2 additions & 1 deletion src/morphodict/search/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def sort_by_cvd(r: Result):
# go and perform the search.

# First, fetch keyword-based and FST-based orthography-relaxed results
fetch_results(search_query, search_results)
if not search_query.nofetch:
fetch_results(search_query, search_results)

# If allowed, add affix search candidates
if (
Expand Down

0 comments on commit 0ae5de2

Please sign in to comment.