It is an unrecognized pinyin.
For example, the word duo in the Chinese pinyin system will be misjudged.
Later I found a pinyin package net. sourceforge. pinyin4j
Download here http://pinyin4j.sourceforge.net/
The code is as follows: |
Copy code |
Package com. javaer. examples; Import net. sourceforge. pinyin4j. PinyinHelper; Import net. sourceforge. pinyin4j. format. HanyuPinyinOutputFormat; Import net. sourceforge. pinyin4j. format. HanyuPinyinToneType; Public class Pinyin { /** * @ Param args */ Public static void main (String [] args ){ // TODO Auto-generated method stub HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat (); // Url is http://pinyin4j.sourceforge.net/ Format. setToneType (HanyuPinyinToneType. WITHOUT_TONE ); String [] pinyinArray = PinyinHelper. toHanyuPinyinStringArray ('DD', format ); For (int I = 0; I & lt; pinyinArray. length; ++ I) { System. out. println (pinyinArray [I]); } } }
|
Output "duo"
You can try the multi-tone "heavy"
The output is
Zhong
Chong
A good Chinese character to pinyin package