Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 71169 invoked from network); 2 Feb 2010 00:02:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Feb 2010 00:02:53 -0000 Received: (qmail 661 invoked by uid 500); 2 Feb 2010 00:02:52 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 598 invoked by uid 500); 2 Feb 2010 00:02:52 -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 590 invoked by uid 99); 2 Feb 2010 00:02:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Feb 2010 00:02:52 +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; Tue, 02 Feb 2010 00:02:50 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0C6D3234C4AD for ; Mon, 1 Feb 2010 16:02:28 -0800 (PST) Message-ID: <1927056300.11751265068947631.JavaMail.jira@brutus.apache.org> Date: Tue, 2 Feb 2010 00:02:27 +0000 (UTC) From: "Uwe Schindler (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Updated: (LUCENE-2247) Add CharArrayMap to lucene and make CharAraySet an proxy on the keySet() of it In-Reply-To: <1947495577.11061265067498690.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Uwe Schindler updated LUCENE-2247: ---------------------------------- Attachment: LUCENE-2247.patch Add CHANGES entry and some javadoc improvements and typo fixes. No code changes. > Add CharArrayMap to lucene and make CharAraySet an proxy on the keySet() of it > ------------------------------------------------------------------------------ > > Key: LUCENE-2247 > URL: https://issues.apache.org/jira/browse/LUCENE-2247 > Project: Lucene - Java > Issue Type: Improvement > Components: Analysis > Reporter: Uwe Schindler > Assignee: Uwe Schindler > Fix For: 3.1 > > Attachments: LUCENE-2247.patch, LUCENE-2247.patch, LUCENE-2247.patch, LUCENE-2247.patch, LUCENE-2247.patch, LUCENE-2247.patch > > > This patch adds a CharArrayMap to Lucene's analysis package as compagnon of CharArraySet. It supports fast retrieval of char[] keys like CharArraySet does. This is important for some stemmers and other places in Lucene. > Stemers generally use CharArrayMap, which has then get(char[]) returning String. Strings are compact and can be easily copied into termBuffer. A Map would be slow as the termBuffer would be first converted to String, then looked up. The return value as String is perfectly legal, as it can be copied easily into termBuffer. > This class borrows lots of code from Solr's pendant, but has additional features and more consistent API according to CharArraySet. The key is always , because as of CharArraySet, anything that has a toString() representation can be used as key (of course with overhead). It also defines a unmodifiable map and correct iterators (returning the native char[]). > CharArraySet was made consistent and now returns for matchVersion>=3.1 also an iterator on char[]. CharArraySet's code was almost completely copied to CharArrayMap and removed in the Set. CharArraySet is now a simple proxy on the keySet(). > In future we can think of making CharArraySet/CharArrayMap/CharArrayCollection an interface so the whole API would be more consistent to the Java collections API. But this would be a backwards break. But it would be possible to use better impl instead of hashing (like prefix trees). -- 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