com.mayhoo.kanji
Class JapaneseCharacter

java.lang.Object
  |
  +--com.mayhoo.kanji.JapaneseCharacter

public class JapaneseCharacter
extends Object

JapaneseCharacter contains static functions to do various tests on characters to determine if it is one of the various types of characters used in the japanese writing system. There are also a functions to translate between Katakana, Hiragana, and Romaji.

Version:
$Id: JapaneseCharacter.java,v 1.2 2002/04/20 18:10:24 djmay Exp $
Author:
Duane J. May

Field Summary
protected static String[] romaji
          The array used to map hirgana to romaji.
 
Constructor Summary
JapaneseCharacter()
           
 
Method Summary
static boolean isFullwidthKatakana(char c)
          Determines if this character is a Full width Katakana.
static boolean isHalfwidthKatakana(char c)
          Determines if this character is a Half width Katakana.
static boolean isHiragana(char c)
          Determines if this character is one of the Japanese Hiragana.
static boolean isKana(char c)
          Determines if this character is a Japanese Kana.
static boolean isKanji(char c)
          Determines if this character is a Kanji character.
static boolean isKatakana(char c)
          Determines if this character is one of the Japanese Katakana.
static boolean isRomaji(char c)
          Determines if this character could be used as part of a romaji character.
static char toHiragana(char c)
          Translates this character into the equivalent Hiragana character.
static char toKatakana(char c)
          Translates this character into the equivalent Katakana character.
static String toRomaji(char c)
          Translates this character into the equivalent Romaji character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

romaji

protected static String[] romaji
The array used to map hirgana to romaji.

Constructor Detail

JapaneseCharacter

public JapaneseCharacter()
Method Detail

isKana

public static boolean isKana(char c)
Determines if this character is a Japanese Kana.


isHiragana

public static boolean isHiragana(char c)
Determines if this character is one of the Japanese Hiragana.


isKatakana

public static boolean isKatakana(char c)
Determines if this character is one of the Japanese Katakana.


isHalfwidthKatakana

public static boolean isHalfwidthKatakana(char c)
Determines if this character is a Half width Katakana.


isFullwidthKatakana

public static boolean isFullwidthKatakana(char c)
Determines if this character is a Full width Katakana.


isKanji

public static boolean isKanji(char c)
Determines if this character is a Kanji character.


isRomaji

public static boolean isRomaji(char c)
Determines if this character could be used as part of a romaji character.


toKatakana

public static char toKatakana(char c)
Translates this character into the equivalent Katakana character. The function only operates on Hiragana and always returns the Full width version of the Katakana. If the character is outside the Hiragana then the origianal character is returned.


toHiragana

public static char toHiragana(char c)
Translates this character into the equivalent Hiragana character. The function only operates on Katakana characters If the character is outside the Full width or Half width Katakana then the origianal character is returned.


toRomaji

public static String toRomaji(char c)
Translates this character into the equivalent Romaji character. The function only operates on Hiragana and Katakana characters If the character is outside the given range then the origianal character is returned. The resulting string is lowercase if the input was Hiragana and UPPERCASE if the input was Katakana.