[Zope3-checkins] CVS: Zope3/lib/python/Zope/TextIndex - NBest.py:1.2
Guido van Rossum
guido@python.org
Tue, 3 Dec 2002 15:40:30 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/TextIndex
In directory cvs.zope.org:/tmp/cvs-serv18951
Modified Files:
NBest.py
Log Message:
During testing of TextIndexWrapper, Christian Zagrodnick noticed a bug
in NBest, which makes repeating a query with a larger N return
inconsistent results when the scores are the same. I've added a test
for this (testAllSameScore()) and a fix, which is using bisect_left()
instead of bisect_right().
=== Zope3/lib/python/Zope/TextIndex/NBest.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/TextIndex/NBest.py:1.1 Tue Dec 3 09:28:15 2002
+++ Zope3/lib/python/Zope/TextIndex/NBest.py Tue Dec 3 15:40:29 2002
@@ -18,7 +18,7 @@
number of comparisons performed overall is M * log2(N).
"""
-from bisect import bisect
+from bisect import bisect_left as bisect
from Zope.TextIndex.INBest import INBest