Sorting and Grouping a Japanese Index or Glossary


I'm writing a program that will automatically sort the index of a Japanese
book and group the terms under the associated Japanese letter. I have found
numerous instructions, but I'm still unsure how to do it correctly.

I know we need the phonetic translation of a term in order to sort it. So far
so good. Since it is possible to write the phonetic translation using hiragana
or katakana, which of these characters do I use for sorting?

If say my terms are mixed i.e. the phonetic translation starts with hiragana
and katakana letters, do I assign the index terms to the matching hiragana
group letter or the matching katakana group letter?

Example: do I place よ terms under the index group letter ヨ? If yes, can I
always assign hiragana terms to the associated katakana group letter? I.e. my
index will only use katakana grouping letters.

Thanks for any help.

Best regards,

Robert




There's basically a one-to-one correlation between hiragana and katakana.

The two main exceptions that I'm aware of are:

# in how long vowels are transcribed.

For katakana, a dash-like element is preferred. For hiragana, the character
for either o or u is used (often for historical reasons as the pronunciation
of the long vowel sound for o is identical at this point).

# in the use of certain katakana for foreign words

Particularly, I'm thinking here of V/B sounds where the v is often written as
the "u" character plus a phonetic mark. These should not be sorted together
with the unmarked group. (e.g., デイヴィス for Davis)

* * *

# maybe not "so far so good" on the kanji -> kana

Kanji to kana conversion is harder than it might seem. Automated output is
almost guaranteed to have trouble with characters that can be read in multiple
ways. For instance, depending on context, 今日 is either こんにち or きょう. People's
names are even worse.

For church for instance, we use a furiganizer to help a friend whose Japanese
reading level is pretty bad. But the furiganizer is often very wrong:

Consider
"[Sabbath"](http://ja.wikipedia.org/wiki/%E5%AE%89%E6%81%AF%E6%97%A5#.E6.97.A5.E6.9C.AC.E8.AA.9E.E3.81.A7.E3.81.AE.E8.AA.AD.E3.81.BF.E6.96.B9)
[安息]{あんそく}[日]{??}. The last character can be read [じつ]{jitsu}, [び]{bi}, or
[にち]{nichi} and the different translations don't even agree.

or

"lord" 主 which can be read [ぬし]{nushi} or [しゅ]{shu}

* * *

All of this makes is so that sorting in Japanese is a relatively difficult
problem. It's also not agreed upon _how_ to resolve this problem. For an
interesting thread, see <https://groups.google.com/forum/#!msg/django-
users/IasBBYb7UoU/bQiXbowZl8cJ> which suggests converting everything to
hiragana and using _gojyuuon_. The method there advocates converting the
katakana long vowel sound in most contexts to the conventional hiragana (which
varies depending on the preceding vowel).

