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

Andreas Jung andreas@digicool.com
Wed, 6 Feb 2002 13:45:14 -0500


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

Modified Files:
      Tag: ajung-textindexng-branch
	TextIndexNG.py 
Log Message:
fixes for stopword handlign


=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/TextIndexNG.py 1.2.2.24 => 1.2.2.25 ===
 from ProximityLexicon import ProximityLexicon
 
-from types import IntType, StringType, UnicodeType, InstanceType
+from types import IntType, StringType, UnicodeType, InstanceType, DictType
 from TextOperators import *
 from TextIndexCommon import *
 
@@ -202,12 +202,12 @@
 
         # StopWords
 
-        if isinstance(self.stopWords, StringType):
-            self._stopwords =  StopWords.StopWords(self.stopWords)
-        elif isinstance(self.stopWords, InstanceType):
+        if isinstance(self.stopWords, InstanceType):
             self._stopwords = self.stopWord
+        elif type(self.stopWords) in (DictType, StringType):
+            self._stopwords =  StopWords.StopWords(self.stopWords)
         else:
-            self._stopwords =  StopWords.StopWords()
+            self._stopwords = StopWords.StopWords()
             
     
         # Proximity