[Zope-CVS] CVS: Products/ZCTextIndex - Index.py:1.1.2.8

Guido van Rossum guido@python.org
Wed, 1 May 2002 12:29:07 -0400


Update of /cvs-repository/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv435

Modified Files:
      Tag: TextIndexDS9-branch
	Index.py 
Log Message:
Call invfreq() only once per document.


=== Products/ZCTextIndex/Index.py 1.1.2.7 => 1.1.2.8 ===
         for wid in wids:
             map = self._wordinfo[wid]
-            wordfreq = len(map)
+            inv = invfreq(N, len(map))
             for docid, f in map.items():
-                w = f * invfreq(N, wordfreq) / self._docweight[docid]
+                w = f * inv / self._docweight[docid]
                 result[docid] = result.get(docid, 0) + w
         return result