[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src - ISO_8859_1_Splitter.c:1.6.4.2

Andreas Jung andreas@digicool.com
Mon, 21 Jan 2002 14:11:28 -0500


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src
In directory cvs.zope.org:/tmp/cvs-serv13332

Modified Files:
      Tag: Zope-2_5-branch
	ISO_8859_1_Splitter.c 
Log Message:
reverted previous commit (should have gone to private branch)


=== Zope/lib/python/Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.c 1.6.4.1 => 1.6.4.2 ===
     int index_numbers;
     int max_len;
-    int casefolding;
 }
 
 Splitter;
@@ -252,10 +251,7 @@
             continue;
         }
 
-        if (self->casefolding)
-            c=mytolower(*here);
-        else
-            c = (*here);
+        c=mytolower(*here);
 
         /* Check to see if this character is part of a word */
 
@@ -494,7 +490,7 @@
                                        SplitterType__doc__ /* Documentation string */
                                    };
 
-static char *splitter_args[]={"doc","synstop","encoding","singlechar","indexnumbers","maxlen","casefolding",NULL};
+static char *splitter_args[]={"doc","synstop","encoding","singlechar","indexnumbers","maxlen",NULL};
 
 static PyObject *
 get_Splitter(PyObject *modinfo, PyObject *args,PyObject *keywds)
@@ -505,9 +501,8 @@
     int single_char = 0;
     int index_numbers = 0;
     int max_len=64;
-    int casefolding=1;
 
-    UNLESS(PyArg_ParseTupleAndKeywords(args,keywds,"O|Osiiii",splitter_args,&doc,&synstop,&encoding,&single_char,&index_numbers,&max_len,&casefolding)) return NULL;
+    UNLESS(PyArg_ParseTupleAndKeywords(args,keywds,"O|Osiii",splitter_args,&doc,&synstop,&encoding,&single_char,&index_numbers,&max_len)) return NULL;
 
 
     if (index_numbers<0 || index_numbers>1) {
@@ -515,11 +510,6 @@
         return NULL;
     }
 
-    if (casefolding<0 || casefolding>1) {
-        PyErr_SetString(PyExc_ValueError,"casefolding must be 0 or 1");
-        return NULL;
-    }
-
     if (single_char<0 || single_char>1) {
         PyErr_SetString(PyExc_ValueError,"singlechar must be 0 or 1");
         return NULL;
@@ -531,6 +521,7 @@
     }
 
 
+
     UNLESS(self = PyObject_NEW(Splitter, &SplitterType)) return NULL;
 
     if(synstop) {
@@ -548,7 +539,6 @@
     self->allow_single_chars    = single_char;
     self->index_numbers         = index_numbers;
     self->max_len               = max_len;
-    self->casefolding           = casefolding;
 
     self->index = -1;
 
@@ -563,7 +553,7 @@
 static struct PyMethodDef Splitter_module_methods[] =
     {
         { "ISO_8859_1_Splitter", (PyCFunction)get_Splitter, METH_VARARGS|METH_KEYWORDS,
-          "ISO_8859_1_Splitter(doc[,synstop][,encoding][,singlechar][,indexnumbers][,maxlen][,casefolding]) -- Return a word splitter"
+          "ISO_8859_1_Splitter(doc[,synstop][,encoding][,singlechar][,indexnumbers][,maxlen]) -- Return a word splitter"
         },
 
         { NULL, NULL }
@@ -587,18 +577,16 @@
 
     /* Create the module and add the functions */
     initSplitterTrtabs();
-    if (PyErr_Occurred()) Py_FatalError("can't initialize module Splitter 1");
     m = Py_InitModule4("ISO_8859_1_Splitter", Splitter_module_methods,
                        Splitter_module_documentation,
                        (PyObject*)NULL,PYTHON_API_VERSION);
-    if (PyErr_Occurred()) Py_FatalError("can't initialize module Splitter 2");
 
     /* Add some symbolic constants to the module */
     d = PyModule_GetDict(m);
-    if (PyErr_Occurred()) Py_FatalError("can't initialize module Splitter 3");
     PyDict_SetItemString(d, "__version__",
                          PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
-    if (PyErr_Occurred()) Py_FatalError("can't initialize module Splitter 4");
 
+    if (PyErr_Occurred())
+        Py_FatalError("can't initialize module Splitter");
 }