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

Andreas Jung andreas@digicool.com
Tue, 5 Feb 2002 15:45:59 -0500


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

Modified Files:
      Tag: ajung-textindexng-branch
	TextIndexNG.py 
Log Message:
minor fixes


=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/TextIndexNG.py 1.2.2.22 => 1.2.2.23 ===
         if isinstance(self.charMapping, StringType):
             self._normalizer = Normalizer.Normalizer(self.charMapping)
-        elif isinstance(self.charMapping, Normalizer.Normalizer):
+        elif isinstance(self.charMapping, InstanceType):
             self._normalizer = self.charMapping
         else:
             self._normalizer = None
@@ -214,7 +214,7 @@
 
         # near Search
    
-     if self.nearSearch == 'internal':
+        if self.nearSearch == 'internal':
             self._v_positions = self.positionsFromInternalStorage
             self._v_insertForwardEntry = self.insertForwardEntryInternal
         else:
@@ -556,6 +556,7 @@
             debug("\tStemming: ", word)
 
         # perform casefolding if necessary
+
         if self.splitterCasefolding:
             word = word.lower()
             debug('\tCasefolding: ',word)
@@ -569,9 +570,12 @@
         
         # docIds is an IOBTree and contains the mapping
         # (documentId, list of positions) for one word/wid
-        docIds = self._IDX.get(wids[0])
 
-    
+        if len(wids) > 0:
+            docIds = self._IDX.get(wids[0])
+        else:
+            docIds = IISet()
+
 #        debug('\tDocIds: ', list(docIds.keys()))
 #        debug('\tPositions: ', list(docIds.values()))
 
@@ -821,6 +825,6 @@
 
 def manage_addTextIndexNG(self, id, extra, REQUEST=None, RESPONSE=None, URL3=None):
     """Add a new TextIndexNG """
-    print 'blabla'
+    
     return self.manage_addIndex(id, 'TextIndexNG', extra, REQUEST, RESPONSE, URL3)