KanjiUtils { public static String toHalfwidth(final String katakana) { return translate(katakana, KATAKANA_TO_HALFWIDTH, 1); } private  KanjiUtils(); static boolean isHiragana(char c); static boolean isKatakana(char c); static String halfwidthToKatakana(final String halfwidth); static String toHalfwidth(final String katakana); static boolean isHalfwidth(final char ch); static boolean isKana(char ch); static boolean isKanji(char ch); static boolean isJapaneseChar(final char ch); static int getCommonality(final char ch); static int getCommonality(final String str); static Integer getJlptLevel(final Character kanji); static String getJlptKanjis(final int level); static final Map<KanjiQuiz, String> QUIZ_TABLE; }
@Test public void testToHalfwidthKatakana() { assertEquals("ﾊﾟﾊﾟ", KanjiUtils.toHalfwidth("パパ")); assertEquals("ｺﾝﾋﾟｭｰﾀｰ", KanjiUtils.toHalfwidth("コンピューター")); assertEquals("JOZOﾊﾟﾊﾟFOO", KanjiUtils.toHalfwidth("JOZOパパFOO")); assertEquals("FOOBARBAZ", KanjiUtils.toHalfwidth("FOOBARBAZ")); }