String [][] HanziToPinyin = { {"啊","a","1"}, {"阿","a","1"}, ..., {"我","wo"}, {"斡","wo","4"}, ... };二维数组的初始化要自己来,顺序为内码值顺序(查表时数组第一维下标可由该汉字内码与“啊”的内码值的差值直接得到);第二维内容分别为:汉字,拼音,声调。
解决方案 »
- java.lang.NoClassDefFoundError: Could not initialize class SQLite.JDBC2x.Databas
- 求教:如何用程序实现目录结构判断并显示在SWT的Tree控件中?
- Groovy数据库操作事务相关
- Hibernagte中的cat是什么意思
- 求一个正则表达式!
- jTable不可编辑,但是可以选择行,也可以选择列
- 菜鸟问题,关于jdk与jre
- 给分,感谢wyhgg的SMS资料
- 把.java 改成 .html 代码不换行原因
- java 输入流问题
- 求一个基于http的文件传输工具,500分
- 请推荐一款能生成 Mac Os X(Aqual) 那样晶莹剔透的按钮(图片)的软件
{
public static void main(String[] args)
{
byte[] two_bytes = new byte[2];
System.out.print("<TABLE border='1' cellPadding=0 cellSpacing=0 width='199' style='border: 1px solid;' bordercolor='#ff6600'><tr>");
System.out.print("<TH bordercolordark=#ffffff bgColor=#FEC261 height='20' align='center'><font color='#000000'> </font></TH>");
System.out.print("<TH bordercolordark=#ffffff bgColor=#FEC261 height='20' align='center'><font color='#000000'>位</font></TH>"); for(int i=1; i<=94; i++)
{
System.out.print("<TH bordercolordark=#ffffff bgColor=#FEC261 height='20' align='center'><font color='#000000'>" + i + "</font></TH>");
} System.out.println("</tr>");
System.out.println("<tr><td style=border-style:'none'>区</td><td style=border-style:'none'> </td><tr>"); for(int i=1; i<=94; i++)
{
for(int j=1; j<=94; j++)
{
if (j == 1)
{
System.out.print("<tr><td style=border-style:'none'>" + i + "</td><td style=border-style:'none'> </td><td style=border-style:'none'>");
}
else
System.out.print("<td style=border-style:'none'>"); two_bytes[0] = (byte)(0xA0 + i);
two_bytes[1] = (byte)(0xA0 + j);
System.out.write(two_bytes, 0, 2); System.out.print("</td>");
}
System.out.println("</tr>"); }
System.out.print("</table>");
}
}
http://community.csdn.net/Expert/topic/3472/3472337.xml?temp=.1701624
* @(#)CnToSpell.java
* 版权声明 easydozer 版权所有 违者必究
*
* 修订记录:
* 1)更改者:谢计生
* 时 间:2004-10-20
* 描 述:创建
*/
package com.easydozer.commons.util;import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Set;/**
* <pre>汉字转化为全拼</pre>
* <BR><DL><DT><B>JDK版本:</B></DT><BR><DD>1.4</DD></DL>
* @author 谢计生
* @version 1.0
* @see
* @since 1.0
*/
public class CnToSpell
{
private static LinkedHashMap spellMap = null; static
{
if(spellMap == null){
spellMap = new LinkedHashMap(400);
}
initialize();
System.out.println("Chinese transfer Spell Done.");
} private CnToSpell()
{
}
{
spellMap.put(spell,new Integer(ascii));
} private static void initialize()
{
spellPut("a", -20319);
spellPut("ai", -20317);
spellPut("an", -20304);
spellPut("ang", -20295);
spellPut("ao", -20292);
spellPut("ba", -20283);
spellPut("bai", -20265);
spellPut("ban", -20257);
spellPut("bang", -20242);
spellPut("bao", -20230);
spellPut("bei", -20051);
spellPut("ben", -20036);
spellPut("beng", -20032);
spellPut("bi", -20026);
spellPut("bian", -20002);
spellPut("biao", -19990);
spellPut("bie", -19986);
spellPut("bin", -19982);
spellPut("bing", -19976);
spellPut("bo", -19805);
spellPut("bu", -19784);
spellPut("ca", -19775);
spellPut("cai", -19774);
spellPut("can", -19763);
spellPut("cang", -19756);
spellPut("cao", -19751);
spellPut("ce", -19746);
spellPut("ceng", -19741);
spellPut("cha", -19739);
spellPut("chai", -19728);
spellPut("chan", -19725);
spellPut("chang", -19715);
spellPut("chao", -19540);
spellPut("che", -19531);
spellPut("chen", -19525);
spellPut("cheng", -19515);
spellPut("chi", -19500);
spellPut("chong", -19484);
spellPut("chou", -19479);
spellPut("chu", -19467);
spellPut("chuai", -19289);
spellPut("chuan", -19288);
spellPut("chuang", -19281);
spellPut("chui", -19275);
spellPut("chun", -19270);
spellPut("chuo", -19263);
spellPut("ci", -19261);
spellPut("cong", -19249);
spellPut("cou", -19243);
spellPut("cu", -19242);
spellPut("cuan", -19238);
spellPut("cui", -19235);
spellPut("cun", -19227);
spellPut("cuo", -19224);
spellPut("da", -19218);
spellPut("dai", -19212);
spellPut("dan", -19038);
spellPut("dang", -19023);
spellPut("dao", -19018);
spellPut("de", -19006);
spellPut("deng", -19003);
spellPut("di", -18996);
spellPut("dian", -18977);
spellPut("diao", -18961);
spellPut("die", -18952);
spellPut("ding", -18783);
spellPut("diu", -18774);
spellPut("dong", -18773);
spellPut("dou", -18763);
spellPut("du", -18756);
spellPut("duan", -18741);
spellPut("dui", -18735);
spellPut("dun", -18731);
spellPut("duo", -18722);
spellPut("e", -18710);
spellPut("en", -18697);
spellPut("er", -18696);
spellPut("fa", -18526);
spellPut("fan", -18518);
spellPut("fang", -18501);
spellPut("fei", -18490);
spellPut("fen", -18478);
spellPut("feng", -18463);
spellPut("fo", -18448);
spellPut("fou", -18447);
spellPut("fu", -18446);
spellPut("ga", -18239);
spellPut("gai", -18237);
spellPut("gan", -18231);
spellPut("gang", -18220);
spellPut("gao", -18211);
spellPut("ge", -18201);
spellPut("gei", -18184);
spellPut("gen", -18183);
spellPut("geng", -18181);
spellPut("gong", -18012);
spellPut("gou", -17997);
spellPut("gu", -17988);
spellPut("gua", -17970);
spellPut("guai", -17964);
spellPut("guan", -17961);
spellPut("guang", -17950);
spellPut("gui", -17947);
spellPut("gun", -17931);
spellPut("guo", -17928);
spellPut("ha", -17922);
spellPut("hai", -17759);
spellPut("han", -17752);
spellPut("hang", -17733);
spellPut("hao", -17730);
spellPut("he", -17721);
spellPut("hei", -17703);
spellPut("hen", -17701);
spellPut("heng", -17697);
spellPut("hong", -17692);
因为代码矿长,本forum中没法贴完整,可以查阅:http://dev.csdn.net/develop/article/44/44077.shtm