[pylucene-dev] creating new Fragmenter

Brian Whitman brian.whitman at variogr.am
Wed Nov 22 08:34:47 PST 2006


I am attempting to create a sentence splitting fragmenter in PyLucene.
I see that the Fragmenter is not a class but a Interface definition.
Is there a way to create a new Fragmenter type that PyLucene can  
access via

highlighter.setTextFragmenter(SentenceFragmenter()) ?

I have tried to create a Python class that looks like

class SentenceFragmenter:
     def start(self, text):
	#stuff
     def isNewFragment(self,token):
        	#stuff

but I get a InvalidArgsError in the setTextFragmenter call..






More information about the pylucene-dev mailing list