一个简单T9输入法的实现

  关于T9输入法的核心程序(由我朋友Nix提供),共两个文件,一个是NixInputMethod.h,还有一个是T9.c; 参见附录。
  
  具体输入法的实现方法如下:
  1. 首先创建一个对话框,然后在其中放入两个控件:IDC_EDIT1 和 IDC_WORD (STATIC控件)
  2. 为了实现在Edit中一边输入,STATIC中会出现智能的功能,所以我们的实现如下:
  a) 重载函数PreTranslateMessage ,使其能够捕捉到键盘的所有事件,故其实现如下:
   BOOL CMy11Dlg::PreTranslateMessage(MSG* pMsg)
  {
   try {
   CWnd* pCtrl = GetFocus();
  
   /*
   * 可以通过Enter建进行光标焦点的切换
   */
   if (pMsg->message == WM_KEYDOWN && GetAsyncKeyState(VK_TAB))
   {
   // get the char index of the caret position
   int nPos = LOWORD(m_MyEditCtl.CharFromPos(m_MyEditCtl.GetCaretPos()));
  
   // select zero chars
   m_MyEditCtl.SetSel(nPos, nPos);
  
   // then replace that selection with a TAB
   m_MyEditCtl.ReplaceSel("/t", TRUE);
  
   // no need to do a msg translation, so quit.
   // that way no further processing gets done
   return TRUE;
   } else
  
   if (GetAsyncKeyState(VK_RETURN)) // Enter
   {
   switch(pCtrl->GetDlgCtrlID()) {
   case IDOK:
   if (!reset) {
   AfxMessageBox("OK");
   reset = 1;
   } else {
   reset = 0;
   GetDlgItem(IDC_STATIC)->SetFocus();
   }
  
  break;
   default:
   pMsg->wParam = VK_TAB;
   }
   } else
  
   /*
   * 通过1、2、3....选择第几个字
   */
   if (pMsg->message == WM_KEYDOWN && (isdigit(pMsg->wParam) || (pMsg->wParam >64 && pMsg->wParam < 91))) {
   CString str;
   if (isdigit(pMsg->wParam)) {
   GetDlgItem(IDC_WORD)->GetWindowText(str);
  
   char* temp = str.GetBuffer(100);
   char zi[3];
   zi[0] = temp[2*(pMsg->wParam - 48)-2];
   zi[1] = temp[2*(pMsg->wParam - 48)-1];
   zi[2] = '/0';
   pCtrl->SetWindowText(zi);
   str.ReleaseBuffer();
  
   return TRUE;
   }
   UpdateData();
  
   pCtrl->GetWindowText(str);
   str += (pMsg->wParam + 32);
   CShincoInputMethod pIME;
  
   GetDlgItem(IDC_WORD)->SetWindowText(pIME.GetInputString((unsigned char*)str.GetBuffer(100)));
   str.ReleaseBuffer();
   }
  
   return CDialog::PreTranslateMessage(pMsg);
   } catch (...) {
   // AfxMessageBox("Error");
   }
   return TRUE;
  }
  
  
   这样基本就可以实现一个输入法了,如果你加上词库的话,就可以实现类似智能ABC之类的东西了,当然那样的话,你还需要多努力努力!
   上面程序只是测试用的,你自己可以重新试试看输入法的实现,如果需要代码,请联系我。
  
  附录:
   // NixInputMethod.h: interface for the CShincoInputMethod class.
  //
  //////////////////////////////////////////////////////////////////////
  
  #if !defined(AFX_SHINCOINPUTMETHOD_H__40148888_4731_4A49_87CC_4F9CFCAF77A5__INCLUDED_)
  #define AFX_SHINCOINPUTMETHOD_H__40148888_4731_4A49_87CC_4F9CFCAF77A5__INCLUDED_
  
  #if _MSC_VER > 1000
  #pragma once
  #endif // _MSC_VER > 1000
  
  class CNixInputMethod
  {
  public:
   unsigned long py_mb_begin;
  
   CString GetInputString(BYTE input_py_val[]);
   BYTE *py_ime(BYTE input_py_val[]);
  
   CNixInputMethod();
   virtual ~CNixInputMethod();
  };
  
  #endif // !defined(AFX_SHINCOINPUTMETHOD_H__40148888_4731_4A49_87CC_4F9CFCAF77A5__INCLUDED_)
  
  
  
   /*
   * T9.c
   */
  #include "stdafx.h"
  #include "NixInputMethod.h"
  
  BYTE PY_mb_a[][255]=
  {
   {"阿啊吖锕嗄呵腌"},
   {"哎哀唉埃挨皑癌矮蔼艾爱隘碍"},
   {"安氨鞍俺岸按案胺暗"},
   {"肮昂盎"},
   {"凹敖熬翱袄傲奥澳懊"},
   {"八巴叭扒吧芭疤捌笆拔跋把靶坝爸罢霸"},
   {"白百佰柏摆败拜稗"},
   {"扳班般颁斑搬板版办半伴扮拌绊瓣"},
   {"邦帮梆绑榜膀蚌傍棒谤磅镑"},
   {"包苞胞褒雹宝饱保堡报抱豹鲍暴爆剥薄瀑"},
   {"卑杯悲碑北贝狈备背钡倍被惫焙辈"},
   {"奔本苯笨夯"},
   {"崩绷甭泵迸蹦"},
   {"逼鼻比彼笔鄙币必毕闭庇毖陛毙敝痹蓖弊碧蔽壁避臂"},
   {"边编鞭贬扁卞便变遍辨辩辫"},
   {"彪标膘表"},
   {"憋鳖别瘪"},
   {"宾彬斌滨濒摈"},
   {"冰兵丙秉柄炳饼并病"},
   {"拨波玻钵脖菠播伯驳帛泊勃铂舶博渤搏箔膊卜"},
   {"补哺捕不布步怖部埠簿"},
   {"擦嚓礤"},
   {"猜才材财裁采彩睬踩菜蔡"},
   {"参餐残蚕惭惨灿"},
   {"仓沧苍舱藏"},
   {"操糙曹槽草"},
   {"册侧厕测策"},
   {"层蹭曾"},
   {"叉插查茬茶搽察碴岔诧差刹"},
   {"拆柴豺"},
   {"掺搀谗馋缠蝉产铲阐颤"},
   {"昌猖肠尝偿常厂场敞畅倡唱"},
   {"抄钞超巢朝嘲潮吵炒绰"},
   {"车扯彻掣撤澈"},
   {"郴尘臣忱沉辰陈晨衬趁"},
   {"称撑成呈承诚城乘惩程澄橙逞骋秤"},
   {"吃痴弛池驰迟持尺侈齿耻斥赤炽翅"},
   {"充冲虫崇宠"},
   {"抽仇绸畴愁稠筹酬踌丑瞅臭"},
   {"出初除厨滁锄雏橱躇础储楚处搐触矗畜"},
   {"揣"},
   {"川穿传船椽喘串"},
   {"闯疮窗床创"},
   {"吹炊垂捶锤"},
   {"春椿纯唇淳醇蠢"},
   {"戳"},
   {"疵词茨瓷慈辞磁雌此次刺赐"},
   {"囱从匆葱聪丛"},
   {"凑"},
   {"粗促醋簇"},
   {"蹿窜篡"},
   {"崔催摧脆淬瘁粹翠"},
   {"村存寸"},
   {"搓磋撮挫措错"},
   {"搭达答瘩打大"},
   {"呆歹傣代带待怠殆贷袋逮戴"},
   {"丹单担耽郸胆掸旦但诞弹惮淡蛋氮"},
   {"当挡党荡档"},
   {"刀导岛倒捣祷蹈到悼盗道稻"},
   {"的地得德锝"},
   {"灯登蹬等邓凳瞪"},
   {"低堤滴狄迪敌涤笛嫡底抵地弟帝递第缔蒂"},
   {"掂滇颠典点碘电佃甸店垫惦淀奠殿靛"},
   {"刁叼凋碉雕吊钓掉"},
   {"爹跌迭谍叠碟蝶"},
   {"丁叮盯钉顶鼎订定锭"},
   {"丢"},
   {"东冬董懂动冻侗恫栋洞"},
   {"都兜斗抖陡豆逗痘"},
   {"督毒读犊独堵赌睹妒杜肚度渡镀"},
   {"端短段断缎锻"},
   {"堆队对兑"},
   {"吨敦墩蹲盾钝顿遁"},
   {"多哆夺掇朵垛躲剁堕舵惰跺"},
   {"讹俄娥峨鹅蛾额厄扼恶饿鄂遏"},
   {"恩"},
   {"儿而尔耳洱饵二贰"},
   {"发乏伐罚阀筏法珐"},
   {"帆番翻藩凡矾钒烦樊繁反返犯泛饭范贩"},
   {"方坊芳防妨房肪仿访纺放"},
   {"飞非啡菲肥匪诽吠废沸肺费"},
   {"分吩纷芬氛酚坟汾焚粉份奋忿愤粪"},
   {"丰风枫封疯峰烽锋蜂冯逢缝讽凤奉"},
   {"佛"},
   {"否"},
   {"夫肤孵敷弗伏扶拂服俘氟浮涪符袱幅福辐抚甫府斧俯釜辅腑腐父讣付妇负附咐阜复赴副傅富赋缚腹覆"},
   {"嘎噶"},
   {"该改钙盖溉概"},
   {"干甘杆肝柑竿秆赶敢感赣"},
   {"冈刚岗纲肛缸钢港杠"},
   {"皋羔高膏篙糕搞稿镐告"},
   {"戈疙哥胳鸽割搁歌阁革格葛隔个各铬咯"},
   {"给"},
   {"根跟"},
   {"更庚耕羹埂耿梗"},
   {"工弓公功攻供宫恭躬龚巩汞拱共贡"},
   {"勾沟钩狗苟构购垢够"},
   {"估咕姑孤沽菇辜箍古谷股骨蛊鼓固故顾雇"},
   {"瓜刮剐寡挂褂"},
   {"乖拐怪"},
   {"关观官冠棺馆管贯惯灌罐"},
   {"光广逛"},
   {"归圭龟规闺硅瑰轨诡癸鬼刽柜贵桂跪"},
   {"辊滚棍"},
   {"郭锅国果裹过"},
   {"蛤哈"},
   {"孩骸海亥骇害氦"},
   {"酣憨含邯函涵寒韩罕喊汉汗旱悍捍焊憾撼翰"},
   {"杭航行"},
   {"毫豪嚎壕好郝号浩耗"},
   {"呵喝禾合何和河阂核荷涸盒菏贺褐赫鹤"},
   {"黑嘿"},
   {"痕很狠恨"},
   {"亨哼恒横衡"},
   {"轰哄烘弘红宏洪虹鸿"},
   {"侯喉猴吼后厚候"},
   {"乎呼忽弧狐胡壶湖葫瑚糊蝴虎唬互户护沪"},
   {"花华哗滑猾化划画话"},
   {"怀徊淮槐坏"},
   {"欢还环桓缓幻宦唤换涣患焕痪豢"},
   {"荒慌皇凰黄惶煌蝗磺簧恍晃谎幌"},
   {"灰恢挥辉徽回蛔悔卉汇会讳绘诲烩贿晦秽惠毁慧"},
   {"昏荤婚浑魂混"},
   {"豁活火伙或货获祸惑霍"},
   {"讥击饥圾机肌鸡迹姬积基绩缉畸箕稽激及吉汲级即极急疾棘集嫉辑籍几己挤脊计记伎纪妓忌技际剂季既济继寂寄悸祭蓟冀藉"},
   {"加夹佳枷家嘉荚颊甲贾钾价驾架假嫁稼挟"},
   {"奸尖坚歼间肩艰兼监笺缄煎拣俭柬茧捡减剪检硷简碱见件建饯剑荐贱健涧舰渐溅践鉴键箭"},
   {"江姜将浆僵疆讲奖桨蒋匠降酱"},
   {"交郊娇浇骄胶椒焦蕉礁角狡绞饺矫脚铰搅剿缴叫轿较教窖酵觉嚼"},
   {"阶皆接秸揭街节劫杰洁结捷睫截竭姐解介戒芥届界疥诫借"},
   {"巾今斤金津筋襟仅紧谨锦尽劲近进晋浸烬禁靳"},
   {"京经茎荆惊晶睛粳兢精鲸井颈景警净径痉竞竟敬靖境静镜"},
   {"炯窘"},
   {"纠究揪九久灸玖韭酒旧臼咎疚厩救就舅"},
   {"居拘狙驹疽鞠局桔菊咀沮举矩句巨拒具炬俱剧惧据距锯聚踞"},
   {"娟捐鹃卷倦绢眷"},
   {"撅决诀抉绝倔掘爵攫"},
   {"军君均钧菌俊郡峻浚骏竣"},
   {"咖喀卡"},
   {"开揩凯慨楷"},
   {"槛刊勘堪坎砍看"},
   {"康慷糠扛亢抗炕"},
   {"考拷烤靠"},
   {"坷苛柯科棵颗磕壳咳可渴克刻客课"},
   {"肯垦恳啃"},
   {"吭坑"},
   {"空孔恐控"},
   {"抠口扣寇"},
   {"枯哭窟苦库裤酷"},
   {"夸垮挎胯跨"},
   {"块快侩筷"},
   {"宽款"},
   {"匡筐狂况旷矿框眶"},
   {"亏岿盔窥奎葵魁傀愧溃馈"},
   {"坤昆捆困"},
   {"扩括阔廓"},
   {"垃拉啦喇腊蜡辣"},
   {"来莱赖"},
   {"兰拦栏婪阑蓝谰澜篮览揽缆懒烂滥"},
   {"郎狼廊琅榔朗浪"},
   {"捞劳牢老佬姥涝烙酪"},
   {"乐勒了"},
   {"雷镭垒磊蕾儡肋泪类累擂"},
   {"棱楞冷"},
   {"厘梨狸离莉犁漓璃黎篱礼李里哩理鲤力历厉立吏丽利励沥例隶俐荔栗砾粒傈痢"},
   {"连帘怜涟莲联廉镰敛脸练炼恋链"},
   {"俩良凉梁粮粱两亮谅辆晾量"},
   {"潦辽疗聊僚寥廖撩燎镣料撂"},
   {"列劣烈猎裂"},
   {"邻林临淋琳霖磷鳞凛吝赁拎"},
   {"伶灵岭玲凌铃陵羚菱零龄领令另"},
   {"溜刘流留琉硫馏榴瘤柳六"},
   {"龙咙笼聋隆窿陇垄拢"},
   {"娄楼搂篓陋漏"},
   {"露卢庐芦炉颅卤虏掳鲁陆录赂鹿禄碌路戮潞麓"},
   {"孪峦挛滦卵乱"},
   {"掠略锊"},
   {"抡仑伦沦纶轮论囵"},
   {"罗萝逻锣箩骡螺裸洛络骆落"},
   {"滤驴吕侣旅铝屡缕履律虑率绿氯"},
   {"妈麻马玛码蚂骂吗嘛"},
   {"埋买迈麦卖脉"},
   {"蛮馒瞒满曼谩慢漫蔓"},
   {"忙芒盲茫莽氓"},
   {"猫毛矛茅锚卯铆茂冒贸帽貌"},
   {"么"},
   {"没枚玫眉梅媒煤酶霉每美镁妹昧媚寐"},
   {"门闷们"},
   {"萌盟檬猛蒙锰孟梦"},
   {"弥迷谜醚糜靡米眯泌觅秘密幂蜜"},
   {"眠绵棉免勉娩冕缅面"},
   {"苗描瞄秒渺藐妙庙"},
   {"灭蔑"},
   {"民皿抿闽悯敏"},
   {"名明鸣铭螟命"},
   {"谬"},
   {"貉摸摹模膜摩磨蘑魔抹末沫陌莫寞漠墨默"},
   {"牟谋某"},
   {"母亩牡姆拇木目牧募墓幕睦慕暮穆"},
   {"拿哪那纳娜钠呐"},
   {"乃奶氖奈耐"},
   {"男南难"},
   {"囊"},
   {"挠恼脑闹淖"},
   {"呢"},
   {"内馁"},
   {"嫩"},
   {"能"},
   {"妮尼泥倪霓你拟逆匿溺腻"},
   {"拈年捻撵碾念蔫"},
   {"娘酿"},
   {"鸟尿"},
   {"捏涅聂啮镊镍孽"},
   {"您"},
   {"宁拧狞柠凝泞"},
   {"牛扭纽钮"},
   {"农浓脓弄"},
   {"奴努怒"},
   {"暖"},
   {"疟虐"},
   {"挪诺懦糯"},
   {"女"},
   {"哦"},
   {"欧殴鸥呕偶藕沤"},
   {"趴啪爬耙琶帕怕"},
   {"拍徘排牌派湃"},
   {"潘攀盘磐判叛盼畔"},
   {"乓庞旁耪胖"},
   {"抛刨咆炮袍跑泡"},
   {"呸胚陪培赔裴沛佩配"},
   {"喷盆"},
   {"抨砰烹朋彭棚硼蓬鹏澎篷膨捧碰"},
   {"辟批坯披砒劈霹皮毗疲啤琵脾匹痞屁僻譬"},
   {"片偏篇骗"},
   {"漂飘瓢票"},
   {"撇瞥"},
   {"拼贫频品聘"},
   {"乒平评凭坪苹屏瓶萍"},
   {"坡泼颇婆迫破粕魄"},
   {"剖"},
   {"脯仆扑铺莆菩葡蒲朴圃埔浦普谱曝"},
   {"七沏妻柒凄栖戚期欺漆祁齐其奇歧祈脐崎畦骑棋旗乞企岂启起气讫迄弃汽泣契砌器"},
   {"掐恰洽"},
   {"千仟扦迁钎牵铅谦签前钱钳乾潜黔浅遣谴欠堑嵌歉"},
   {"呛羌枪腔强墙蔷抢"},
   {"悄敲锹橇乔侨桥瞧巧俏峭窍翘撬鞘"},
   {"切茄且怯窃"},
   {"亲侵钦芹秦琴禽勤擒寝沁"},
   {"青氢轻倾卿清情晴氰擎顷请庆"},
   {"穷琼"},
   {"丘邱秋囚求泅酋球"},
   {"区曲驱屈蛆躯趋渠取娶龋去趣"},
   {"圈全权泉拳痊醛颧犬劝券"},
   {"炔缺瘸却雀确鹊榷"},
   {"裙群"},
   {"然燃冉染"},
   {"瓤嚷壤攘让"},
   {"饶扰绕"},
   {"惹热喏"},
   {"人仁壬忍刃认任纫妊韧"},
   {"扔仍"},
   {"日驲"},
   {"戎绒茸荣容溶蓉熔融冗"},
   {"柔揉肉"},
   {"如茹儒孺蠕汝乳辱入褥"},
   {"阮软"},
   {"蕊锐瑞"},
   {"闰润"},
   {"若弱"},
   {"撒洒萨"},
   {"塞腮鳃赛"},
   {"三叁伞散"},
   {"桑嗓丧"},
   {"搔骚扫嫂"},
   {"色涩瑟"},
   {"森"},
   {"僧"},
   {"杀沙纱砂莎傻啥煞厦"},
   {"筛晒酾"},
   {"山删杉衫珊煽闪陕汕苫扇善缮擅膳赡栅"},
   {"伤商墒裳晌赏上尚"},
   {"捎梢烧稍勺芍韶少邵绍哨"},
   {"奢赊舌蛇舍设社射涉赦慑摄"},
   {"申伸身呻绅娠砷深神沈审婶肾甚渗慎什"},
   {"升生声牲胜甥绳省圣盛剩"},
   {"匙尸失师虱诗施狮湿十石时识实拾蚀食史矢使始驶屎士氏世仕市示式事侍势视试饰室恃拭是柿适逝释嗜誓噬似"},
   {"收手守首寿受兽售授瘦"},
   {"书抒叔枢殊梳淑疏舒输蔬孰赎熟暑黍署鼠蜀薯曙术戍束述树竖恕庶数墅漱属"},
   {"刷耍唰"},
   {"衰摔甩帅"},
   {"拴栓"},
   {"双霜爽"},
   {"谁水税睡说"},
   {"吮顺舜瞬"},
   {"说烁朔硕"},
   {"丝司私思斯嘶撕死巳四寺伺饲嗣肆"},
   {"松怂耸讼宋诵送颂"},
   {"嗽搜艘擞"},
   {"苏酥俗诉肃素速粟塑溯僳"},
   {"酸蒜算狻"},
   {"虽绥隋随髓岁祟遂碎隧穗"},
   {"孙损笋"},
   {"唆梭蓑缩所索琐锁"},
   {"她他它塌塔獭挞踏蹋"},
   {"胎台抬苔太汰态泰酞"},
   {"坍贪摊滩瘫坛谈痰谭潭檀坦袒毯叹炭探碳"},
   {"汤唐堂棠塘搪膛糖倘淌躺烫趟"},
   {"涛绦掏滔逃桃陶淘萄讨套"},
   {"特忑忒铽慝"},
   {"疼腾誊藤"},
   {"剔梯锑踢啼提题蹄体屉剃涕惕替嚏"},
   {"天添田恬甜填腆舔"},
   {"调挑条迢眺跳"},
   {"贴铁帖萜餮"},
   {"厅汀听烃廷亭庭停挺艇"},
   {"通同彤桐铜童酮瞳统捅桶筒痛"},
   {"偷头投透"},
   {"凸秃突图徒涂途屠土吐兔"},
   {"湍团疃抟彖"},
   {"推颓腿退蜕褪"},
   {"囤吞屯臀"},
   {"托拖脱驮陀驼鸵妥椭拓唾"},
   {"哇娃挖洼蛙瓦袜"},
   {"歪外崴"},
   {"弯湾豌丸完玩顽烷宛挽晚婉惋皖碗万腕"},
   {"汪亡王网往枉妄忘旺望"},
   {"危威微巍为韦围违桅唯惟维潍伟伪尾纬苇委萎卫未位味畏胃尉谓喂渭蔚慰魏"},
   {"温瘟文纹闻蚊吻紊稳问"},
   {"翁嗡瓮"},
   {"挝涡窝蜗我沃卧握斡"},
   {"乌污呜巫屋诬钨无毋吴吾芜梧五午伍坞武侮捂舞勿务戊物误悟晤雾"},
   {"夕汐西吸希昔析矽息牺悉惜烯硒晰犀稀溪锡熄熙嘻膝习席袭媳檄洗喜戏系细隙"},
   {"虾瞎匣侠峡狭暇辖霞下吓夏"},
   {"铣仙先纤掀锨鲜闲弦贤咸涎舷衔嫌显险县现线限宪陷馅羡献腺"},
   {"乡相香厢湘箱襄镶详祥翔享响想向巷项象像橡"},
   {"宵消萧硝销霄嚣淆小晓孝肖哮效校笑啸"},
   {"些楔歇蝎协邪胁斜谐携鞋写泄泻卸屑械谢懈蟹"},
   {"心忻芯辛欣锌新薪信衅"},
   {"兴星惺猩腥刑邢形型醒杏姓幸性"},
   {"凶兄匈汹胸雄熊"},
   {"宿休修羞朽秀绣袖锈嗅"},
   {"戌须虚嘘需墟徐许旭序叙恤绪续酗婿絮蓄吁"},
   {"轩宣喧玄悬旋选癣绚眩"},
   {"削靴薛穴学雪血"},
   {"勋熏寻巡旬驯询循训讯汛迅逊殉"},
   {"丫压呀押鸦鸭牙芽蚜崖涯衙哑雅亚讶"},
   {"咽烟淹焉阉延严言岩沿炎研盐阎蜒颜奄衍掩眼演厌彦砚唁宴艳验谚堰焰雁燕"},
   {"央殃秧鸯扬羊阳杨佯疡洋仰养氧痒样漾"},
   {"侥妖腰邀尧姚窑谣摇遥瑶咬舀药要耀钥"},
   {"椰噎爷耶也冶野业叶曳页夜掖液腋"},
   {"一伊衣医依铱壹揖仪夷沂宜姨胰移遗颐疑彝乙已以矣蚁倚椅义亿忆艺议亦屹异役抑译邑易绎诣疫益谊翌逸意溢肄裔毅翼臆"},
   {"因阴姻茵荫音殷吟寅淫银尹引饮隐印"},
   {"应英婴缨樱鹰迎盈荧莹萤营蝇赢颖影映硬"},
   {"哟"},
   {"佣拥痈庸雍臃永咏泳勇涌恿蛹踊用"},
   {"优忧幽悠尤由犹邮油铀游友有酉又右幼佑诱釉"},
   {"迂淤渝于予余盂鱼俞娱渔隅愉逾愚榆虞舆与宇屿羽雨禹语玉驭芋育郁狱峪浴预域欲喻寓御裕遇愈誉豫"},
   {"冤鸳渊元员园垣原圆袁援缘源猿辕远苑怨院愿"},
   {"曰约月岳悦阅跃粤越"},
   {"云匀郧耘允陨孕运晕酝韵蕴"},
   {"匝杂砸咋"},
   {"灾哉栽宰载再在仔"},
   {"咱攒暂赞"},
   {"赃脏葬"},
   {"遭糟凿早枣蚤澡藻灶皂造噪燥躁"},
   {"则择泽责"},
   {"贼"},
   {"怎"},
   {"增憎赠"},
   {"喳渣扎札轧闸铡眨乍诈炸榨柞"},
   {"斋摘宅翟窄债寨"},
   {"沾毡粘詹瞻斩展盏崭辗占战栈站绽湛蘸"},
   {"长张章彰漳樟涨掌丈仗帐杖胀账障瘴"},
   {"招昭找沼召兆赵照罩肇爪"},
   {"遮折哲蛰辙者锗这浙蔗着"},
   {"贞针侦珍真砧斟甄臻诊枕疹阵振镇震帧"},
   {"争征怔挣狰睁蒸拯整正证郑政症"},
   {"之支汁芝吱枝知织肢脂蜘执侄直值职植殖止只旨址纸指趾至志制帜治炙质峙挚秩致掷痔窒智滞稚置"},
   {"中忠终盅钟衷肿种仲众重"},
   {"州舟诌周洲粥轴肘帚咒宙昼皱骤"},
   {"朱诛株珠诸猪蛛竹烛逐主拄煮嘱瞩住助注贮驻柱祝著蛀筑铸"},
   {"抓"},
   {"拽"},
   {"专砖转撰篆"},
   {"妆庄桩装壮状幢撞"},
   {"追椎锥坠缀赘"},
   {"谆准"},
   {"卓拙捉桌灼茁浊酌啄琢"},
   {"孜兹咨姿资淄滋籽子紫滓字自渍"},
   {"宗综棕踪鬃总纵"},
   {"邹走奏揍"},
   {"租足卒族诅阻组祖"},
   {"赚纂钻"},
   {"嘴最罪醉"},
   {"尊遵"},
   {"昨左佐作坐座做"},
  };
  
  //索引:
  BYTE PY_index_a[][9]={
   {0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00},
   {'i',0x20,0x20,0x20,0x20,0x20,0xFF,0x00,0x00},
   {'n',0x20,0x20,0x20,0x20,0x20,0xFE,0x01,0x00},
   {'n','g',0x20,0x20,0x20,0x20,0xFD,0x02,0x00},
   {'o',0x20,0x20,0x20,0x20,0x20,0xFC,0x03,0x00}
  };
  BYTE PY_index_b[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0xFB,0x04,0x00},
   {'a','i',0x20,0x20,0x20,0x20,0xFA,0x05,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0xF9,0x06,0x00},
   {'a','n','g',0x20,0x20,0x20,0xF8,0x07,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0xF7,0x08,0x00},
   {'e','i',0x20,0x20,0x20,0x20,0xF6,0x09,0x00},
   {'e','n',0x20,0x20,0x20,0x20,0xF5,0x0A,0x00},
   {'e','n','g',0x20,0x20,0x20,0xF4,0x0B,0x00},
   {'i',0x20,0x20,0x20,0x20,0x20,0xF3,0x0C,0x00},
   {'i','a','n',0x20,0x20,0x20,0xF2,0x0D,0x00},
   {'i','a','o',0x20,0x20,0x20,0xF1,0x0E,0x00},
   {'i','e',0x20,0x20,0x20,0x20,0xF0,0x0F,0x00},
   {'i','n',0x20,0x20,0x20,0x20,0xEF,0x10,0x00},
   {'i','n','g',0x20,0x20,0x20,0xEE,0x11,0x00},
   {'o',0x20,0x20,0x20,0x20,0x20,0xED,0x12,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0xEC,0x13,0x00}
  };
  BYTE PY_index_c[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0xEB,0x14,0x00},
   {'a','i',0x20,0x20,0x20,0x20,0xEA,0x15,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0xE9,0x16,0x00},
   {'a','n','g',0x20,0x20,0x20,0xE8,0x17,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0xE7,0x18,0x00},
   {'e',0x20,0x20,0x20,0x20,0x20,0xE6,0x19,0x00},
   {'e','n','g',0x20,0x20,0x20,0xE5,0x1A,0x00},
   {'h','a',0x20,0x20,0x20,0x20,0xE4,0x1B,0x00},
   {'h','a','i',0x20,0x20,0x20,0xE3,0x1C,0x00},
   {'h','a','n',0x20,0x20,0x20,0xE2,0x1D,0x00},
   {'h','a','n','g',0x20,0x20,0xE1,0x1E,0x00},
   {'h','a','o',0x20,0x20,0x20,0xE0,0x1F,0x00},
   {'h','e',0x20,0x20,0x20,0x20,0xDF,0x20,0x00},
   {'h','e','n',0x20,0x20,0x20,0xDE,0x21,0x00},
   {'h','e','n','g',0x20,0x20,0xDD,0x22,0x00},
   {'h','i',0x20,0x20,0x20,0x20,0xDC,0x23,0x00},
   {'h','o','n','g',0x20,0x20,0xDB,0x24,0x00},
   {'h','o','u',0x20,0x20,0x20,0xDA,0x25,0x00},
   {'h','u',0x20,0x20,0x20,0x20,0xD9,0x26,0x00},
   {'h','u','a','i',0x20,0x20,0xD8,0x27,0x00},
   {'h','u','a','n',0x20,0x20,0xD7,0x28,0x00},
   {'h','u','a','n','g',0x20,0xD6,0x29,0x00},
   {'h','u','i',0x20,0x20,0x20,0xD5,0x2A,0x00},
   {'h','u','n',0x20,0x20,0x20,0xD4,0x2B,0x00},
   {'h','u','o',0x20,0x20,0x20,0xD3,0x2C,0x00},
   {'i',0x20,0x20,0x20,0x20,0x20,0xD2,0x2D,0x00},
   {'o','n','g',0x20,0x20,0x20,0xD1,0x2E,0x00},
   {'o','u',0x20,0x20,0x20,0x20,0xD0,0x2F,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0xCF,0x30,0x00},
   {'u','a','n',0x20,0x20,0x20,0xCE,0x31,0x00},
   {'u','i',0x20,0x20,0x20,0x20,0xCD,0x32,0x00},
   {'u','n',0x20,0x20,0x20,0x20,0xCC,0x33,0x00},
   {'u','o',0x20,0x20,0x20,0x20,0xCB,0x34,0x00}
  };
  BYTE PY_index_d[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0xCA,0x35,0x00},
   {'a','i',0x20,0x20,0x20,0x20,0xC9,0x36,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0xC8,0x37,0x00},
   {'a','n','g',0x20,0x20,0x20,0xC7,0x38,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0xC6,0x39,0x00},
   {'e',0x20,0x20,0x20,0x20,0x20,0xC5,0x3A,0x00},
   {'e','n','g',0x20,0x20,0x20,0xC4,0x3B,0x00},
   {'i',0x20,0x20,0x20,0x20,0x20,0xC3,0x3C,0x00},
   {'i','a','n',0x20,0x20,0x20,0xC2,0x3D,0x00},
   {'i','a','o',0x20,0x20,0x20,0xC1,0x3E,0x00},
   {'i','e',0x20,0x20,0x20,0x20,0xC0,0x3F,0x00},
   {'i','n','g',0x20,0x20,0x20,0xBF,0x40,0x00},
   {'i','u',0x20,0x20,0x20,0x20,0xBE,0x41,0x00},
   {'o','n','g',0x20,0x20,0x20,0xBD,0x42,0x00},
   {'o','u',0x20,0x20,0x20,0x20,0xBC,0x43,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0xBB,0x44,0x00},
   {'u','a','n',0x20,0x20,0x20,0xBA,0x45,0x00},
   {'u','i',0x20,0x20,0x20,0x20,0xB9,0x46,0x00},
   {'u','n',0x20,0x20,0x20,0x20,0xB8,0x47,0x00},
   {'u','o',0x20,0x20,0x20,0x20,0xB7,0x48,0x00}
  };
  BYTE PY_index_e[][9]={
   {0x20,0x20,0x20,0x20,0x20,0x20,0xB6,0x49,0x00},
   {'n',0x20,0x20,0x20,0x20,0x20,0xB5,0x4A,0x00},
   {'r',0x20,0x20,0x20,0x20,0x20,0xB4,0x4B,0x00}
  };
  BYTE PY_index_f[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0xB3,0x4C,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0xB2,0x4D,0x00},
   {'a','n','g',0x20,0x20,0x20,0xB1,0x4E,0x00},
   {'e','i',0x20,0x20,0x20,0x20,0xB0,0x4F,0x00},
   {'e','n',0x20,0x20,0x20,0x20,0xAF,0x50,0x00},
   {'e','n','g',0x20,0x20,0x20,0xAE,0x51,0x00},
   {'o',0x20,0x20,0x20,0x20,0x20,0xAD,0x52,0x00},
   {'o','u',0x20,0x20,0x20,0x20,0xAC,0x53,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0xAB,0x54,0x00}
  };
  BYTE PY_index_g[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0xAA,0x55,0x00},
   {'a','i',0x20,0x20,0x20,0x20,0xA9,0x56,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0xA8,0x57,0x00},
   {'a','n','g',0x20,0x20,0x20,0xA7,0x58,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0xA6,0x59,0x00},
   {'e',0x20,0x20,0x20,0x20,0x20,0xA5,0x5A,0x00},
   {'e','i',0x20,0x20,0x20,0x20,0xA4,0x5B,0x00},
   {'e','n',0x20,0x20,0x20,0x20,0xA3,0x5C,0x00},
   {'e','n','g',0x20,0x20,0x20,0xA2,0x5D,0x00},
   {'o','n','g',0x20,0x20,0x20,0xA1,0x5E,0x00},
   {'o','u',0x20,0x20,0x20,0x20,0xA0,0x5F,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0x9F,0x60,0x00},
   {'u','a',0x20,0x20,0x20,0x20,0x9E,0x61,0x00},
   {'u','a','i',0x20,0x20,0x20,0x9D,0x62,0x00},
   {'u','a','n',0x20,0x20,0x20,0x9C,0x63,0x00},
   {'u','a','n','g',0x20,0x20,0x9B,0x64,0x00},
   {'u','i',0x20,0x20,0x20,0x20,0x9A,0x65,0x00},
   {'u','n',0x20,0x20,0x20,0x20,0x99,0x66,0x00},
   {'u','o',0x20,0x20,0x20,0x20,0x98,0x67,0x00}
  };
  BYTE PY_index_h[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0x97,0x68,0x00},
   {'a','i',0x20,0x20,0x20,0x20,0x96,0x69,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0x95,0x6A,0x00},
   {'a','n','g',0x20,0x20,0x20,0x94,0x6B,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0x93,0x6C,0x00},
   {'e',0x20,0x20,0x20,0x20,0x20,0x92,0x6D,0x00},
   {'e','i',0x20,0x20,0x20,0x20,0x91,0x6E,0x00},
   {'e','n',0x20,0x20,0x20,0x20,0x90,0x6F,0x00},
   {'e','n','g',0x20,0x20,0x20,0x8F,0x70,0x00},
   {'o','n','g',0x20,0x20,0x20,0x8E,0x71,0x00},
   {'o','u',0x20,0x20,0x20,0x20,0x8D,0x72,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0x8C,0x73,0x00},
   {'u','a',0x20,0x20,0x20,0x20,0x8B,0x74,0x00},
   {'u','a','i',0x20,0x20,0x20,0x8A,0x75,0x00},
   {'u','a','n',0x20,0x20,0x20,0x89,0x76,0x00},
   {'u','a','n','g',0x20,0x20,0x88,0x77,0x00},
   {'u','i',0x20,0x20,0x20,0x20,0x87,0x78,0x00},
   {'u','n',0x20,0x20,0x20,0x20,0x86,0x79,0x00},
   {'u','o',0x20,0x20,0x20,0x20,0x85,0x7A,0x00}
  };
  BYTE PY_index_j[][9]={
   {'i',0x20,0x20,0x20,0x20,0x20,0x84,0x7B,0x00},
   {'i','a',0x20,0x20,0x20,0x20,0x83,0x7C,0x00},
   {'i','a','n',0x20,0x20,0x20,0x82,0x7D,0x00},
   {'i','a','n','g',0x20,0x20,0x81,0x7E,0x00},
   {'i','a','o',0x20,0x20,0x20,0x80,0x7F,0x00},
   {'i','e',0x20,0x20,0x20,0x20,0x7F,0x80,0x00},
   {'i','n',0x20,0x20,0x20,0x20,0x7E,0x81,0x00},
   {'i','n','g',0x20,0x20,0x20,0x7D,0x82,0x00},
   {'i','o','n','g',0x20,0x20,0x7C,0x83,0x00},
   {'i','u',0x20,0x20,0x20,0x20,0x7B,0x84,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0x7A,0x85,0x00},
   {'u','a','n',0x20,0x20,0x20,0x79,0x86,0x00},
   {'u','e',0x20,0x20,0x20,0x20,0x78,0x87,0x00},
   {'u','n',0x20,0x20,0x20,0x20,0x77,0x88,0x00}
  };
  BYTE PY_index_k[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0x76,0x89,0x00},
   {'a','i',0x20,0x20,0x20,0x20,0x75,0x8A,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0x74,0x8B,0x00},
   {'a','n','g',0x20,0x20,0x20,0x73,0x8C,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0x72,0x8D,0x00},
   {'e',0x20,0x20,0x20,0x20,0x20,0x71,0x8E,0x00},
   {'e','n',0x20,0x20,0x20,0x20,0x70,0x8F,0x00},
   {'e','n','g',0x20,0x20,0x20,0x6F,0x90,0x00},
   {'o','n','g',0x20,0x20,0x20,0x6E,0x91,0x00},
   {'o','u',0x20,0x20,0x20,0x20,0x6D,0x92,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0x6C,0x93,0x00},
   {'u','a',0x20,0x20,0x20,0x20,0x6B,0x94,0x00},
   {'u','a','i',0x20,0x20,0x20,0x6A,0x95,0x00},
   {'u','a','n',0x20,0x20,0x20,0x69,0x96,0x00},
   {'u','a','n','g',0x20,0x20,0x68,0x97,0x00},
   {'u','i',0x20,0x20,0x20,0x20,0x67,0x98,0x00},
   {'u','n',0x20,0x20,0x20,0x20,0x66,0x99,0x00},
   {'u','o',0x20,0x20,0x20,0x20,0x65,0x9A,0x00}
  };
  
  BYTE PY_index_l[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0x64,0x9B,0x00},
   {'a','i',0x20,0x20,0x20,0x20,0x63,0x9C,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0x62,0x9D,0x00},
   {'a','n','g',0x20,0x20,0x20,0x61,0x9E,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0x60,0x9F,0x00},
   {'e',0x20,0x20,0x20,0x20,0x20,0x5F,0xA0,0x00},
   {'e','i',0x20,0x20,0x20,0x20,0x5E,0xA1,0x00},
   {'e','n','g',0x20,0x20,0x20,0x5D,0xA2,0x00},
   {'i',0x20,0x20,0x20,0x20,0x20,0x5C,0xA3,0x00},
   {'i','a','n',0x20,0x20,0x20,0x5B,0xA4,0x00},
   {'i','a','n','g',0x20,0x20,0x5A,0xA5,0x00},
   {'i','a','o',0x20,0x20,0x20,0x59,0xA6,0x00},
   {'i','e',0x20,0x20,0x20,0x20,0x58,0xA7,0x00},
   {'i','n',0x20,0x20,0x20,0x20,0x57,0xA8,0x00},
   {'i','n','g',0x20,0x20,0x20,0x56,0xA9,0x00},
   {'i','u',0x20,0x20,0x20,0x20,0x55,0xAA,0x00},
   {'o','n','g',0x20,0x20,0x20,0x54,0xAB,0x00},
   {'o','u',0x20,0x20,0x20,0x20,0x53,0xAC,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0x52,0xAD,0x00},
   {'u','a','n',0x20,0x20,0x20,0x51,0xAE,0x00},
   {'u','e',0x20,0x20,0x20,0x20,0x50,0xAF,0x00},
   {'u','n',0x20,0x20,0x20,0x20,0x4F,0xB0,0x00},
   {'u','o',0x20,0x20,0x20,0x20,0x4E,0xB1,0x00},
   {'v',0x20,0x20,0x20,0x20,0x20,0x4D,0xB2,0x00}
  };
  BYTE PY_index_m[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0x4C,0xB3,0x00},
   {'a','i',0x20,0x20,0x20,0x20,0x4B,0xB4,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0x4A,0xB5,0x00},
   {'a','n','g',0x20,0x20,0x20,0x49,0xB6,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0x48,0xB7,0x00},
   {'e',0x20,0x20,0x20,0x20,0x20,0x47,0xB8,0x00},
   {'e','i',0x20,0x20,0x20,0x20,0x46,0xB9,0x00},
   {'e','n',0x20,0x20,0x20,0x20,0x45,0xBA,0x00},
   {'e','n','g',0x20,0x20,0x20,0x44,0xBB,0x00},
   {'i',0x20,0x20,0x20,0x20,0x20,0x43,0xBC,0x00},
   {'i','a','n',0x20,0x20,0x20,0x42,0xBD,0x00},
   {'i','a','o',0x20,0x20,0x20,0x41,0xBE,0x00},
   {'i','e',0x20,0x20,0x20,0x20,0x40,0xBF,0x00},
   {'i','n',0x20,0x20,0x20,0x20,0x3F,0xC0,0x00},
   {'i','n','g',0x20,0x20,0x20,0x3E,0xC1,0x00},
   {'i','u',0x20,0x20,0x20,0x20,0x3D,0xC2,0x00},
   {'o',0x20,0x20,0x20,0x20,0x20,0x3C,0xC3,0x00},
   {'o','u',0x20,0x20,0x20,0x20,0x3B,0xC4,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0x3A,0xC5,0x00}
  };
  BYTE PY_index_n[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0x39,0xC6,0x00},
   {'a','i',0x20,0x20,0x20,0x20,0x38,0xC7,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0x37,0xC8,0x00},
   {'a','n','g',0x20,0x20,0x20,0x36,0xC9,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0x35,0xCA,0x00},
   {'e',0x20,0x20,0x20,0x20,0x20,0x34,0xCB,0x00},
   {'e','i',0x20,0x20,0x20,0x20,0x33,0xCC,0x00},
   {'e','n',0x20,0x20,0x20,0x20,0x32,0xCD,0x00},
   {'e','n','g',0x20,0x20,0x20,0x31,0xCE,0x00},
   {'i',0x20,0x20,0x20,0x20,0x20,0x30,0xCF,0x00},
   {'i','a','n',0x20,0x20,0x20,0x2F,0xD0,0x00},
   {'i','a','n','g',0x20,0x20,0x2E,0xD1,0x00},
   {'i','a','o',0x20,0x20,0x20,0x2D,0xD2,0x00},
   {'i','e',0x20,0x20,0x20,0x20,0x2C,0xD3,0x00},
   {'i','n',0x20,0x20,0x20,0x20,0x2B,0xD4,0x00},
   {'i','n','g',0x20,0x20,0x20,0x2A,0xD5,0x00},
   {'i','u',0x20,0x20,0x20,0x20,0x29,0xD6,0x00},
   {'o','n','g',0x20,0x20,0x20,0x28,0xD7,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0x27,0xD8,0x00},
   {'u','a','n',0x20,0x20,0x20,0x26,0xD9,0x00},
   {'u','e',0x20,0x20,0x20,0x20,0x25,0xDA,0x00},
   {'u','o',0x20,0x20,0x20,0x20,0x24,0xDB,0x00},
   {'v',0x20,0x20,0x20,0x20,0x20,0x23,0xDC,0x00}
  };
  BYTE PY_index_o[][9]={
   {0x20,0x20,0x20,0x20,0x20,0x20,0x22,0xDD,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0x21,0xDE,0x00}
  };
  BYTE PY_index_p[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0x20,0xDF,0x00},
   {'a','i',0x20,0x20,0x20,0x20,0x1F,0xE0,0x00},
   {'a','n',0x20,0x20,0x20,0x20,0x1E,0xE1,0x00},
   {'a','n','g',0x20,0x20,0x20,0x1D,0xE2,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0x1C,0xE3,0x00},
   {'e','i',0x20,0x20,0x20,0x20,0x1B,0xE4,0x00},
   {'e','n',0x20,0x20,0x20,0x20,0x1A,0xE5,0x00},
   {'e','n','g',0x20,0x20,0x20,0x19,0xE6,0x00},
   {'i',0x20,0x20,0x20,0x20,0x20,0x18,0xE7,0x00},
   {'i','a','n',0x20,0x20,0x20,0x17,0xE8,0x00},
   {'i','a','o',0x20,0x20,0x20,0x16,0xE9,0x00},
   {'i','e',0x20,0x20,0x20,0x20,0x15,0xEA,0x00},
   {'i','n',0x20,0x20,0x20,0x20,0x14,0xEB,0x00},
   {'i','n','g',0x20,0x20,0x20,0x13,0xEC,0x00},
   {'o',0x20,0x20,0x20,0x20,0x20,0x12,0xED,0x00},
   {'o','u',0x20,0x20,0x20,0x20,0x11,0xEE,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0x10,0xEF,0x00}
  };
  BYTE PY_index_q[][9]={
   {'i',0x20,0x20,0x20,0x20,0x20,0x0F,0xF0,0x00},
   {'i','a',0x20,0x20,0x20,0x20,0x0E,0xF1,0x00},
   {'i','a','n',0x20,0x20,0x20,0x0D,0xF2,0x00},
   {'i','a','n','g',0x20,0x20,0x0C,0xF3,0x00},
   {'i','a','o',0x20,0x20,0x20,0x0B,0xF4,0x00},
   {'i','e',0x20,0x20,0x20,0x20,0x0A,0xF5,0x00},
   {'i','n',0x20,0x20,0x20,0x20,0x09,0xF6,0x00},
   {'i','n','g',0x20,0x20,0x20,0x08,0xF7,0x00},
   {'i','o','n','g',0x20,0x20,0x07,0xF8,0x00},
   {'i','u',0x20,0x20,0x20,0x20,0x06,0xF9,0x00},
   {'u',0x20,0x20,0x20,0x20,0x20,0x05,0xFA,0x00},
   {'u','a','n',0x20,0x20,0x20,0x04,0xFB,0x00},
   {'u','e',0x20,0x20,0x20,0x20,0x03,0xFC,0x00},
   {'u','n',0x20,0x20,0x20,0x20,0x02,0xFD,0x00}
  };
  BYTE PY_index_r[][9]={
   {'a','n',0x20,0x20,0x20,0x20,0x01,0xFE,0x00},
   {'a','n','g',0x20,0x20,0x20,0x00,0xFF,0x00},
   {'a','o',0x20,0x20,0x20,0x20,0xFF,0xFF,0x00},
   {'e',0x20,0x20,0x20,0x20,0x20,0xFF,0x00,0x01},
   {'e','n',0x20,0x20,0x20,0x20,0xFE,0x01,0x01},
   {'e','n','g',0x20,0x20,0x20,0xFD,0x02,0x01},
   {'i',0x20,0x20,0x20,0x20,0x20,0xFC,0x03,0x01},
   {'o','n','g',0x20,0x20,0x20,0xFB,0x04,0x01},
   {'o','u',0x20,0x20,0x20,0x20,0xFA,0x05,0x01},
   {'u',0x20,0x20,0x20,0x20,0x20,0xF9,0x06,0x01},
   {'u','a','n',0x20,0x20,0x20,0xF8,0x07,0x01},
   {'u','i',0x20,0x20,0x20,0x20,0xF7,0x08,0x01},
   {'u','n',0x20,0x20,0x20,0x20,0xF6,0x09,0x01},
   {'u','o',0x20,0x20,0x20,0x20,0xF5,0x0A,0x01}
  };
  BYTE PY_index_s[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0xF4,0x0B,0x01},
   {'a','i',0x20,0x20,0x20,0x20,0xF3,0x0C,0x01},
   {'a','n',0x20,0x20,0x20,0x20,0xF2,0x0D,0x01},
   {'a','n','g',0x20,0x20,0x20,0xF1,0x0E,0x01},
   {'a','o',0x20,0x20,0x20,0x20,0xF0,0xF,0x01},
   {'e',0x20,0x20,0x20,0x20,0x20,0xEF,0x10,0x01},
   {'e','n',0x20,0x20,0x20,0x20,0xEE,0x11,0x01},
   {'e','n','g',0x20,0x20,0x20,0xED,0x12,0x01},
   {'h','a',0x20,0x20,0x20,0x20,0xEC,0x13,0x01},
   {'h','a','i',0x20,0x20,0x20,0xEB,0x14,0x01},
   {'h','a','n',0x20,0x20,0x20,0xEA,0x15,0x01},
   {'h','a','n','g',0x20,0x20,0xE9,0x16,0x01},
   {'h','a','o',0x20,0x20,0x20,0xE8,0x17,0x01},
   {'h','e',0x20,0x20,0x20,0x20,0xE7,0x18,0x01},
   {'h','e','n',0x20,0x20,0x20,0xE6,0x19,0x01},
   {'h','e','n','g',0x20,0x20,0xE5,0x1A,0x01},
   {'h','i',0x20,0x20,0x20,0x20,0xE4,0x1B,0x01},
   {'h','o','u',0x20,0x20,0x20,0xE3,0x1C,0x01},
   {'h','u',0x20,0x20,0x20,0x20,0xE2,0x1D,0x01},
   {'h','u','a',0x20,0x20,0x20,0xE1,0x1E,0x01},
   {'h','u','a','i',0x20,0x20,0xE0,0x1F,0x01},
   {'h','u','a','n',0x20,0x20,0xDF,0x20,0x01},
   {'h','u','a','n','g',0x20,0xDE,0x21,0x01},
   {'h','u','i',0x20,0x20,0x20,0xDD,0x22,0x01},
   {'h','u','n',0x20,0x20,0x20,0xDC,0x23,0x01},
   {'h','u','o',0x20,0x20,0x20,0xDB,0x24,0x01},
   {'i',0x20,0x20,0x20,0x20,0x20,0xDA,0x25,0x01},
   {'o','n','g',0x20,0x20,0x20,0xD9,0x26,0x01},
   {'o','u',0x20,0x20,0x20,0x20,0xD8,0x27,0x01},
   {'u',0x20,0x20,0x20,0x20,0x20,0xD7,0x28,0x01},
   {'u','a','n',0x20,0x20,0x20,0xD6,0x29,0x01},
   {'u','i',0x20,0x20,0x20,0x20,0xD5,0x2A,0x01},
   {'u','n',0x20,0x20,0x20,0x20,0xD4,0x2B,0x01},
   {'u','o',0x20,0x20,0x20,0x20,0xD3,0x2C,0x01}
  };
  
  BYTE PY_index_t[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0xD2,0x2D,0x01},
   {'a','i',0x20,0x20,0x20,0x20,0xD1,0x2E,0x01},
   {'a','n',0x20,0x20,0x20,0x20,0xD0,0x2F,0x01},
   {'a','n','g',0x20,0x20,0x20,0xCF,0x30,0x01},
   {'a','o',0x20,0x20,0x20,0x20,0xCE,0x31,0x01},
   {'e',0x20,0x20,0x20,0x20,0x20,0xCD,0x32,0x01},
   {'e','n','g',0x20,0x20,0x20,0xCC,0x33,0x01},
   {'i',0x20,0x20,0x20,0x20,0x20,0xCB,0x34,0x01},
   {'i','a','n',0x20,0x20,0x20,0xCA,0x35,0x01},
   {'i','a','o',0x20,0x20,0x20,0xC9,0x36,0x01},
   {'i','e',0x20,0x20,0x20,0x20,0xC8,0x37,0x01},
   {'i','n','g',0x20,0x20,0x20,0xC7,0x38,0x01},
   {'o','n','g',0x20,0x20,0x20,0xC6,0x39,0x01},
   {'o','u',0x20,0x20,0x20,0x20,0xC5,0x3A,0x01},
   {'u',0x20,0x20,0x20,0x20,0x20,0xC4,0x3B,0x01},
   {'u','a','n',0x20,0x20,0x20,0xC3,0x3C,0x01},
   {'u','i',0x20,0x20,0x20,0x20,0xC2,0x3D,0x01},
   {'u','n',0x20,0x20,0x20,0x20,0xC1,0x3E,0x01},
   {'u','o',0x20,0x20,0x20,0x20,0xC0,0x3F,0x01}
  };
  BYTE PY_index_w[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0xBF,0x40,0x01},
   {'a','i',0x20,0x20,0x20,0x20,0xBE,0x41,0x01},
   {'a','n',0x20,0x20,0x20,0x20,0xBD,0x42,0x01},
   {'a','n','g',0x20,0x20,0x20,0xBC,0x43,0x01},
   {'e','i',0x20,0x20,0x20,0x20,0xBB,0x44,0x01},
   {'e','n',0x20,0x20,0x20,0x20,0xBA,0x45,0x01},
   {'e','n','g',0x20,0x20,0x20,0xB9,0x46,0x01},
   {'o',0x20,0x20,0x20,0x20,0x20,0xB8,0x47,0x01},
   {'u',0x20,0x20,0x20,0x20,0x20,0xB7,0x48,0x01}
  };
  BYTE PY_index_x[][9]={
   {'i',0x20,0x20,0x20,0x20,0x20,0xB6,0x49,0x01},
   {'i','a',0x20,0x20,0x20,0x20,0xB5,0x4A,0x01},
   {'i','a','n',0x20,0x20,0x20,0xB4,0x4B,0x01},
   {'i','a','n','g',0x20,0x20,0xB3,0x4C,0x01},
   {'i','a','o',0x20,0x20,0x20,0xB2,0x4D,0x01},
   {'i','e',0x20,0x20,0x20,0x20,0xB1,0x4E,0x01},
   {'i','n',0x20,0x20,0x20,0x20,0xB0,0x4F,0x01},
   {'i','n','g',0x20,0x20,0x20,0xAF,0x50,0x01},
   {'i','o','n','g',0x20,0x20,0xAE,0x51,0x01},
   {'i','u',0x20,0x20,0x20,0x20,0xAD,0x52,0x01},
   {'u',0x20,0x20,0x20,0x20,0x20,0xAC,0x53,0x01},
   {'u','a','n',0x20,0x20,0x20,0xAB,0x54,0x01},
   {'u','e',0x20,0x20,0x20,0x20,0xAA,0x55,0x01},
   {'u','n',0x20,0x20,0x20,0x20,0xA9,0x56,0x01}
  };
  BYTE PY_index_y[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0xA8,0x57,0x01},
   {'a','n',0x20,0x20,0x20,0x20,0xA7,0x58,0x01},
   {'a','n','g',0x20,0x20,0x20,0xA6,0x59,0x01},
   {'a','o',0x20,0x20,0x20,0x20,0xA5,0x5A,0x01},
   {'e',0x20,0x20,0x20,0x20,0x20,0xA4,0x5B,0x01},
   {'i',0x20,0x20,0x20,0x20,0x20,0xA3,0x5C,0x01},
   {'i','n',0x20,0x20,0x20,0x20,0xA2,0x5D,0x01},
   {'i','n','g',0x20,0x20,0x20,0xA1,0x5E,0x01},
   {'o',0x20,0x20,0x20,0x20,0x20,0xA0,0x5F,0x01},
   {'o','n','g',0x20,0x20,0x20,0x9F,0x60,0x01},
   {'o','u',0x20,0x20,0x20,0x20,0x9E,0x61,0x01},
   {'u',0x20,0x20,0x20,0x20,0x20,0x9D,0x62,0x01},
   {'u','a','n',0x20,0x20,0x20,0x9C,0x63,0x01},
   {'u','e',0x20,0x20,0x20,0x20,0x9B,0x64,0x01},
   {'u','n',0x20,0x20,0x20,0x20,0x9A,0x65,0x01}
  };
  BYTE PY_index_z[][9]={
   {'a',0x20,0x20,0x20,0x20,0x20,0x99,0x66,0x01},
   {'a','i',0x20,0x20,0x20,0x20,0x98,0x67,0x01},
   {'a','n',0x20,0x20,0x20,0x20,0x97,0x68,0x01},
   {'a','n','g',0x20,0x20,0x20,0x96,0x69,0x01},
   {'a','o',0x20,0x20,0x20,0x20,0x95,0x6A,0x01},
   {'e',0x20,0x20,0x20,0x20,0x20,0x94,0x6B,0x01},
   {'e','i',0x20,0x20,0x20,0x20,0x93,0x6C,0x01},
   {'e','n',0x20,0x20,0x20,0x20,0x92,0x6D,0x01},
   {'e','n','g',0x20,0x20,0x20,0x91,0x6E,0x01},
   {'h','a',0x20,0x20,0x20,0x20,0x90,0x6F,0x01},
   {'h','a','i',0x20,0x20,0x20,0x8F,0x70,0x01},
   {'h','a','n',0x20,0x20,0x20,0x8E,0x71,0x01},
   {'h','a','n','g',0x20,0x20,0x8D,0x72,0x01},
   {'h','a','o',0x20,0x20,0x20,0x8C,0x73,0x01},
   {'h','e',0x20,0x20,0x20,0x20,0x8B,0x74,0x01},
   {'h','e','n',0x20,0x20,0x20,0x8A,0x75,0x01},
   {'h','e','n','g',0x20,0x20,0x89,0x76,0x01},
   {'h','i',0x20,0x20,0x20,0x20,0x88,0x77,0x01},
   {'h','o','n','g',0x20,0x20,0x87,0x78,0x01},
   {'h','o','u',0x20,0x20,0x20,0x86,0x79,0x01},
   {'h','u',0x20,0x20,0x20,0x20,0x85,0x7A,0x01},
   {'h','u','a',0x20,0x20,0x20,0x84,0x7B,0x01},
   {'h','u','a','i',0x20,0x20,0x83,0x7C,0x01},
   {'h','u','a','n',0x20,0x20,0x82,0x7D,0x01},
   {'h','u','a','n','g',0x20,0x81,0x7E,0x01},
   {'h','u','i',0x20,0x20,0x20,0x80,0x7F,0x01},
   {'h','u','n',0x20,0x20,0x20,0x7F,0x80,0x01},
   {'h','u','o',0x20,0x20,0x20,0x7E,0x81,0x01},
   {'i',0x20,0x20,0x20,0x20,0x20,0x7D,0x82,0x01},
   {'o','n','g',0x20,0x20,0x20,0x7C,0x83,0x01},
   {'o','u',0x20,0x20,0x20,0x20,0x7B,0x84,0x01},
   {'u',0x20,0x20,0x20,0x20,0x20,0x7A,0x85,0x01},
   {'u','a','n',0x20,0x20,0x20,0x79,0x86,0x01},
   {'u','i',0x20,0x20,0x20,0x20,0x78,0x87,0x01},
   {'u','n',0x20,0x20,0x20,0x20,0x77,0x88,0x01},
   {'u','o',0x20,0x20,0x20,0x20,0x76,0x89,0x01}
  };
  BYTE PY_index_end[][9]={0x20,0x20,0x20,0x20,0x20,0x20,0,0,0};
  BYTE (* PY_index_pointer[27])[9]=
  {
   PY_index_a,PY_index_b,PY_index_c,PY_index_d,PY_index_e,
   PY_index_f,PY_index_g,PY_index_h,PY_index_j,PY_index_j,
   PY_index_k,PY_index_l,PY_index_m,PY_index_n,PY_index_o,
   PY_index_p,PY_index_q,PY_index_r,PY_index_s,PY_index_t,
   PY_index_w,PY_index_w,PY_index_w,PY_index_x,PY_index_y,
   PY_index_z,PY_index_end
  };
  
  // 查询代码
  CNixInputMethod::CNixInputMethod()
  {
   py_mb_begin=(unsigned long)&PY_mb_a[0][0];
  
  }
  
  CNixInputMethod::~CNixInputMethod()
  {
  
  }
  BYTE *CNixInputMethod::py_ime(BYTE input_py_val[])
  {
   BYTE (* p1)[9],(* p2)[9],(* p3)[9];
   BYTE i=1;
   long dwTemp=0;
   if (input_py_val[0]==0) return(0); //"如果输入空字符返回0"
   if (input_py_val[0]=='i') return(0);
   if (input_py_val[0]=='u') return(0);
   if (input_py_val[0]=='v') return(0);
  
   p1=p2=PY_index_pointer[input_py_val[0]-0x61]; //"计算入口树根"
   p3=PY_index_pointer[input_py_val[0]-0x60]; //"设置指针界限"
  
   if (p1==0) return(0);
   //"查询失败返回0"
   if(input_py_val[1]>0)
   {
   while (p1<p3)
   {
   if ((*p1)[0]==input_py_val[1])
   {
   p2=p1;
  
  break;
   }
   else
   {
   p1++;//"查询第二个拼音"
   }
   }
  
   }
   p1=p2;
   if(input_py_val[1]>0)
   {
   while (p1<p3)
   {//"阶梯法查询余下拼音"
   if (((*p1)[i]==input_py_val[i+1])&&((*p1)[i-1]==input_py_val[i]))
   {
   p2=p1;
   i++;
   }
   else
   {
   p1++;
   }
   }
   }
   dwTemp=(*p2)[6]+(*p2)[7]*256+(*p2)[8]*65535+py_mb_begin;
   return((BYTE *)(dwTemp)); //"返回查询结果首地址"
  
  }
  CString CNixInputMethod::GetInputString(BYTE input_py_val[])
  {
   BYTE *pTemp;
   pTemp=py_ime(input_py_val);
   CString strTemp(pTemp);
   return strTemp;
  }

转自:http://www.wangchao.net.cn/bbsdetail_147140.html

你可能感兴趣的:(c,input,processing,输入法,byte,translation)