Class KatakanaRomanizer


  • public class KatakanaRomanizer
    extends java.lang.Object
    Converts a Katakana string to Romaji using the pre-defined Katakana-Romaji mapping rules. Internally, this repeatedly performs prefix match on the given char sequence to the pre-built keystroke array until it reaches the end of the sequence, or there are no matched keystrokes.
    • Constructor Detail

      • KatakanaRomanizer

        private KatakanaRomanizer​(CharsRef[][] keystrokes,
                                  java.util.Map<CharsRef,​java.util.List<CharsRef>> romajiMap)
    • Method Detail

      • getInstance

        public static KatakanaRomanizer getInstance()
        Returns the singleton instance of KatakanaRomenizer
      • romanize

        public java.util.List<CharsRef> romanize​(CharsRef input)
        Translates a sequence of katakana to romaji. An input can produce multiple outputs because a keystroke can be mapped to multiple romajis.