views:

46

answers:

1

Hello,

I want to write a custom analyzer in pylucene. Usually in java lucene , when you write a analyzer class , your class inherits lucene's Analyzer class.

but pylucene uses jcc , the java to c++/python compiler.

So how do you let a python class inherit from a java class using jcc ,and especially how do you write a custom pylucene analyzer?

Thanks.

A: 

You can inherit from any class in pylucene, but the ones with names that start with Python will also extend the underlying Java class, i.e., make the relevant methods "virtual" when called from java code. So in the case of custom analyzers, inherit from PythonAnalyzer and implement the tokenStream method.

Coady