汉字拼音首字母完全解决方案(无错误) ( 积分: 50 )

  • 主题发起人 主题发起人 凤冠坡
  • 开始时间 开始时间
arwin@126.com
研究研究,谢谢了。
 
180175453@qq.com
大家研究,谢谢楼主了
 
请到
http://www.byitsoft.com/by/xiazhai.asp
下载"MP3歌库拷贝管理软件商业版"
里面有拼音库的操作
里面有拼音的DLL(TOPINGYIN.dll),自己开发的.
函数调用
function StrToPingYin(sText:pchar):pchar;stdcall;external 'TOPINGYIN.dll'
速度更不用说了,快得离普,支持所有的字如"龥"查到是"Y",奉献给大家吧
 
顺便发一份给我吧
piaoxueboy@163.com
 
to 飘雪
请到
http://www.byitsoft.com/by/xiazhai.asp
下载"MP3歌库拷贝管理软件商业版"
里面有拼音库的DLL(TOPINGYIN.dll)
 
不再向个别人员发送邮件,公布完全实用的程序好了。
需要微软简繁汉字拼音的请特别发邮件说明:索取微软
拼音首字母程序(或首字母库)。
相信大部分使用国标拼音字母已经足够了。
至于多音字实在没有解决的可能,实际上更加没有解决的
意义,更主要是没有解决的价值。
汉字拼音转换过程(附带国标拼音首字母):
var
ExePath: string;//执行文件目录
PYCode: string;
HZ0001: string
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'1234567890~!@#$%^&amp;*()-+=/|/?<><>&quot;&quot;&quot;''[]{}:;,..';
HZ0002: WideString
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'abcdefghijklmnopqrstuvwxyz' +
'1234567890~!@#$%^&*()-+=\|' +
'/?<>《》“”"'[]{}:;,.。';
function ReadGBPYFromFile: string;
var
TS: TStringList;
begin
ExePath := ExtractFilePath(ParamStr(0));
TS := TStringList.Create;
TS.LoadFromFile(ExePath + 'GBPYCode.DAT');
Result := TS.Text;
TS.Free;
end;

function GetGBPYStr(HZ: WideString): string;
var
n, i: integer;
C: Char;
PYStr: string;
D: string;
P, Q, W: integer;
PCStr: Char;
begin
if GBPYCode = '' then
GBPYCode := ReadGBPYFromFile;
PYStr := '';
for i := 1 to Length(HZ)do
begin
C := string(HZ)[1];
//取 ASCII 码判断是否汉字
if C < #128 then
begin
PCStr := UpperCase(HZ)[1];
end else
begin
D := string(HZ);
P := Pos(D, hz0002);
if P > 0 then
begin
PCStr := HZ0001[P];
end else
begin
Q := Ord(D[1]) - 176;
W := Ord(D[2]) - 160;
if (Q < 0) or (W <= 0) then
PCStr := '?' else
try
N := Q * 94 + W;
PCStr := GBPYCode[N];
except
PCStr := '?';
//非汉字的那些符号
end;
end;
end;
PYStr := PYStr + PCStr;
end;
result := PYStr;
end;
//国标拼音首字母文件:GBPYCode.DAT 内容(长文本文件)
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBPBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBPBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCZCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCSCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCZCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDZDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDTDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFFFFFFFFFFF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MLJDSYNSPRSKMKMPCKLGDBQTFZSWTFGGLYPLLJZHGJJGYPZLTCSMCNBTJBQFKTHPYZGKPBBYMTDSSXTBNPDKLEYCJNYCDYKZDDHQHSDZSCTARLLTKZLGECLLKJLQJAQNBDKKGHPJTZQKSECSHALQFMMGJNLYJBBTMLYZXDCJPLDLPCQDHZYCBZSCZBZMSLJFLKRZJSNFRGJHXPDHYJYBZGDLQCSEZGXLBLHYXTWMABCHECMWYJYZLLJJYHLGBDJLSLYGKDZPZXJYYZLWCXSZFGWYYDLYHCLJSCMBJHBLYZLYCBLYDPDQYSXQZBYTDKYXJYYCNRJMPDQGKLCLJBCTBJDDBBLBLCZQRPSXJCJLZCSHLTOLJNMDDDLNGKATHQHJHYKHEZNMSHRPHQQJCHGMFPRXHJGDYCHGKLYRZQLCYQJNZSQTKQJYMSZSWLCFQQQXYFGGYPTQWLMCRNFKKFSYYLQBMQAMMMYXCTPSHCPTXXZZSMPHPSHMCLMLDQFYQXSZYJDJJZZHQPDSZGLSTJBCKBXYQZJSGPSXQZQZRQTBDKYXZKHHGFLBCSMDLDGDZDBLZYYCXNNCSYBZBFGLZZXSWMSCCMQNJQSBDQSJTXXMBLTXCCLZSHZCXRQJGJYLXZFJPHYMZQQYDFQJQLZZNZJCDGZYGZTXMZYSCTLKPHTXHTLBJXJLXSCDQXCBBTJFQZFSLTJBTKQBXXJJLJCHCZDBZJDCZJDCPRNPQCJPFCZLCLZXZDMXMPHJSGZGSZZQLYLWTJPFSYAXMCJBTZYYCWMYTZSJJLQCQLWZMALBXYFBPNLSFHTGJWEJJXXGLLJSTGSHJQLZFKCGNNDSZFDEQFHBSAQTGYLBXMMYGSZLDYDQMJJRGBJTKGDHGKBLQKBDMBYLXWCXYTTYBKMRTJZXQJBHLMHMJJZMQASLDCYXYQDLQCAFYWYXQHZ
 
字母文件内容请复制到 Notpad 里面保存到 GBPYCode.Dat
注意:不能自主地增加回车换行符号,使用自动换行功能即可
方便地看到全部内容。
文件大小:6768 字节,误差正负2字节
 
TO:41426277
我調用你的'TOPINGYIN.dll'如下:
edit2.text:=pchar(StrToPingYin(pchar(edit1.text)));
結果edit2裡面的內容總和edit1一樣
請問我到底該怎樣調用啊?
 
to suyi3026
内容没有中文
 
TO:楼主
谢了,jiangno123@yahoo.com.cn
 
TO:41426277
“内容没有中文”什麼意思啊?
我輸入的無論是漢字還是中文都不能得到正確結果啊
 
内容没有中文
什麼意思?
我輸入的無論是中文還是英文,都不能得出正確結果啊
 
楼主真是好人,谢谢
 
to suyi3026
下确写法
edit2.text:=StrToPingYin(pchar(edit1.text));
 
TO:41426277
你的那個好像不支持繁體中文啊,支持多音字和二級漢字(這個好)
目前網上很多方法 要麼支持一級漢字,不支持多音字;要麼支持二級漢字和繁體字,不支持多音字
 
TO suyi3026,
我刚测了只支持部份繁體中文,不好意思
 
没关系,期待更加完善
你的已经做的很不错了
 
happymengze@163.com
 
我操,这个世界没有天理了~~~~~
 
我的邮箱是wuyongzhen26@yahoo.com.cn
再试一次吧,怎么会不成功呢,记得加CN
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部