Commit 285ecf40 authored by chris's avatar chris

Fixed problem with capitalized letter in text

parent 808bcf50
...@@ -25,6 +25,7 @@ static WordSequence * ...@@ -25,6 +25,7 @@ static WordSequence *
newWordSequence(PyObject *text, PyObject *synstop, PyObject *wordletters) newWordSequence(PyObject *text, PyObject *synstop, PyObject *wordletters)
{ {
WordSequence *self; WordSequence *self;
PyObject *t;
UNLESS(self = PyObject_NEW(WordSequence, &WordSequenceType)) UNLESS(self = PyObject_NEW(WordSequence, &WordSequenceType))
{ {
...@@ -44,12 +45,27 @@ newWordSequence(PyObject *text, PyObject *synstop, PyObject *wordletters) ...@@ -44,12 +45,27 @@ newWordSequence(PyObject *text, PyObject *synstop, PyObject *wordletters)
Py_INCREF(self->synstop); Py_INCREF(self->synstop);
} }
if (wordletters == NULL) wordletters=default_wordletters; if (wordletters == NULL) wordletters=default_wordletters;
Py_INCREF(wordletters); Py_INCREF(wordletters);
self->wordletters = wordletters; self->wordletters = wordletters;
self->cwordletters = PyString_AsString(self->wordletters); self->cwordletters = PyString_AsString(self->wordletters);
UNLESS(t = PyTuple_New(1))
{
return NULL;
}
Py_INCREF(text);
PyTuple_SET_ITEM((PyTupleObject *)t, 0, text);
UNLESS_ASSIGN(text, PyObject_CallObject(string_lower, t))
{
Py_DECREF(t);
return NULL;
}
Py_DECREF(t);
self->ctext = self->here = PyString_AsString(text); self->ctext = self->here = PyString_AsString(text);
self->end = self->here + PyString_Size(text); self->end = self->here + PyString_Size(text);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment