Re: ordering Japanese

[email protected] (Kino) Fri, 5 May 2006 13:16:57 +0900
Newsgroups perl.i18n
Message-ID <[email protected]>
On 4 May 2006, at 8:12, Mike Barborak wrote:

> Here is an example of 13 store names ordered with
> Lingua::JA::Sort::JIS::msort:
>
> 1. =E4=BC=8A=E5=8B=A2=E4=B8=B9=E3=80=80JR=E4=BA=AC=E9=83=BD=E5=BA=97
> 2. =E3=82=A2=E3=83=9A=E3=83=83=E3=82=AF=E3=82=B9=E3=80=80=E7=A6=8F=E5=B1=
=B1
> 3. =E3=82=A2=E3=83=9F=E3=83=A5=E3=83=97=E3=83=A9=E3=82=B6=E3=80=80=E9=B9=
=BF=E5=85=90=E5=B3=B6
> 4. =E3=82=AA=E3=82=AF=E3=83=8E=E3=80=80=E6=97=AD=E5=B7=9D
> 5. =E3=81=95=E3=81=8F=E3=82=89=E9=87=8E=E7=99=BE=E8=B2=A8=E5=BA=97=E3=80=
=80=E4=BB=99=E5=8F=B0
> 6. =E3=81=95=E3=81=A4=E3=81=BE=E5=B1=8B=E3=80=80=E9=B9=BF=E5=85=90=E5=B3=
=B6
> 7. =E3=82=B9=E3=82=BF=E3=83=B3=E3=82=B9=E3=80=80=E7=B1=B3=E5=AD=90
> 8. =E3=81=9D=E3=81=94=E3=81=86=E3=80=80=E7=A5=9E=E6=88=B8=E5=BA=97
> 9. =E3=81=9D=E3=81=94=E3=81=86=E3=80=80=E5=8D=83=E8=91=89=E5=BA=97
> 10. =E3=81=9D=E3=81=94=E3=81=86=E3=80=80=E5=A4=A7=E5=AE=AE=E5=BA=97
> 11. =E3=81=9D=E3=81=94=E3=81=86=E3=80=80=E6=A8=AA=E6=B5=9C=E5=BA=97
> 12. =E3=83=80=E3=82=A4=E3=82=A2=E3=83=A2=E3=83=B3=E3=83=89=E3=82=B7=E3=83=
=86=E3=82=A3=E3=82=A2=E3=83=AB=E3=83=AB=E3=80=80=E6=A9=BF=E5=8E=9F
> 13. =E3=83=8B=E3=83=A5=E3=83=BC=E3=82=BA=E3=80=80=E7=86=8A=E6=9C=AC
>
> My client tells me that entry 1 should actually come after the 3rd =20
> entry and
> before the fourth.

He is right. Usually Japanese words are sorted on the pronunciation =20
(shown between [...] below).

1. [=E3=81=82=E3=81=BA=E3=81=A3=E3=81=8F=E3=81=99]	=
=E3=82=A2=E3=83=9A=E3=83=83=E3=82=AF=E3=82=B9=E3=80=80=E7=A6=8F=E5=B1=B1*
2. [=E3=81=82=E3=81=BF=E3=82=85=E3=81=B7=E3=82=89=E3=81=96]	=
=E3=82=A2=E3=83=9F=E3=83=A5=E3=83=97=E3=83=A9=E3=82=B6=E3=80=80=E9=B9=BF=E5=
=85=90=E5=B3=B6
3. [=E3=81=84=E3=81=9B=E3=81=9F=E3=82=93=E3=81=98=E3=81=87=E3=81=84=E3=81=82=
=E3=83=BC=E3=82=8B=E3=81=8D=E3=82=87=E3=81=86=E3=81=A8=E3=81=A6=E3=82=93]	=
=E4=BC=8A=E5=8B=A2=E4=B8=B9=E3=80=80JR=20
=E4=BA=AC=E9=83=BD=E5=BA=97
4. [=E3=81=8A=E3=81=8F=E3=81=AE]	=E3=82=AA=E3=82=AF=E3=83=8E=E3=80=80=
=E6=97=AD=E5=B7=9D
5. [=E3=81=95=E3=81=8F=E3=82=89=E3=81=AE=E3=81=B2=E3=82=83=E3=81=A3=E3=81=8B=
=E3=81=A6=E3=82=93]	=E3=81=95=E3=81=8F=E3=82=89=E9=87=8E=E7=99=BE=E8=B2=
=A8=E5=BA=97=E3=80=80=E4=BB=99=E5=8F=B0
6. [=E3=81=95=E3=81=A4=E3=81=BE=E3=82=84]	=E3=81=95=E3=81=A4=E3=81=BE=
=E5=B1=8B=E3=80=80=E9=B9=BF=E5=85=90=E5=B3=B6
7. [=E3=81=99=E3=81=9F=E3=82=93=E3=81=99]	=E3=82=B9=E3=82=BF=E3=83=B3=
=E3=82=B9=E3=80=80=E7=B1=B3=E5=AD=90
8. [=E3=81=9D=E3=81=94=E3=81=86=E3=81=8A=E3=81=8A=E3=81=BF=E3=82=84=E3=81=A6=
=E3=82=93]	=E3=81=9D=E3=81=94=E3=81=86=E3=80=80=E5=A4=A7=E5=AE=AE=E5=BA=
=97
9. [=E3=81=9D=E3=81=94=E3=81=86=E3=81=93=E3=81=86=E3=81=B9=E3=81=A6=E3=82=93=
]	=E3=81=9D=E3=81=94=E3=81=86=E3=80=80=E7=A5=9E=E6=88=B8=E5=BA=97
10. [=E3=81=9D=E3=81=94=E3=81=86=E3=81=A1=E3=81=B0=E3=81=A6=E3=82=93]	=
=E3=81=9D=E3=81=94=E3=81=86=E3=80=80=E5=8D=83=E8=91=89=E5=BA=97
11. [=E3=81=9D=E3=81=94=E3=81=86=E3=82=88=E3=81=93=E3=81=AF=E3=81=BE=E3=81=
=A6=E3=82=93]	=E3=81=9D=E3=81=94=E3=81=86=E3=80=80=E6=A8=AA=E6=B5=9C=E5=BA=
=97
12. [=E3=81=A0=E3=81=84=E3=82=84=E3=82=82=E3=82=93=E3=81=A9=E3=81=97=E3=81=
=A6=E3=81=83=E3=81=82=E3=82=8B=E3=82=8B]	=E3=83=80=E3=82=A4=E3=82=A2=
=E3=83=A2=E3=83=B3=E3=83=89=E3=82=B7=20
=E3=83=86=E3=82=A3=E3=82=A2=E3=83=AB=E3=83=AB=E3=80=80=E6=A9=BF=E5=8E=9F
13. [=E3=81=AB=E3=82=85=E3=83=BC=E3=81=9A]	=E3=83=8B=E3=83=A5=E3=83=BC=
=E3=82=BA=E3=80=80=E7=86=8A=E6=9C=AC

* If there is another =E3=82=A2=E3=83=9A=E3=83=83=E3=82=AF=E3=82=B9, =
e.g. =E3=82=A2=E3=83=9A=E3=83=83=E3=82=AF=E3=82=B9=E5=BA=83=E5=B3=B6, =
you =20
have to use [=E3=81=82=E3=81=BA=E3=81=A3=E3=81=8F=E3=81=99=E3=81=B5=E3=81=8F=
=E3=82=84=E3=81=BE].

> =46rom this description on manyogana, I'm thinking they're saying =20
> that collation of the glyph =E4=BC=8A should be based on its katakana =20=

> adaptation =E3=82=A4 which makes sense:
>
> http://en.wikipedia.org/wiki/Manyogana

I'm not an expert of Japanese language and literature. But as far as =20
modern Japanese is concerned, I think it it inappropriate to =20
associate the pronunciation of a kanji (Chinese letter and pseudo-=20
Chinese letter used in Japanese) to a man'yogana. =E4=BC=8A=E5=8B=A2 is =
a common =20
proper name and pronounced =E3=81=84=E3=81=9B.

> 3. Is the solution to first convert the manyogana characters to =20
> katakana and then do the msort?

Yes.

> If so does anyone know of a Perl module to do this or a nice =20
> reference that I could use more programmatically than the image on =20
> the link above?

I don't know and I'm afraid there's not such a module. To give a =20
pronunciation to all common kanji words would require a large =20
dictionary...

> 4. Can anyone think of any other glyphs or classes of Japanese =20
> glyphs similar to manyogana that I should be worried about?

Romaji -- JR in "JR=E4=BA=AC=E9=83=BD=E5=BA=97" in your example.



Kino

=E2=98=AF