ignore whitespace in search

This commit is contained in:
flukx 2024-08-26 18:58:05 +02:00
parent 90457a8237
commit 04e1785e27

View file

@ -88,7 +88,8 @@ async def find_things(
Returns:
list of things that somehow include the search string
"""
fuzzy = re.compile(".*" + ".*".join(search_string) + ".*", flags=re.IGNORECASE)
fuzzy = re.compile(".*" + ".*".join(map(str.strip, search_string)) + ".*",
flags=re.IGNORECASE)
score_categories = ("startswith", "startswithLower", "inLower", "fuzzy")
def match_score_one_string(string: Optional[str]) -> dict[str, float]: