Finally implement the search

This commit is contained in:
Tissevert 2024-03-16 15:50:38 +01:00
parent a0bba7173f
commit a3d3305d4b

View file

@ -60,6 +60,4 @@ def scalar(a, b):
def find_best_quote(db, user_input):
indexed_input = index(user_input)
max_score = None
for entry in db:
score = scalar(indexed_input, entry
return max(db, key=lambda row: scalar(indexed_input, row['index']))