MauveCloud's Browser Tests: Kana Generator
Home:
MauveCloud's Browser Tests
Up: Character Set Tests
Documentation
This uses JavaScript to convert a string into hiragana and katakana. I have
created a list of romaji sequences so that it will do something with every
letter in the input string (usually by guessing at missing vowels), though the
results won't always make sense, and I have added a number of sequences that
may not be officially accepted in Japan. This version uses the lesser-known
hash-map functionality of JavaScript, so it should be even faster than the
previous if/elseif constructs (though I guess it might require more memory).
This is partially inspired by the romaji converter that is built into
Jim Breen's WWWJDIC Japanese-English Dictionary Server, but that one
doesn't convert the romaji until the form is submitted.
Key features:
- Support for apostrophes to distinguish certain kana sequences that
require small kana vowels. Some examples are "t'i", "t'u", "s'i", and "w'i".
For such sequences, any vowel can be used after the apostrophe, even if using
the associated small kana vowel doesn't make sense, such as "s'u". An
apostrophe after "n" forces the use of the syllabic "n" kana. Other apostrophes
will usually be left in the hiragana.
- Vowel guessing: if a consonant sound other than "n" is at the end of the
word or followed by another consonant, the default kana for that consonant will
be used (usually the one ending in "u"). However, "m" will be converted to the
"n" kana only before "b", "m", and "p".
- The letter "x" will act like "kisu" if not followed by something that can
be converted to small kana. I have also added "x'" to get "kis" + vowel sound.
For example, the katakana sequence for Texas can be obtained by entering
"tex'as".
- The sequence "ck" is an alternate for "kk".
- The letter "l" can be used in place of "r", though "rl" is allowed for
double-consonants, but not "lr".
- The sequences "kw" and "qu" can be used for "ku" + small kana vowel.
Sequences "gw" and "ts" are also supported, and "k" can be used in front
of a "q" sequence.
- The Japanese comma and period can be generated in the sequence by using
their English equivalents in the "Romaji" field. If an English period is
required, such as for separating the stem from the okurigana when searching a
kanji dictionary, use "\.".
- Long vowels are automatically given the long vowel mark in the katakana
even if a hyphen was not used in the romaji. This version can also handle
traditional romaji with circumflexes or macron accents, though it will always
treat "ô" like "ou" for the hiragana, but like "o-" for katakana.
Special sequences you may need:
| Hiragana | Katakana | Romaji to enter
|
| ぁ | ァ | xa
|
| ぃ | ィ | xi
|
| ぅ | ゥ | xu
|
| ぇ | ェ | xe
|
| ぉ | ォ | xo
|
| ヵ | xka
|
| ヶ | xke
|
| ぢ | ヂ | dji
|
| づ | ヅ | dzu
|
If you have any questions or suggestions (esp. additions or corrections), you
can e-mail me: mauvecloud at mauvecloud dot net (I won't make
this a mailto link, as that would merely encourage spam generators).