[Zope-CVS] CVS: Products/ZCTextIndex - ILexicon.py:1.1.2.3 Lexicon.py:1.1.2.4

Jeremy Hylton jeremy@zope.com
Thu, 2 May 2002 22:39:24 -0400


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

Modified Files:
      Tag: TextIndexDS9-branch
	ILexicon.py Lexicon.py 
Log Message:
Add a length() method to the lexicon.


=== Products/ZCTextIndex/ILexicon.py 1.1.2.2 => 1.1.2.3 ===
         new word ids for words that aren't (yet) in the lexicon.
         """
+
+    def length():
+        """Return the number of unique term in the lexicon."""


=== Products/ZCTextIndex/Lexicon.py 1.1.2.3 => 1.1.2.4 ===
         self.__splitter = splitter
 
+    def length(self):
+        # Return the number of unique terms in the lexicon
+        return self.__lastwid - 1
+
     def sourceToWordIds(self, text):
         last = self.__splitter.process(text)
         for element in self.__pipeline: