[Zope-CVS] CVS: Products/ZCTextIndex - ZCTextIndex.py:1.1.2.18

Fred L. Drake, Jr. fdrake@acm.org
Thu, 9 May 2002 16:02:15 -0400


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

Modified Files:
      Tag: TextIndexDS9-branch
	ZCTextIndex.py 
Log Message:
Typo: manage_addZCTextIndexForm --> manage_addZCTextIndexForm

Added support for the C implementation of the StopWordRemover.


=== Products/ZCTextIndex/ZCTextIndex.py 1.1.2.17 => 1.1.2.18 ===
         has_key = self.dict.has_key
         return [w for w in lst if not has_key(w)]
-        
+
+try:
+    from Products.ZCTextIndex import stopper
+except ImportError:
+    pass
+else:
+    _stopwords = StopWordRemover.dict
+    def StopWordRemover():
+        swr = stopper.new()
+        swr.dict.update(_stopwords)
+        return swr
+
 def manage_addZCTextIndex(self, id, extra=None, REQUEST=None, 
                           RESPONSE=None):
     """Add a text index"""
     return self.manage_addIndex(id, 'ZCTextIndex', extra, 
                                 REQUEST, RESPONSE, REQUEST.URL3)
-                                
-manage_addSCTextIndexForm = DTMLFile('dtml/addZCTextIndex', globals())
 
+manage_addZCTextIndexForm = DTMLFile('dtml/addZCTextIndex', globals())