PB得到首拼音码函数无错码

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

//得到首拼音码函数

//把这段代码加入到函数地f_get_py(string as_InputString)

char lc_FirstLetter[23]

string ls_ch

string ls_SecondSecTable

string ls_ReturnStr

integer li_SecPosValue[23]

integer i , j

integer li_SectorCode

integer li_PositionCode

integer li_SecPosCode

integer li_offset

//Set initial value

li_SecPosValue[]={1601,1637,1833,2078,2274,2302,2433,2594,2787,3106,3212,3472,3635,3722,3 730,3858,4027,4086,4390,4558,4684,4925,5249 }

lc_FirstLetter[] = { "A ", "B ", "C ", "D ", "E ", "F ", "G ", "H ", "J ", "K ", "L ", "M ", "N ", "O ", "P ", "Q ", "R ", "S ", "T ", "W ", "X ", "Y ", "Z "}

ls_SecondSecTable=

"CJWGNSPGCGNE[Y[BTYYZDXYKYGT[JNNJQMBSGZSCYJSYY[PGKBZGY[YWJKGKLJYWKPJQHY[W[DZL SGMRYPYWWCCKZNKYYGTTNJJNYKKZYTCJNMCYLQLYPYQFQRPZSLWBTGKJFYXJWZLTBNCXJJJJTXD TTSQZYCDXXHGCK[PHFFSS[YBGXLPPBYLL[HLXS[ZM[JHSOJNGHDZQYKLGJHSGQZHXQGKEZZWYSCS CJXYEYXADZPMDSSMZJZQJYZC[J[WQJBYZPXGZNZCPWHKXHQKMWFBPBYDTJZZKQHYLYGXFPTYJYY ZPSZLFCHMQSHGMXXSXJ[[DCSBBQBEFSJYHXWGZKPYLQBGLDLCCTNMAYDDKSSNGYCSGXLYZAYBN PTSDKDYLHGYMYLCXPY[JNDQJWXQXFYYFJLEJPZRXCCQWQQSBNKYMGPLBMJRQCFLNYMYQMSQY RBCJTHZTQFRXQHXMJJCJLXQGJMSHZ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YLQBMQAMMMYXCTPSHCPTXXZZSMPHPSHMCLMLDQFYQXSZYYDYJZZHQPDSZGLSTJB CKBXYQZJSGPSXQZQZRQTBDKYXZKHHGFLBCSMDLDGDZDBLZYYCXNNCSYBZBFGLZZXSWMSCCMQ NJQSBDQSJTXXMBLTXZCLZSHZCXRQJGJYLXZFJPHYMZQQYDFQJJLZZNZJCDGZYGCTXMZYSCTLKPHT XHTLBJXJLXSCDQXCBBTJFQZFSLTJBTKQBXXJJLJCHCZDBZJDCZJDCPRNPQCJPFCZLCLZXZDMXMPHJS GZGSZZQLYLWTJPFSYASMCJBTZKYCWMYTCSJJLJCQLWZMALBXYFBPNLSFHTGJWEJJXXGLLJSTGSHJQ LZFKCGNNNSZFDEQFHBSAQTGYLBXMMYGSZLDYDQMJJRGBJTKGDHGKBLQKBDMBYLXWCXYTTYBK MRTJZXQJBHLMHMJJZMQASLDCYXYQDLQCAFYWYXQHZ "

//Get it !

ls_ReturnStr = ""

For i=1 to Len(as_InputString)

//as_InputString中每个字符

ls_ch=Mid(as_InputString , i , 1)

If Asc(ls_ch) <128 then

ls_returnStr = ls_returnStr+ls_ch

Else

ls_ch = Mid(as_InputString , i , 2)

li_SectorCode = Asc(Left(ls_ch, 1)) - 160

li_PositionCode = Asc(Right(ls_ch, 1)) - 160

li_SecPosCode = li_SectorCode*100 + li_PositionCode // 区位码

If li_SecPosCode> 1600 and li_SecPosCode <5590 then // 第一个字符

For j=23 to 1 Step -1 // 找声母

If li_SecPosCode>=li_SecPosValue[j] then

ls_returnStr = ls_returnStr + lc_FirstLetter[j]

Exit

End if

Next

Else

li_offset = (li_SectorCode - 56 ) *94 + li_PositionCode - 1

If li_offset>=0 and li_offset <=3007

相关文档
最新文档