[Zope-CVS] CVS: Products/ZCTextIndex/tests - indexhtml.py:1.6
Jeremy Hylton
jeremy@zope.com
Fri, 17 May 2002 11:28:02 -0400
Update of /cvs-repository/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv24405
Modified Files:
indexhtml.py
Log Message:
Make sure stop words are used with old TextIndex.
I think that the default Lexicon for TextIndex does not use a stop
word list. For the comparison with ZCTextIndex, explicitly pass the
default stop word dict from TextIndex to the lexicon.
=== Products/ZCTextIndex/tests/indexhtml.py 1.5 => 1.6 ===
def make_old_index():
- return TextIndex("read")
+ from Products.PluginIndexes.TextIndex.TextIndex import TextIndex
+ from Products.PluginIndexes.TextIndex.Lexicon \
+ import Lexicon, stop_word_dict
+
+ return TextIndex("read", lexicon=Lexicon(stop_word_dict))
def main(db, root, dir):
rt["index"] = index = INDEX()
@@ -115,7 +119,6 @@
if o == '-n':
LIMIT = int(v)
if o == '-T':
- from Products.PluginIndexes.TextIndex.TextIndex import TextIndex
INDEX = make_old_index
if len(args) != 1: