Meilleure recherche
This commit is contained in:
parent
c61098c06c
commit
5cae58907c
3
pages.py
3
pages.py
|
@ -81,7 +81,8 @@ def search(texte):
|
|||
r = 1
|
||||
if key=="nom":
|
||||
r = 3
|
||||
i["score"] += SequenceMatcher(None, texte, str(i[key])).ratio()*r
|
||||
i["score"] += SequenceMatcher(None, texte.lower(), str(i[key]).lower()).ratio()*r
|
||||
print(i["nom"],i["score"])
|
||||
totals.sort(key=lambda x : x["score"])
|
||||
totals.reverse()
|
||||
totals = totals[:8]
|
||||
|
|
Loading…
Reference in New Issue