public class PinyinHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static String[] |
toGwoyeuRomatzyhStringArray(char ch)
Get all unformmatted Gwoyeu Romatzyh presentations of a single Chinese
character (both Simplified and Tranditional)
|
static String |
toHanYuPinyinString(String str,
HanyuPinyinOutputFormat outputFormat,
String separate,
boolean retain)
Get a string which all Chinese characters are replaced by corresponding
main (first) Hanyu Pinyin representation.
|
static String[] |
toHanyuPinyinStringArray(char ch)
Get all unformmatted Hanyu Pinyin presentations of a single Chinese
character (both Simplified and Tranditional)
|
static String[] |
toHanyuPinyinStringArray(char ch,
HanyuPinyinOutputFormat outputFormat)
Get all Hanyu Pinyin presentations of a single Chinese character (both
Simplified and Tranditional)
|
static String[] |
toMPS2PinyinStringArray(char ch)
Get all unformmatted MPS2 (Mandarin Phonetic Symbols 2) presentations of
a single Chinese character (both Simplified and Tranditional)
|
static String[] |
toTongyongPinyinStringArray(char ch)
Get all unformmatted Tongyong Pinyin presentations of a single Chinese
character (both Simplified and Tranditional)
|
static String[] |
toWadeGilesPinyinStringArray(char ch)
Get all unformmatted Wade-Giles presentations of a single Chinese
character (both Simplified and Tranditional)
|
static String[] |
toYalePinyinStringArray(char ch)
Get all unformmatted Yale Pinyin presentations of a single Chinese
character (both Simplified and Tranditional)
|
public static String[] toHanyuPinyinStringArray(char ch)
For example,
If the input is '间', the return will be an array with
two Hanyu Pinyin strings:
"jian1"
"jian4"
If the
input is '李', the return will be an array with single Hanyu Pinyin
string:
"li3"
Special Note: If the return is "none0", that means the input Chinese character exists in Unicode CJK talbe, however, it has no pronounciation in Chinese
ch - the given Chinese characterpublic static String[] toHanyuPinyinStringArray(char ch, HanyuPinyinOutputFormat outputFormat) throws BadHanyuPinyinOutputFormatCombination
For example,
If the input is '间', the return will be an array with
two Hanyu Pinyin strings:
"jian1"
"jian4"
If the
input is '李', the return will be an array with single Hanyu Pinyin
string:
"li3"
Special Note: If the return is "none0", that means the input Chinese character is in Unicode CJK talbe, however, it has no pronounciation in Chinese
ch - the given Chinese characteroutputFormat - describes the desired format of returned Hanyu Pinyin StringBadHanyuPinyinOutputFormatCombination - if certain combination of output formats happensHanyuPinyinOutputFormat,
BadHanyuPinyinOutputFormatCombinationpublic static String[] toTongyongPinyinStringArray(char ch)
ch - the given Chinese charactertoHanyuPinyinStringArray(char)public static String[] toWadeGilesPinyinStringArray(char ch)
ch - the given Chinese charactertoHanyuPinyinStringArray(char)public static String[] toMPS2PinyinStringArray(char ch)
ch - the given Chinese charactertoHanyuPinyinStringArray(char)public static String[] toYalePinyinStringArray(char ch)
ch - the given Chinese charactertoHanyuPinyinStringArray(char)public static String[] toGwoyeuRomatzyhStringArray(char ch)
ch - the given Chinese charactertoHanyuPinyinStringArray(char)public static String toHanYuPinyinString(String str, HanyuPinyinOutputFormat outputFormat, String separate, boolean retain) throws BadHanyuPinyinOutputFormatCombination
Special Note: If the return contains "none0", that means that Chinese character is in Unicode CJK talbe, however, it has not pronounciation in Chinese. This interface will be removed in next release.
str - A given string contains Chinese charactersoutputFormat - Describes the desired format of returned Hanyu Pinyin stringseparate - The string is appended after a Chinese character (excluding
the last Chinese character at the end of sentence). Note!
Separate will not appear after a non-Chinese characterretain - Retain the characters that cannot be converted into pinyin charactersBadHanyuPinyinOutputFormatCombinationCopyright © 2016. All Rights Reserved.