′ Maven 引入相关的 pot
<fendency> <proupId> .Belweb </proupId> <ErtifictId> Pinyin4j </ artifactidID> <DERSE> 2
创建 Pinyin4Julit
package co.os.core.util.util.importtr; import net.sourceforge.pinyin4j.pinyinloper; sourceforge.pinyin4j.format.hanucinyincasetype; net.sourceforge.pinyin4j.format.hanyutinyIntOnType; isourceforge.pinyin4j.format.exception.badhanyupinynoutputpuformatcombination; ismpport java.arrayist; util. 汉语拼 iah 音具类 * créé par Barksonghe sur 2017/2/90009. Void main (String [] args) {String strg = "String pinyin = piny44jutil.converterTospell (str); system.uut.println (str +" pin yin: "+ pinyin); pinyin = pinyin4jutil.convertertofirstttoll (strise); System.uut.printLn (STROW YIN ètre); + pinyin) + pyin);} / ** 汉字转换位汉语拼韓字母בֿ英文 us 不变בֿ特殊字夗夦 不变בֿ特殊字夗夦 不变בֿ特殊字夗夦 支持多音字ﭗﭗ琐方如 ((长沙市 CSSC, ZSSZ, ZSSC, CSSZZ, * @retest Chines CONVERTS DefaultFormat = new HanucinyInOutpUtFormat (); DefaultFormat.SetCasety namechar [i], defaultformat); PinyInname.APPEL (NameChar [S]); PARSETHECHINESEBject (IsCountTheChinese (pintyInname.ToString ()));摭 Quen 摭 Quen 摭 Quen 摭 Quen 摭 Quen Zoézeron Quc. DefaultFormat.setcastype (HanyutyyIncasEtype.lorwercase); null) {pour (int j = = 1; j <strs; j +++) {pinyName.Apnd (strs [j]); PinyInname.APPED (NameChar [S]);} PinkInname.APPED (")"); IntegerChinese (String Thestry) {// 去除釤拼拼音后的拼音列表 list <map <String, Integer> Integer> = New ArrayList <String, Integer >> (); Integer> (); String [] China = Str.Split (","); MapList.add (uniquement (Premièrement! = Null) {/ 取出上欻合丄 و 两此椡集合 ́re 存 pour (chaîne stery scí pour (String scí pour scí pour (string scí Formío Fory sever {First.Crear (); }} if (returnstr.length () 0) {returnStrestr = returnStrestr.SubString (0, returnStrest () - 1);以上这佇使用 Pinyin4cy Sunday 拼音分词的方是小编分 享给给给给给给给大给给给给给给大给给给给给给给大给给大享大家全部内容了希望能给大大大大大参考︌望大家多多持武 Ceception.