
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tlug] Search MySQL for Japanese Names
Dave M G writes:
> I've been tasked with building a MySQL database that will store the
> names of people in Japanese kanji. Those names need to be searched
> alphabetically from a web interface.
You're going to need to get people to provide yomi. There are a fair
number of names that can be read different ways, and many names that
simply cannot be read from the kanji because somebody made them up.
> Since kanji can have multiple readings, will I need to store a separate,
> katakana version of the name in order to search for it "alphabetically"?
Just as you would do "tolower(candidate) == tolower(input)" for names
in latin scripts, you should pick a kana representation for the data
base (I would suggest Unicode normal decomposed form, especially if
you're going to be dealing with foreign names) and then have a
function to convert from whatever input the user chooses to the normal
form you've chosen. This can be done algorithmically just about
one-to-one ("decomposed" means that characters with nigori mark become
two characters in the database).
> Or can I get an ascending order of names with just the kanji?
No. In many cases you can make a good guess, but you just cannot be
sure. Even in a disaster, "official" Japanese sources will simply
refuse to try (and threaten to sue you if you do, but that's another
story).
Home |
Main Index |
Thread Index