public Hiragana transcribe(Katakana katakana) {
    final String katakanaValue = katakana.getValue();
    String hiraganaValue = "";

    for (int index = 0; index < katakanaValue.length(); index++) {
      final char hiraganaCharacter = katakanaValue.charAt(index);
      if (hiraganaCharacter == 'ー') {
        hiraganaValue += hiraganaCharacter;
      } else {
        final char katakanaCharacter =
            (char) ((hiraganaCharacter) - HIRAGANA_KATAKANA_UNICODE_SHIFT);
        hiraganaValue += katakanaCharacter;
      }
    }
    return new Hiragana(hiraganaValue);
  }
Exemple #2
0
 public static boolean isKatakana(String text) {
   return Katakana.isKatakana(text);
 }