Thank you for your detailed answer.

I guess I was blinded by the whole Jython-power and did not notice that the summarizer does not appear to take any arguments.


I guess I’ll move on to another lib.


Thanks again !


Von: [] Im Auftrag von Alan Kennedy
Gesendet: Donnerstag, 28. Februar 2013 01:05
An: Szabo, Patrick (LNG-VIE)
Betreff: Re: [Jython-users] overriding a class method


> Thank you that did help. Originally I subclassed DefaultStopWordsProvider instead of IStopWordProvider but I'm gonna trust you on this :)

Actually, you could have either subclassed DefaultStopWordsProvider or implemented the IStopWordProvider interface: jython uses the same syntax for both, i.e inheritance syntax.

class MyStopWordsProvider(IStopWordProvider):
class MyStopWordsProvider(DefaultStopWordsProvider):

The difference being that the latter version inherits the implementations (unless over-ridden) of DefaultStopWordsProvider, whereas the former inherits no implementations, since interfaces are abstract.

>  What is still unclear to me is how to tell my summarizer to use those stopwords.
>  I'm initializing it like this:
>  summariser = SimpleSummariser()
>  It does not take any arguments.

Yes, I'm afraid we can't help you there: that is a deficiency of the Classifier4J API.

I note that the one of the constructors to BayesianClassifier takes a IStopWordProvider implementation,%20net.sf.classifier4J.ITokenizer,%20net.sf.classifier4J.IStopWordProvider%29

But none of the other consructors, of any object, do.

That product seems moribund: it hasn't been updated in over 8 years.

If you're going to use it, I think you're going to have to hack the code.

The SimpleSummariser you want to use does not use a StopWordProvider. Perhaps it is called indirectly?

To find out the call chain, you could change the code to throw an exception inside one of the DefaultStopWordsProvider methods. Then you could see what object is calling DefaultStopWordsProvider methods, and recompile the code to use your own implementation.

Or single-step through the code in an IDE?

Sorry we can't help further, but Classifier4J does seems a rather limited product.



. . . . . . . . . . . . . . . . . . . . . . . . . .

Ing. Patrick Szabo



A-1030 Wien, Marxergasse 25

Tel.: +43 1 53452 1573

Fax.: +43 1 534 52 146

. . . . . . . . . . . . . . . . . . . . . . . . . .