类 HanziToPinyin


  • public class HanziToPinyin
    extends java.lang.Object
    An object to convert Chinese character to its corresponding pinyin string. For characters with multiple possible pinyin string, only one is selected according to ICU Transliterator class. Polyphone is not supported in this implementation.
    • 方法详细资料

      • hasChineseTransliterator

        public boolean hasChineseTransliterator()
      • transliterate

        public java.lang.String transliterate​(java.lang.String input)
      • get

        public java.util.ArrayList<HanziToPinyin.Token> get​(java.lang.String input)
        Convert the input to a array of tokens. The sequence of ASCII or Unknown characters without space will be put into a Token, One Hanzi character which has pinyin will be treated as a Token. If there is no Chinese transliterator, the empty token array is returned.
      • getPinyin

        public static java.lang.String getPinyin​(java.lang.String input)