(keitai-l) Re: Sorting Yomi

From: Alex Shinn <foof_at_synthcode.com>
Date: 01/17/05
Message-ID: <86pt046a40.wl@lain.inunome.com>
At Sat, 15 Jan 2005 13:54:33 +0900 (JST), Curt Sampson wrote:
> 
> 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.

The order you are using is the standard JIS order (almost - in all
cases the small form sorts before the large form, which you have right
for A, I, U, E, and O, but not YA, YU, YO or WA).

If the data is stored in the database with a JIS-based encoding (any
of the standard Japanese encodings, plus Unicode also preserves this
order) then PostgreSQL will sort this properly.  There's no need to
break it down or store a sort order in a separate column.

Kanji is the difficult thing to sort, which PostgreSQL can't handle
because the characters have different pronunciations in different
contexts and you would need full NLS to figure out the right one.  But
for Hiragana you don't need to do anything special.

-- 
Alex
Received on Mon Jan 17 04:52:04 2005