Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 2787 invoked from network); 9 Apr 2009 22:32:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Apr 2009 22:32:32 -0000 Received: (qmail 26365 invoked by uid 500); 9 Apr 2009 22:32:31 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 26268 invoked by uid 500); 9 Apr 2009 22:32:31 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 26257 invoked by uid 99); 9 Apr 2009 22:32:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2009 22:32:30 +0000 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of patrick.antivackis@gmail.com designates 209.85.218.170 as permitted sender) Received: from [209.85.218.170] (HELO mail-bw0-f170.google.com) (209.85.218.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2009 22:32:23 +0000 Received: by bwz18 with SMTP id 18so987645bwz.11 for ; Thu, 09 Apr 2009 15:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=EMJxvXSYnMaGY4TByL+L42Fi6lkXV+BfeUxBvaLmlbA=; b=Fqy9csLd4uA6CEAeF3rxNLu3jOsDI2rGpFY+vRLFClEbVJKZTtefHRzkKJrS6mG5HH bJEzOyICK0tSVFghIlRhPioHp1r0uc21TxxRpa63THdY8jaOXfvajPEW5woJaZbW9hG0 7lD1FdcQvSgTejA3M1ZWgb+6mlyOllWGtLSSA= 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; b=ZS4fZPYhQ2onvxzjkTwFT1Iroz2sfdQYrY9mkN1mDWLaaprKF+r7nggqxrIYMpj81F dQ8+gusHTVeAn/qXhUU9ST+KPpsO6yiBcnKPiZMVIJrMZzANY0ehb3y4XClTZxRHDtmp Bgx4akeLb1dfwV2/5ceqOt/uo5+U+beWkhKuE= MIME-Version: 1.0 Received: by 10.223.117.14 with SMTP id o14mr943389faq.21.1239316321136; Thu, 09 Apr 2009 15:32:01 -0700 (PDT) In-Reply-To: <7060483c0904091519p7c8c3229kbf5139b7a780abfa@mail.gmail.com> References: <20090409105330.GA13320@uk.tiscali.com> <20090409210807.GA25726@uk.tiscali.com> <7060483c0904091445k625023aah29a96c493c8323b4@mail.gmail.com> <7060483c0904091519p7c8c3229kbf5139b7a780abfa@mail.gmail.com> Date: Fri, 10 Apr 2009 00:32:01 +0200 Message-ID: <7060483c0904091532s7c3c32a5y63234e239b41d1c1@mail.gmail.com> Subject: Re: View keys case-insensitive? From: Patrick Antivackis To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=001636c5bab315f1a0046726d1ce X-Virus-Checked: Checked by ClamAV on apache.org --001636c5bab315f1a0046726d1ce Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit in fact 7 letters ;) So collation is about comparing words together and if a word as less letter than an other it is placed first. Hope that helps 2009/4/10 Patrick Antivackis > As i said, ICU is more about language. > If you open your dictionnary you will find big before biggest (whatever > case you are using) as one is 3 letters and the other 6 letters. > In your example, it's just the same. > But you are right on one point, even with tailor customization, it should > be impossible to have the classical computer sorting with ICU. > > > 2009/4/10 Paul Davis > > Patrick, >> >> I'm not asking for this relationship: >> >> a < b < A < B >> >> Merely: >> >> a < aa < A >> >> The thing is that even when I try and specify explicitly that 'A; >> should come after 'a' I still can't get the expected "a < aa < A" >> behavior. In a nutshell, "Why the hell does the second 'a' alter the >> comparison?" >> >> HTH, >> Paul Davis >> >> On Thu, Apr 9, 2009 at 5:45 PM, Patrick Antivackis >> wrote: >> > It's quite normal as far as ICU is concerned. >> > ICU is about language not about ASCII code. >> > In ICU, case is the third element looked for comparison (same level than >> > circled letter in Nordic languages for example), so not very important. >> > So when you sort words together, a or A is still an a, so they are >> sorted >> > nearby. In ICU you can specify if you prefer a before A or A before a, >> but >> > not simply a before b before c.... before A before B before C. >> > >> > To have such behavior (like ASCII) you need to custom ICU in specifying >> the >> > collation you want almost letter by letter. >> > It is great for you, but what about Japanese users or Arabic users ?? >> > >> > So this is definitely the right behaviour of ICU sorting (collation). >> > >> > >> > 2009/4/9 Brian Candler >> > >> >> > I've spent entirely too long on this now and I still can't for the >> >> > life of me figure out why A < aa. >> >> >> >> Time for an experimental, black-box approach: >> >> >> >> ---- >> >> require 'rubygems' >> >> require 'restclient' >> >> require 'json' >> >> >> >> DB="http://127.0.0.1:5984/collator" >> >> >> >> RestClient.delete DB rescue nil >> >> RestClient.put "#{DB}","" >> >> >> >> (32..126).each do |c| >> >> RestClient.put "#{DB}/#{c.to_s(16)}", {"x"=>c.chr}.to_json >> >> end >> >> >> >> RestClient.put "#{DB}/_design/test", <> >> { >> >> "views":{ >> >> "one":{ >> >> "map":"function (doc) { emit(doc.x,null); }" >> >> } >> >> } >> >> } >> >> EOS >> >> >> >> puts RestClient.get("#{DB}/_design/test/_view/one") >> >> ---- >> >> >> >> This shows the collation sequence to be as follows. >> >> >> >> {"total_rows":95,"offset":0,"rows":[ >> >> {"id":"20","key":" ","value":null}, >> >> {"id":"60","key":"`","value":null}, >> >> {"id":"5e","key":"^","value":null}, >> >> {"id":"5f","key":"_","value":null}, >> >> {"id":"2d","key":"-","value":null}, >> >> {"id":"2c","key":",","value":null}, >> >> {"id":"3b","key":";","value":null}, >> >> {"id":"3a","key":":","value":null}, >> >> {"id":"21","key":"!","value":null}, >> >> {"id":"3f","key":"?","value":null}, >> >> {"id":"2e","key":".","value":null}, >> >> {"id":"27","key":"'","value":null}, >> >> {"id":"22","key":"\"","value":null}, >> >> {"id":"28","key":"(","value":null}, >> >> {"id":"29","key":")","value":null}, >> >> {"id":"5b","key":"[","value":null}, >> >> {"id":"5d","key":"]","value":null}, >> >> {"id":"7b","key":"{","value":null}, >> >> {"id":"7d","key":"}","value":null}, >> >> {"id":"40","key":"@","value":null}, >> >> {"id":"2a","key":"*","value":null}, >> >> {"id":"2f","key":"/","value":null}, >> >> {"id":"5c","key":"\\","value":null}, >> >> {"id":"26","key":"&","value":null}, >> >> {"id":"23","key":"#","value":null}, >> >> {"id":"25","key":"%","value":null}, >> >> {"id":"2b","key":"+","value":null}, >> >> {"id":"3c","key":"<","value":null}, >> >> {"id":"3d","key":"=","value":null}, >> >> {"id":"3e","key":">","value":null}, >> >> {"id":"7c","key":"|","value":null}, >> >> {"id":"7e","key":"~","value":null}, >> >> {"id":"24","key":"$","value":null}, >> >> {"id":"30","key":"0","value":null}, >> >> {"id":"31","key":"1","value":null}, >> >> {"id":"32","key":"2","value":null}, >> >> {"id":"33","key":"3","value":null}, >> >> {"id":"34","key":"4","value":null}, >> >> {"id":"35","key":"5","value":null}, >> >> {"id":"36","key":"6","value":null}, >> >> {"id":"37","key":"7","value":null}, >> >> {"id":"38","key":"8","value":null}, >> >> {"id":"39","key":"9","value":null}, >> >> {"id":"61","key":"a","value":null}, >> >> {"id":"41","key":"A","value":null}, >> >> {"id":"62","key":"b","value":null}, >> >> {"id":"42","key":"B","value":null}, >> >> {"id":"63","key":"c","value":null}, >> >> {"id":"43","key":"C","value":null}, >> >> {"id":"64","key":"d","value":null}, >> >> {"id":"44","key":"D","value":null}, >> >> {"id":"65","key":"e","value":null}, >> >> {"id":"45","key":"E","value":null}, >> >> {"id":"66","key":"f","value":null}, >> >> {"id":"46","key":"F","value":null}, >> >> {"id":"67","key":"g","value":null}, >> >> {"id":"47","key":"G","value":null}, >> >> {"id":"68","key":"h","value":null}, >> >> {"id":"48","key":"H","value":null}, >> >> {"id":"69","key":"i","value":null}, >> >> {"id":"49","key":"I","value":null}, >> >> {"id":"6a","key":"j","value":null}, >> >> {"id":"4a","key":"J","value":null}, >> >> {"id":"6b","key":"k","value":null}, >> >> {"id":"4b","key":"K","value":null}, >> >> {"id":"6c","key":"l","value":null}, >> >> {"id":"4c","key":"L","value":null}, >> >> {"id":"6d","key":"m","value":null}, >> >> {"id":"4d","key":"M","value":null}, >> >> {"id":"6e","key":"n","value":null}, >> >> {"id":"4e","key":"N","value":null}, >> >> {"id":"6f","key":"o","value":null}, >> >> {"id":"4f","key":"O","value":null}, >> >> {"id":"70","key":"p","value":null}, >> >> {"id":"50","key":"P","value":null}, >> >> {"id":"71","key":"q","value":null}, >> >> {"id":"51","key":"Q","value":null}, >> >> {"id":"72","key":"r","value":null}, >> >> {"id":"52","key":"R","value":null}, >> >> {"id":"73","key":"s","value":null}, >> >> {"id":"53","key":"S","value":null}, >> >> {"id":"74","key":"t","value":null}, >> >> {"id":"54","key":"T","value":null}, >> >> {"id":"75","key":"u","value":null}, >> >> {"id":"55","key":"U","value":null}, >> >> {"id":"76","key":"v","value":null}, >> >> {"id":"56","key":"V","value":null}, >> >> {"id":"77","key":"w","value":null}, >> >> {"id":"57","key":"W","value":null}, >> >> {"id":"78","key":"x","value":null}, >> >> {"id":"58","key":"X","value":null}, >> >> {"id":"79","key":"y","value":null}, >> >> {"id":"59","key":"Y","value":null}, >> >> {"id":"7a","key":"z","value":null}, >> >> {"id":"5a","key":"Z","value":null} >> >> ]} >> >> >> >> I've never seen this sequence before. It's not even EBCDIC :-) >> >> >> >> Adding aa into the pot gives: >> >> >> >> ... >> >> {"id":"61","key":"a","value":null}, >> >> {"id":"41","key":"A","value":null}, >> >> {"id":"X","key":"aa","value":null}, >> >> ... >> >> >> >> As you say, that is most bizarre. >> >> >> >> Cheers, >> >> >> >> Brian. >> >> >> > >> > > --001636c5bab315f1a0046726d1ce--