Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 469 invoked from network); 8 Apr 2011 08:36:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Apr 2011 08:36:49 -0000 Received: (qmail 25341 invoked by uid 500); 8 Apr 2011 08:36:48 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 25174 invoked by uid 500); 8 Apr 2011 08:36:46 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 25089 invoked by uid 99); 8 Apr 2011 08:36:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2011 08:36:45 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of flamefew@gmail.com designates 74.125.82.171 as permitted sender) Received: from [74.125.82.171] (HELO mail-wy0-f171.google.com) (74.125.82.171) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2011 08:36:38 +0000 Received: by wyb32 with SMTP id 32so3187209wyb.30 for ; Fri, 08 Apr 2011 01:36:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=vcQA6271wFB0z0eGd2PidIH6nBrvvtn3DH9Av7Rpyx4=; b=gmJ+OY4G5Rx//VtQexqzvthIuIGbaLFXRg1lQdvdLn4tj/+hGmyoOEfR32GlvLyp3n 3TO9gZRh6fA+gkLrx/b2RDsSyPa8ywsmjdytXNrgQ123yks4hi7J0/gjUQ4zI76vBAON AmYU+h45TGSLSN7LbF23geLSzGHgCDdFrEB7s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=YGfUYUAI9Y1zR6p8NoO6JsNv/sYO0tRJrUZjyft1zcIXNAiSdN7Wh/O9G4OpDuYez4 uB88zAPsVxzDErkWQ77DBmhmPRnAunuLdrokw7Nxorendg44RRxnWbX/P3n0/S9itMat 2PEC4nQAlPFDRZ8Eia4v9hm9bpSZoVhfzoWdw= MIME-Version: 1.0 Received: by 10.216.254.82 with SMTP id g60mr1695190wes.36.1302251778239; Fri, 08 Apr 2011 01:36:18 -0700 (PDT) Received: by 10.216.80.148 with HTTP; Fri, 8 Apr 2011 01:36:18 -0700 (PDT) In-Reply-To: References: Date: Fri, 8 Apr 2011 01:36:18 -0700 Message-ID: Subject: Re: Translators and Range [Was: [VOTE] Release Commons Lang 3.0 (RC1)] From: Henri Yandell To: Commons Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Apr 7, 2011 at 2:55 PM, Henri Yandell wrote: > On Mon, Mar 7, 2011 at 10:05 PM, Henri Yandell wrote= : >> On Sat, Mar 5, 2011 at 8:46 AM, Oliver Heger >> wrote: >>> Two minor points from my side: >>> >> >>> - Just a proposal: There are some translators in the new translate pack= age >>> which can be configured with a range of the codes to be processed. Woul= d it >>> make sense to use the Range class for this purpose? Then configuration = could >>> be more flexible (because multiple ranges could be specified), and ther= e >>> would probably be less duplicate code for checking the ranges. >> >> Very interesting. >> >> Also makes me wonder if Range should support the notion of >> Range.above, Range.below and Range.outside in addition to >> Range.between and Range.is. That change the API from: >> >> =A0UnicodeEscaper.between(x, y) >> >> to: >> >> =A0new UnicodeEscaper(Range.between(x,y)) >> =A0new UnicodeEscaper(Range.above(y)) >> =A0new UnicodeEscaper(Range.below(x)) >> =A0new UnicodeEscaper(Range.outsideOf(x,y)) >> >> For the translators; sounds great. I'm trying to remember if I hit >> problems introducing the feature of either an open-ended Range, or an >> inverted Range. Looking at LANG-551, it looks like I tried to >> introduce the inverted Range notion (outsideOf) so that I could merge >> in CharRange, and it never really worked. >> >> Worth trying again I think. > > I've begun by implementing the code in the translators as a new > CodepointRange. Stunningly (actually I was a bit surprised) I've > rewritten CharRange :) So at a minimum I think: > > a) CharRange should be updated for codepoints. > b) Translators should use CharRange. > > I also tried to update Range to support the necessary features, and > the two APIs don't fit too well together. I'm going to go ahead and do > a) and b); then ponder the CharRange into Range question again. Scratch that, as you'll see from svn I was able to move the translate package classes over to the Range class without too much pain. The lack of being able to say 'minimum excluded' is a bit annoying; and you have to define 'outsideOf' as two separate ranges. I think the latter is the right thing and I'm working on the former. I'm working on moving CharSet over to Range (and dumping CharRange). All very possible; it's the additional APIs of toString and having tests that check the input was parsed correctly that are a pain as both of them are reflections on CharSet's private mechanics. Hen --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org