changeset 473:c923694dc117

lupy: ugly catch for IndexError imported from: moin--main--1.5--patch-477
author Thomas Waldmann <tw@waldmann-edv.de>
date Fri, 17 Mar 2006 07:04:49 +0000
parents faeaf423ef69
children 6535fed51de5
files ChangeLog MoinMoin/support/lupy/search/boolean.py
diffstat 2 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Mar 14 19:49:34 2006 +0000
+++ b/ChangeLog	Fri Mar 17 07:04:49 2006 +0000
@@ -2,6 +2,20 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-03-17 08:04:49 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-477
+
+    Summary:
+      lupy: ugly catch for IndexError
+    Revision:
+      moin--main--1.5--patch-477
+
+    lupy: ugly catch for IndexError
+    
+
+    modified files:
+     ChangeLog MoinMoin/support/lupy/search/boolean.py
+
+
 2006-03-14 20:49:34 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-476
 
     Summary:
--- a/MoinMoin/support/lupy/search/boolean.py	Tue Mar 14 19:49:34 2006 +0000
+++ b/MoinMoin/support/lupy/search/boolean.py	Fri Mar 17 07:04:49 2006 +0000
@@ -177,9 +177,9 @@
         if self.coordFactors is None:
             self.computeCoordFactors()
         for t in self.scorers:
-            #print "SCORER", t.scorer
+            #print "SCORER %r" % t.scorer
             for d,score in t.scorer.score(maxDoc):
-                #print "DOCUMENT"
+                #print "DOCUMENT %r %r" % (d, score)
                 self.collect(d,score,t.mask)
         return self.collectHits()
     
@@ -190,7 +190,11 @@
                 # if prohibited and required check out
                 # add to results
                 #print "CollectHits:", doc, score, self.coordFactors, coord
-                yield (doc, score * self.coordFactors[coord])
+                try:
+                    scorecf = score * self.coordFactors[coord]
+                except IndexError, err: # XXX ugly way to avoid it crashing 8(
+                    scorecf = 0.0
+                yield (doc, scorecf)
         del self.validList[:]