首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

小测试,看看哪位高手的程序最优,将汉字转换成汉语拼音

2012-01-20 
小测试,看看谁的程序最优,将汉字转换成汉语拼音。现有一张表,结构如下:cnCharspellenChar吖aA阿aA啊aA嫒yua

小测试,看看谁的程序最优,将汉字转换成汉语拼音。
现有一张表,结构如下:

cnChar         spell         enChar
吖                 a                 A
阿                 a                 A
啊                 a                 A
嫒                 yuan           Y
....

请编写一个C#程序或一个存储过程,实现输入任意的汉字组合,将其翻译成汉语拼音。

public   string   CnSpell(string   cnChars)
{

}

[解决办法]
sf
[解决办法]
网上可以找到一个拼音组件(很久以前下载过一个的),然后reflector,就可以知道怎么做了.
[解决办法]
关注!
[解决办法]
用搜索树存储
[解决办法]
一条语句不就行了吗?
declare @cnChar char(200)
select enChar from tb
where cnChar=@cnChar
[解决办法]
string teststr = "这是测试用的字符串 ";
string retstr = " ";
foreach (char testchar in teststr)
{
retstr = retstr + GetPinYin(testchar);
}


public string GetPinYin(char c)
{
......
}

热点排行