(keitai-l) Re: Sorting Yomi

From: Curt Sampson <cjs_at_cynic.net>
Date: 01/15/05
Message-ID: <Pine.NEB.4.58.0501151349260.3071@angelic-vtfw.cvpn.cynic.net>
On Sat, 15 Jan 2005, nick may wrote:

> how does gapu resolve to 501...?
>
> INSERT INTO z VALUES ('gapu',   '{''55'',  ''02'',  ''12''}')
>
> or have I misunderstood something...

A typo, it should be 'hapu'. I've fixed it.

> why bother to store the kana at all (except for speed) when you can
> work back from it from your sort codes...

In fact, I don't store kana in many of my current tables.

In my case, I also have a requirement for some things to ocassionally
make them sort in other orders as well, or to have things sort
alphabetically within categories. (E.g., Tokyo areas sorted together and
Kanagawa areas sorted together.) A separate field takes care of that
quite nicely.

Of course, if PostgreSQL supported proper collations, this wouldn't even
be an issue. But my idea could also serve as an algorithm for the sort.

At the very least, it's a fairly easily understandable documentation of
the proper sort order (assuming it's correct).

cjs
-- 
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974

***   Contribute to the Keitai Developers' Wiki!   ***
***        http://www.keitai-dev.net/wiki/         ***
Received on Sat Jan 15 06:54:40 2005