diff --git a/memory.py b/memory.py index bac5b69..ef57d52 100644 --- a/memory.py +++ b/memory.py @@ -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']))