已知一个汉字,如何得知它的拼音
如:“中”,如何求的它的拼音
最好有个例子,解决马上给分
如:“中”,如何求的它的拼音
最好有个例子,解决马上给分
解决方案 »
- Operator not applicable to this operand type 咋办??
- 请教Google桌面搜索Delphi文件索引编制问题。
- 弄了个多论坛搜索,欢迎测试,呵呵
- checklistbox 组件如何改变items各项的颜色,比如有的要求红色有的要求绿色
- 各位大哥一个想不通的一维数组的问题?
- 如何卸载安装的第三方控件?
- TADOQuery控件的SQL语句执行问题
- 忙了一个多月,今天beta终于完成了,特来发分!
- 调试的问题哦
- 关于datasnap的问题!!!
- 急!!!数据库中的时间项在DBgrid中为什么前面加了个1899-12-30 ,怎样修改过来。
- delphi在移动控间的时候是怎么做的?
Function GetHzPy(Const AHzStr: String): String;
Const
ChinaCode: Array[0..25, 0..1] Of Integer = ((1601, 1636), (1637, 1832), (1833, 2077),
(2078, 2273), (2274, 2301), (2302, 2432), (2433, 2593), (2594, 2786), (9999, 0000),
(2787, 3105), (3106, 3211), (3212, 3471), (3472, 3634), (3635, 3722), (3723, 3729),
(3730, 3857), (3858, 4026), (4027, 4085), (4086, 4389), (4390, 4557), (9999, 0000),
(9999, 0000), (4558, 4683), (4684, 4924), (4925, 5248), (5249, 5589));
Var
i, j, HzOrd: integer;
Hz: String[2];
Begin
i := 1;
While i <= Length(AHzStr) Do
Begin
If (AHzStr[i] >= #160) And (AHzStr[i + 1] >= #160) Then
Begin
HzOrd := (Ord(AHzStr[i]) - 160) * 100 + Ord(AHzStr[i + 1]) - 160;
For j := 0 To 25 Do
Begin
If (HzOrd >= ChinaCode[j][0]) And (HzOrd <= ChinaCode[j][1]) Then
Begin
Result := Result + char(byte('A') + j);
break;
End;
End;
Inc(i);
End Else Result := Result + AHzStr[i];
Inc(i);
End;
End;
const
ChinaCode: array[0..25, 0..1] of Integer = ((1601, 1636), (1637, 1832), (1833, 2077),
(2078, 2273), (2274, 2301), (2302, 2432), (2433, 2593), (2594, 2786), (9999, 0000),
(2787, 3105), (3106, 3211), (3212, 3471), (3472, 3634), (3635, 3722), (3723, 3729),
(3730, 3857), (3858, 4026), (4027, 4085), (4086, 4389), (4390, 4557), (9999, 0000),
(9999, 0000), (4558, 4683), (4684, 4924), (4925, 5248), (5249, 5589));
var
i, j, HzOrd: integer;
begin
i := 1;
while i <= Length(AHzStr) do
begin
if (AHzStr[i] >= #160) and (AHzStr[i + 1] >= #160) then
begin
HzOrd := (Ord(AHzStr[i]) - 160) * 100 + Ord(AHzStr[i + 1]) - 160;
for j := 0 to 25 do
begin
if (HzOrd >= ChinaCode[j][0]) and (HzOrd <= ChinaCode[j][1]) then
begin
Result := Result + char(byte('A') + j);
break;
end;
end;
Inc(i);
end else Result := Result + AHzStr[i];
Inc(i);
end;
end;