[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex/Splitter/UnicodeSplitter/src - UnicodeSplitter.c:1.3
Andreas Jung
andreas@zope.com
Wed, 17 Oct 2001 10:49:24 -0400
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndex/Splitter/UnicodeSplitter/src
In directory cvs.zope.org:/tmp/cvs-serv28922/src
Modified Files:
UnicodeSplitter.c
Log Message:
changed indentation to 4 spaces
=== Zope/lib/python/Products/PluginIndexes/TextIndex/Splitter/UnicodeSplitter/src/UnicodeSplitter.c 1.2 => 1.3 === (455/555 lines abridged)
typedef struct
{
- PyObject_HEAD
- PyObject *list;
- PyObject *synstop;
+ PyObject_HEAD
+ PyObject *list;
+ PyObject *synstop;
}
Splitter;
static PyObject * checkSynword(Splitter *self,PyObject *word)
{
- PyObject *value;
- PyObject *res;
+ PyObject *value;
+ PyObject *res;
- if (PyList_Check(self->list)) {
+ if (PyList_Check(self->list)) {
- value = PyObject_GetItem(self->synstop,word);
- if (value) {
+ value = PyObject_GetItem(self->synstop,word);
+ if (value) {
- res = value;
- } else res = word;
+ res = value;
} else res = word;
+ } else res = word;
- return res;
+ return res;
}
static void
Splitter_dealloc(Splitter *self)
{
- Py_XDECREF(self->list);
- Py_XDECREF(self->synstop);
- PyMem_DEL(self);
+ Py_XDECREF(self->list);
+ Py_XDECREF(self->synstop);
+ PyMem_DEL(self);
}
static int
Splitter_length(Splitter *self)
{
[-=- -=- -=- 455 lines omitted -=- -=- -=-]
+ "UnicodeSplitter(doc[,synstop]) -- Return a word splitter"
+ },
+ { NULL, NULL }
+ };
static char Splitter_module_documentation[] =
- "Parse source (unicode) string into sequences of words\n"
- "\n"
- "for use in an inverted index\n"
- "\n"
- "$Id$\n"
- ;
+ "Parse source (unicode) string into sequences of words\n"
+ "\n"
+ "for use in an inverted index\n"
+ "\n"
+ "$Id$\n"
+ ;
void
initUnicodeSplitter(void)
{
- PyObject *m, *d;
- char *rev="$Revision$";
+ PyObject *m, *d;
+ char *rev="$Revision$";
- /* Create the module and add the functions */
- m = Py_InitModule4("UnicodeSplitter", Splitter_module_methods,
- Splitter_module_documentation,
- (PyObject*)NULL,PYTHON_API_VERSION);
-
- /* Add some symbolic constants to the module */
- d = PyModule_GetDict(m);
- PyDict_SetItemString(d, "__version__",
- PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
+ /* Create the module and add the functions */
+ m = Py_InitModule4("UnicodeSplitter", Splitter_module_methods,
+ Splitter_module_documentation,
+ (PyObject*)NULL,PYTHON_API_VERSION);
+
+ /* Add some symbolic constants to the module */
+ d = PyModule_GetDict(m);
+ PyDict_SetItemString(d, "__version__",
+ PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
- if (PyErr_Occurred()) Py_FatalError("can't initialize module Splitter");
+ if (PyErr_Occurred()) Py_FatalError("can't initialize module Splitter");
}