fuzzy matching su tmdb per un più preciso riconoscimento

This commit is contained in:
mac12m99
2021-02-07 11:54:15 +01:00
parent 59ba64a5e0
commit a180136f8c
4 changed files with 268 additions and 0 deletions
+5
View File
@@ -1018,6 +1018,11 @@ class Tmdb(object):
% (buscando, len(results), page, index_results))
return 0
# We sort result based on fuzzy match to detect most similar
if len(results) > 1:
from lib.fuzzy_match import algorithims
results.sort(key=lambda r: algorithims.trigram(text_simple, r['title']), reverse=True)
# We return the number of results of this page
self.results = results
self.total_results = total_results