得到漢字的拼音

2021-03-31 20:15:46 字數 1465 閱讀 9974

function tform1.getpy(shz: string): string;

vari: integer;

py: string;

s: string;

function getpyindexchar(hzchar: string): char;

begin

case word(hzchar[1]) shl 8 + word(hzchar[2]) of

$b0a1..$b0c4: result := 'a';

$b0c5..$b2c0: result := 'b';

$b2c1..$b4ed: result := 'c';

$b4ee..$b6e9: result := 'd';

$b6ea..$b7a1: result := 'e';

$b7a2..$b8c0: result := 'f';

$b8c1..$b9fd: result := 'g';

$b9fe..$bbf6: result := 'h';

$bbf7..$bfa5: result := 'j';

$bfa6..$c0ab: result := 'k';

$c0ac..$c2e7: result := 'l';

$c2e8..$c4c2: result := 'm';

$c4c3..$c5b5: result := 'n';

$c5b6..$c5bd: result := 'o';

$c5be..$c6d9: result := 'p';

$c6da..$c8ba: result := 'q';

$c8bb..$c8f5: result := 'r';

$c8f6..$cbf9: result := 's';

$cbfa..$cdd9: result := 't';

$cdda..$cef3: result := 'w';

$cef4..$d188: result := 'x';

$d1b9..$d4d0: result := 'y';

$d4d1..$d7f9: result := 'z';

else

result := char(32);

end;

end;

begin

s := '';

i := 1;

while i <= length(shz) do

begin

py := copy(shz, i, 1);

if py >= chr(128) then

begin

inc(i);

py := py + copy(shz, i, 1);

s := s + getpyindexchar(py);

endelse

s := s + py;

inc(i);

end;

result := s;

end;

得到漢字拼音的原碼

得到漢字的首拼 漢字 public static string getshoupin string hz return ret private static string getpinyin2 string hz int i1 short zw 0 int i2 short zw 1 hz int ...

從全拼音中得到漢字拼音

1 jj的 create function dbo funcgetpy str nvarchar 4000 returns nvarchar 4000 as begin declare strlen int,renvarchar 4000 declare ttable chr nchar 1 col...

從全拼音中得到漢字拼音

1 jj的 create function dbo funcgetpy str nvarchar 4000 returns nvarchar 4000 as begin declare strlen int,renvarchar 4000 declare ttable chr nchar 1 col...

得到漢字的拼音碼

create function f getpy str nvarchar 4000 returns nvarchar 4000 as begin declare strlen int,re nvarchar 4000 declare t table chr nchar 1 collate chine...

根據漢字得到拼音的類庫(二)

拼音漢字對照 式如下 private string wordlist 吖錒錒阿嗄啊 哀哎唉噯噯埃娭挨欸誒誒銰鑀鑀啀嘊嵦捱敱敳癌皚皚磑磑騃 佁娾昹毐矮藹藹躷靄靄馤 伌僾靉嗌堨塧壒嬡嬡愛懓懝戹曖曖濭愛璦璦皧瞹砨砈硋礙礙艾薆譪賹鑀閡阨阸隘靉餲鴱 攢躦躦鑚鑽鑽篹籫繤纂纉纘纘 揝攥賺贃饡 厜嶉樶纗羧脧蟕嘴噿嶊...