|
|
@ -31,6 +31,7 @@ public class Pinyin4jUtil { |
|
|
|
duoyinMap.put('均',new String[]{"jun"}); |
|
|
|
duoyinMap.put('会', new String[]{"hui"}); |
|
|
|
duoyinMap.put('属', new String[]{"shu"}); |
|
|
|
duoyinMap.put('调', new String[]{"diao"}); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -42,7 +43,6 @@ public class Pinyin4jUtil { |
|
|
|
*/ |
|
|
|
public static String getFirstSpellPinYin(String src, boolean isFullSpell) { |
|
|
|
String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1)); |
|
|
|
System.out.println(targetStr); |
|
|
|
String[] split = targetStr.split(","); |
|
|
|
if (split.length > 1) { |
|
|
|
targetStr = split[0]; |
|
|
@ -59,7 +59,6 @@ public class Pinyin4jUtil { |
|
|
|
*/ |
|
|
|
public static String getSpellPinYin(String src, boolean isFullSpell,Integer preFont) { |
|
|
|
String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, preFont)); |
|
|
|
System.out.println(targetStr); |
|
|
|
String[] split = targetStr.split(","); |
|
|
|
if (split.length > 1) { |
|
|
|
targetStr = split[0]; |
|
|
@ -139,8 +138,8 @@ public class Pinyin4jUtil { |
|
|
|
} else if (((int) c >= 65 && (int) c <= 90) |
|
|
|
|| ((int) c >= 97 && (int) c <= 122)) {//英文
|
|
|
|
temp[i] = new String[]{String.valueOf(srcChar[i])}; |
|
|
|
} else { |
|
|
|
temp[i] = new String[]{""}; |
|
|
|
} else {//非汉字全盘返回即可
|
|
|
|
temp[i] = new String[]{String.valueOf(srcChar[i])}; |
|
|
|
} |
|
|
|
} |
|
|
|
String[] pingyinArray = exchange(temp); |
|
|
|