Hi Andi,

the same java code:

StandardTokenizer tst = new StandardTokenizer(new StringReader("henk denk schenk"));
tst.next()

works. Can I do the same in Python? (No IndexReader, just plain Strings) ?

Best,
Martin



Andi Vajda wrote:


On Mon, 22 Aug 2005, Martin Rode wrote:

Hi everbody,

I am trying to use StandardTokenizer, with no success:

Python 2.4.1 (#2, Jul 12 2005, 09:22:25)
[GCC 4.0.1 (Debian 4.0.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import PyLucene
import StringIO
s = StringIO.StringIO("henk denk schenk")
henk = PyLucene.StandardTokenizer(s)
repr(henk)

'<PyLucene.StandardTokenizer; proxy of C++ org::apache::lucene::analysis::standard::StandardTokenizer instance at <PyCObject object at 0xb6872110>>'

henk.next()


Python now hangs in:
fotomarburg:~# strace -p 9328
Process 9328 attached - interrupt to quit
futex(0x81a7fb8, FUTEX_WAIT, 0, NULL

What am I doing wrong?


It hangs because you're not passing a reader to StandardTokenizer, but an input stream. Yes, this is a bug, you should be getting an error at that time.

If you use one of the classes in test/Streams.py instead all should be fine.

Andi..
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev



_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to