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
CC BY-SA 3.0
2014-11-18T15:24:13.117
19568
2014-11-18T23:31:08.700
2014-11-18T15:31:32.027
7737
7737
question
kana
Sorting and Grouping a Japanese Index or Glossary
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).
CC BY-SA 3.0
2014-11-18T15:39:13.343
19569
2014-11-18T23:31:08.700
2020-06-17T08:18:27.500
-1
4091
19568
answer
> Since it is possible to write the phonetic translation using hiragana or
> katakana, which of these characters do I use for sorting?

Considering the fact that hiragana and katakana are, as virmaior already said,
in a one-to-one correlation, I think it will be better to consider the sound
they're representing as a sorting criterion, not the graphic representation as
hiragana or katakana.

For example, in 角川新国語辞典 (2007, page 1292) the words are sorted in the
following manner: we know that ら = ラ = _ra_ , so we have らいらく ( _rairaku_ ) ,
ライラック ( _rairakku_ ) and then らいりん ( _rairin_ ) and nobody says nothing about
the fact that the hiragana words are mixed with the katakana ones.

> do I assign the index terms to the matching hiragana group letter or the
> matching katakana group letter?

Probably I should add that in 角川新国語辞典 the exemplified words are indexed under
the ら label (hiragana). But I think you should use the kana that represents
the majority of the title phonetic translations (if most of the titles can be
written in hiragana, use hiragana, else use katakana).

N.B. If the sorted list is the answer to a search operation, you must give the
user the possibility to make his query in hiragana, katakana or romaji and
still get the right ordered list. For the previous example, if I would type
らい, ライ or _rai_ I should be able get the same list (らいらく, ライラック and then らいりん)
unless I choose not to.
CC BY-SA 3.0
2014-11-18T19:48:20.093
19571
2014-11-18T19:48:20.093
7679
19568
answer