Re: ordering Japanese
[email protected] (Barry Caplan) Thu, 04 May 2006 21:04:06 -0700
| Newsgroups | perl.i18n |
|---|---|
| Message-ID | <[email protected]> |
--------------020206080408000301080400 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Ah! A non-Japanese speaker :) Japanese is probably the world's most complex writing system. It is a pretty safe bet that almost all kanji have more then one pronunciation - the actual reading is very context dependent. The only algorithm that is going to work is "brute force" and even then, especially with names, I bet you won't cover everything. I recall meeting a Japanese translator whose thesis showed that even Japanese phone operators have something like (IIRC) a 70% chance of being able to find a given phone number, given the pronunciation. That was in the early 90s, so maybe things have improved with increased automation, but I am certain any code to do what you ask of the general case would be far from trivial and consist of maybe 10's of thousands of special cases. Best, Barry Caplan www.i18n.com Mike Barborak wrote: > Thanks for the reply. And yes, that's the explanation that I got from my > client - that the ordering should be based on the pronunication of the > Japanese and then based on this ordering: > > A I U E O > Ka Ki Ku/Qu Ke Ko (Ca Ci Cu Ce Co if the sound is "K") > Ga Gi Gu Ge Go > Sa Shi Su Se So (Ca Ci Cu Ce Co if the sound is "S") > Ja Ji Ju Je Jo > Za Zi Zu Ze Zo > Ta Ti Tu Tsu Te To > Da Di Du De Do > Na Ni Nu Ne No > Ha Hi Hu He Ho > Va Vi Vu Ve Vo > Pa Pi Pu Pe Po > Fa Fi Fu Fe Fo > Ba Bi Bu Be Bo > Ma Mi Mu Me Mo > Ya Yi Yu Ye Yo > Ra/La Ri/Li Ru/Lu Re/Le Ro/Lo > Wa Wi Wu We Wo > Nb > > So that makes sense to me. The problem is that I haven't found a > programmatic way to do this. I've tried the Lingua::JA::Sort::JIS perl > module which does a localized ordering but seemingly only with respect to > katakana and not kanji. So I also tried the Unicode::Collate module and > while that seems to support a great deal of localization, I can't get it to > produce the desired ordering. So I'm not really sure if I should pursue > those modules or do something else? My latest thought is to try to use a > module like Lingua::JA::Romanize::Japanese which will convert the Japanese > glyphs to a romanized pronunciation that I could then try to sort on but I > kind of feel like I would be inventing something that someone else has > probably already built. Any thoughts? > > Thanks, > Mike > > -----Original Message----- > From: Dr Bean [mailto:[email protected]] > Sent: Thursday, May 04, 2006 11:28 PM > To: [email protected] > Subject: Re: ordering Japanese > > > On Wed, 03 May 2006, Mike Barborak wrote: > > >> Hi, >> > > >> 1. $B0K@*C0!!(BJR$B5~ETE9(B >> 2. $B%"%Z%C%/%9!!J!;3(B >> 3. $B%"%_%e%W%i%6!!</;yEg(B >> 4. $B%*%/%N!!00@n(B >> 5. $B$5$/$iLnI42_E9!!@gBf(B >> 6. $B$5$D$^20!!</;yEg(B >> 7. $B%9%?%s%9!!JF;R(B >> 8. $B$=$4$&!!?@8ME9(B >> 9. $B$=$4$&!!@iMUE9(B >> 10. $B$=$4$&!!Bg5\E9(B >> 11. $B$=$4$&!!2#IME9(B >> 12. $B%@%$%"%b%s%I%7%F%#%"%k%k!!3`86(B >> 13. $B%K%e!<%:!!7'K\(B >> > > Oops, I was reading this list in Big5. I guess iconv was doing its best. > > Looked at as UTF-8, 1. comes after 3. because the 'i' in 'Isetan' comes > after the 'a' in 'Amyuplaza'. > > > > > > --------------020206080408000301080400--