Skip to content

Commit

Permalink
partial results are sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkokotila committed Apr 20, 2024
1 parent 742c468 commit eae8cd6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dictionary_lookup/DictionaryLookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def _query(self,
if query in list(out.keys()) is False:
out[query] = None

if partial_match:
out = {key: out[key] for key in sorted(out, key=lambda x: len(x))}

if fuzzy_match:

from .utils.fuzzy_matching import fuzzy_matching
Expand Down

0 comments on commit eae8cd6

Please sign in to comment.