On Feb 23, 2009, at 8:56, Bill Janssen <jans...@parc.com> wrote:

Bill Janssen <jans...@parc.com> wrote:

OK, I added JavaSet to my codebase.

But still no joy -- I can now call

   mlt = MoreLikeThis(...)
   mlt.setStopWords(JavaSet(set(["foo", "bar", "bletch"])))
   terms = mlt.retrieveInterestingTerms(...)

Unfortunately, I still get "foo", "bar", and "bletch" in the terms.

So something is still off. Looking at the code for use of stopwords in
MLT, it's pretty simple and looks correct.

I instrumented the "contains" method for JavaSet.  When a JavaSet
containing ['have', 'more', 'less'] is called from Java with an
<Object: have>, it returns False. This is why it isn't working for me.

Ah, it's a type issue then: comparing a Java Object (a String) against a Python String.
Use the Arrays route until I find a solution for that bug:
HashSet(Arrays.asList(JArray('string')([...])))
 or, simpler, without Arrays:
HashSet(JavaSet(set([...])))

Andi..


Andi..



Bill

Reply via email to