如何返回输入汉字的声母,例如,我需要返回“我们”的声母为"wm",用什么函数实现,拜托

解决方案 »

  1.   

    DelphiBox.com有代码可以下载http://lysoft.7u7.net
      

  2.   

    function getpyindex(hzchar:String):String;
    var
    str:String;
    i:Integer;
    begin
      str:='';
      for i:=0 to Length(hzchar) do
        case (Word(hzchar[i*2+1])shl 8 + word(hzchar[i*2+2])) of
          $B0A1..$B0C4:str:=str+'A';
          $B0C5..$B2C0:str:=str+'B';
          $B2C1..$B4ED:str:=str+'C';
          $B4ee..$B6e9:str:=str+'D';
          $B6EA..$B7a1:str:=str+'E';
          $B7a2..$B8c0:str:=str+'F';
          $B8C1..$B9FD:str:=str+'G';
          $B9FE..$BBF6:str:=str+'H';      $bbf7..$bfa5:str:=str+'J';
          $bfa6..$c0ab:str:=str+'K';
          $c0ac..$c2e7:str:=str+'L';
          $c2e8..$c4c2:str:=str+'M';
          $c4c3..$c5b5:str:=str+'N';
          $c5b6..$c5bd:str:=str+'O';
          $c5be..$c6d9:str:=str+'P';
          $c6da..$c8ba:str:=str+'Q';
          $c8bb..$c8f5:str:=str+'R';
          $c8f6..$cbf9:str:=str+'S';
          $cbfa..$cdd9:str:=str+'T';      $cdda..$cef3:str:=str+'W';
          $cef4..$d188:str:=str+'X';
          $d1b9..$d4d0:str:=str+'Y';
          $d4d1..$d7f9:str:=str+'Z';
        end;
        Result:=str;
    end;
      

  3.   

    http://tansuo.51.net/download/category.php?dgid=7