[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndexNG - WordIdDocumentIdStorage.py:1.1.2.2

Andreas Jung andreas@digicool.com
Mon, 11 Mar 2002 18:48:06 -0500


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndexNG
In directory cvs.zope.org:/tmp/cvs-serv12644

Modified Files:
      Tag: ajung-textindexng-branch
	WordIdDocumentIdStorage.py 
Log Message:
fixed typo


=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/WordIdDocumentIdStorage.py 1.1.2.1 => 1.1.2.2 ===
     """
 
-    def __init__(self):
-        self.clear()
-
+    def __init__(self): self.clear()
 
     def clear(self):
         self.forwardIdx = IOBTree()
         self.reverseIdx = IOBTree()
-
+    
+    def __len__(self): return len(self.forwardIdx)
 
     def insert(self, wordIds, docId):
         """ insert entries: 
@@ -51,7 +50,7 @@
                 idx[wordId].insert(docId)
             except:
                 idx[wordId] = IISet()
-                idx[wordId].insert(doctId)
+                idx[wordId].insert(docId)
 
 
         # reverse index
@@ -62,7 +61,6 @@
         except:
             idx[docId] = IISet(wordIds)
 
-
     def removeDocument(self, docId):
         """ remove a document and all its words from the storage """
 
@@ -76,3 +74,5 @@
         """ return the sequence of document ids for a word id """
 
         return self.forwardIdx[ wordId ]
+
+    get = getDocumentIdsForWordId