[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndexNG - LexiconNG.py:1.1.2.3
Andreas Jung
andreas@digicool.com
Wed, 13 Feb 2002 19:02:15 -0500
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndexNG
In directory cvs.zope.org:/tmp/cvs-serv16854
Modified Files:
Tag: ajung-textindexng-branch
LexiconNG.py
Log Message:
some speed improvement for getWordIdList()....this stuff should really
go into a C extension.
=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/LexiconNG.py 1.1.2.2 => 1.1.2.3 ===
def getWordIdList(self,words):
""" return a list a wordIds for a list of words """
- return [ self.getWordId(word) for word in words]
+
+ lst = []
+ for word in words:
+
+ wid=self._lexicon.get(word, None)
+
+ if wid is None:
+ wid=self.assignWordId(word)
+ lst.append(wid)
+
+ return lst
+
def getWordId(self, word):