Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 22926 invoked from network); 8 Oct 2009 18:43:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Oct 2009 18:43:58 -0000 Received: (qmail 75232 invoked by uid 500); 8 Oct 2009 18:43:57 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 75169 invoked by uid 500); 8 Oct 2009 18:43:57 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 75156 invoked by uid 99); 8 Oct 2009 18:43:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2009 18:43:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2009 18:43:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9CACB234C4BA for ; Thu, 8 Oct 2009 11:43:31 -0700 (PDT) Message-ID: <2015357151.1255027411640.JavaMail.jira@brutus> Date: Thu, 8 Oct 2009 11:43:31 -0700 (PDT) From: "Robert Muir (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-1965) Lazy Atomic Loading Stopwords in SmartCN In-Reply-To: <1003327760.1255026811910.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1965?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D127= 63621#action_12763621 ]=20 Robert Muir commented on LUCENE-1965: ------------------------------------- Simon, everything is ok, but i have one comment: the new test: testChineseStopWordsNull, I think this is a duplicate of the = one above. here is the context: {code} /* * Punctuation is handled in a strange way if you disable stopwords * In this example the IDEOGRAPHIC FULL STOP is converted into a comma. * if you don't supply (true) to the constructor, or use a different stop= words list, * then punctuation is indexed. */ public void testChineseStopWordsOff() throws Exception { =20 Analyzer ca =3D new SmartChineseAnalyzer(false); /* doesnt load stopwor= ds */ String sentence =3D "=E6=88=91=E8=B4=AD=E4=B9=B0=E4=BA=86=E9=81=93=E5= =85=B7=E5=92=8C=E6=9C=8D=E8=A3=85=E3=80=82"; String result[] =3D { "=E6=88=91", "=E8=B4=AD=E4=B9=B0", "=E4=BA=86", "= =E9=81=93=E5=85=B7", "=E5=92=8C", "=E6=9C=8D=E8=A3=85", "," }; assertAnalyzesTo(ca, sentence, result); =20 =20 } =20 public void testChineseStopWordsNull() throws IOException{ Analyzer ca =3D new SmartChineseAnalyzer(false); /* sets stopwords to e= mpty set */ String sentence =3D "=E6=88=91=E8=B4=AD=E4=B9=B0=E4=BA=86=E9=81=93=E5= =85=B7=E5=92=8C=E6=9C=8D=E8=A3=85=E3=80=82"; String result[] =3D { "=E6=88=91", "=E8=B4=AD=E4=B9=B0", "=E4=BA=86", "= =E9=81=93=E5=85=B7", "=E5=92=8C", "=E6=9C=8D=E8=A3=85", "," }; assertAnalyzesTo(ca, sentence, result); assertAnalyzesToReuse(ca, sentence, result); } {code} > Lazy Atomic Loading Stopwords in SmartCN=20 > ----------------------------------------- > > Key: LUCENE-1965 > URL: https://issues.apache.org/jira/browse/LUCENE-1965 > Project: Lucene - Java > Issue Type: Improvement > Components: contrib/analyzers > Affects Versions: 2.9 > Reporter: Simon Willnauer > Assignee: Simon Willnauer > Priority: Trivial > Fix For: 3.0 > > Attachments: LUCENE-1965.patch > > > The default constructor in SmartChineseAnalyzer loads the default (jar em= bedded) stopwords each time the constructor is invoked.=20 > This should be atomically loaded only once in an unmodifiable set. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org