public class getpinyin ;
private static int table = new int[27];
private static maprarewords;
private static mapbookfamilynames;
private static mapbookfamilysurname;
static catch (exception ex)
rarewords = new hashmap();
iterator it=prop.entryset().iterator();
while(it.hasnext())
string file_name_1 = new constant().getclass().getclassloader()
.getresource("rarewords111.properties").getfile();
properties prop1 = new properties();
try catch (exception ex)
bookfamilynames = new hashmap();
iterator it1=prop1.entryset().iterator();
while(it1.hasnext())
string file_name_2 = new constant().getclass().getclassloader()
.getresource("rarewords222.properties").getfile();
properties prop2 = new properties();
try catch (exception ex)
bookfamilysurname = new hashmap();
iterator it2 = prop2.entryset().iterator();
while(it2.hasnext())
}public string getrareword(char ch)
}return "0";
}//根據乙個包含漢字的字串返回乙個漢字拼音首字母的字串
public string getpinyin(string sourcestr) else else else }}
} else else else }}
} else else }}
} catch (exception e)
return result;
}@suppresswarnings("static-access")
public string getxin(string xin)
if (xin.length() > 1)
} } else } }
return "0";
}//主函式,輸入字元,得到他的聲母,
//英文本母返回對應的大寫字母
//其他非簡體漢字返回 '0'
public char char2alpha(char ch)
if (i >= 26)
return '0';
else
return alphatable[i];
}private boolean match(int i, int gb)
//取出漢字的編碼
private int gbvalue(char ch) catch (exception e)
}
漢字拼音簡碼
獲取乙個漢字的拼音聲母 unicode格式的乙個漢字 public static char convert char chinese byte asciibytes encoding.convert unicode,gb2312,unicodebytes 計算該漢字的gb 2312編碼 int n ...
C 實現漢字拼音簡碼
using system using system.collections.generic using system.text using microsoft.visualbasic namespace trancepy console.write 該系列漢字的拼音簡碼分別為 strpy n sta...
C 獲取漢字拼音
using system using system.collections.generic using system.text using system.text.regularexpressions namespace ctr.common.tools 機內碼對應的拼音陣列 private sta...