Finally implement the search
This commit is contained in:
parent
a0bba7173f
commit
a3d3305d4b
1 changed files with 1 additions and 3 deletions
|
@ -60,6 +60,4 @@ def scalar(a, b):
|
||||||
|
|
||||||
def find_best_quote(db, user_input):
|
def find_best_quote(db, user_input):
|
||||||
indexed_input = index(user_input)
|
indexed_input = index(user_input)
|
||||||
max_score = None
|
return max(db, key=lambda row: scalar(indexed_input, row['index']))
|
||||||
for entry in db:
|
|
||||||
score = scalar(indexed_input, entry
|
|
||||||
|
|
Loading…
Reference in a new issue