Return-Path: Delivered-To: apmail-lucene-pylucene-dev-archive@minotaur.apache.org Received: (qmail 4508 invoked from network); 23 Feb 2009 17:36:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Feb 2009 17:36:30 -0000 Received: (qmail 19685 invoked by uid 500); 23 Feb 2009 17:36:30 -0000 Delivered-To: apmail-lucene-pylucene-dev-archive@lucene.apache.org Received: (qmail 19661 invoked by uid 500); 23 Feb 2009 17:36:30 -0000 Mailing-List: contact pylucene-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pylucene-dev@lucene.apache.org Delivered-To: mailing list pylucene-dev@lucene.apache.org Received: (qmail 19650 invoked by uid 99); 23 Feb 2009 17:36:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Feb 2009 09:36:30 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [66.51.199.98] (HELO mail10.dslextreme.com) (66.51.199.98) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 23 Feb 2009 17:36:22 +0000 Received: (qmail 7184 invoked from network); 23 Feb 2009 17:36:01 -0000 Received: from unknown (HELO ovaltofu.org) (66.159.224.220) by mail10.dslextreme.com with (DHE-RSA-AES256-SHA encrypted) SMTP; Mon, 23 Feb 2009 09:36:01 -0800 Received: from [192.168.0.4] ([192.168.0.4]) (authenticated bits=0) by ovaltofu.org (8.13.8/8.13.5) with ESMTP id n1NHa6CU020451 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Mon, 23 Feb 2009 09:36:07 -0800 (PST) Message-Id: <90323B36-EE1F-4A51-8D70-33BB72E54546@apache.org> From: Andi Vajda To: "pylucene-dev@lucene.apache.org" In-Reply-To: <92338.1235408218@parc.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPod Mail (5G77) Mime-Version: 1.0 (iPod Mail 5G77) Subject: Re: how to instantiate a Set? Date: Mon, 23 Feb 2009 09:36:40 -0800 References: <84011.1235351332@parc.com> <92338.1235408218@parc.com> X-Virus-Checked: Checked by ClamAV on apache.org On Feb 23, 2009, at 8:56, Bill Janssen wrote: > Bill Janssen 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 > , 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