📄 pytable.h
字号:
strcpy(pytable[19].node[5].first_hz,"特");
pytable[19].node[5].count=1;
strcpy(pytable[19].node[6].yinjie,"teng");
strcpy(pytable[19].node[6].first_hz,"藤");
pytable[19].node[6].count=4;
strcpy(pytable[19].node[7].yinjie,"ti");
strcpy(pytable[19].node[7].first_hz,"梯");
pytable[19].node[7].count=15;
strcpy(pytable[19].node[8].yinjie,"tian");
strcpy(pytable[19].node[8].first_hz,"天");
pytable[19].node[8].count=8;
strcpy(pytable[19].node[9].yinjie,"tiao");
strcpy(pytable[19].node[9].first_hz,"挑");
pytable[19].node[9].count=5;
strcpy(pytable[19].node[10].yinjie,"tie");
strcpy(pytable[19].node[10].first_hz,"贴");
pytable[19].node[10].count=4;
strcpy(pytable[19].node[11].yinjie,"ting");
strcpy(pytable[19].node[11].first_hz,"听");
pytable[19].node[11].count=9;
strcpy(pytable[19].node[12].yinjie,"tong");
strcpy(pytable[19].node[12].first_hz,"通");
pytable[19].node[12].count=13;
strcpy(pytable[19].node[13].yinjie,"tou");
strcpy(pytable[19].node[13].first_hz,"偷");
pytable[19].node[13].count=4;
strcpy(pytable[19].node[14].yinjie,"tu");
strcpy(pytable[19].node[14].first_hz,"凸");
pytable[19].node[14].count=11;
strcpy(pytable[19].node[15].yinjie,"tuan");
strcpy(pytable[19].node[15].first_hz,"湍");
pytable[19].node[15].count=4;
strcpy(pytable[19].node[16].yinjie,"tui");
strcpy(pytable[19].node[16].first_hz,"腿");
pytable[19].node[16].count=4;
strcpy(pytable[19].node[17].yinjie,"tun");
strcpy(pytable[19].node[17].first_hz,"吞");
pytable[19].node[17].count=3;
strcpy(pytable[19].node[18].yinjie,"tuo");
strcpy(pytable[19].node[18].first_hz,"拖");
pytable[19].node[18].count=11;
// w
strcpy(pytable[22].node[0].yinjie,"wa");
strcpy(pytable[22].node[0].first_hz,"挖");
pytable[22].node[0].count=7;
strcpy(pytable[22].node[1].yinjie,"wai");
strcpy(pytable[22].node[1].first_hz,"歪");
pytable[22].node[1].count=2;
strcpy(pytable[22].node[2].yinjie,"wan");
strcpy(pytable[22].node[2].first_hz,"豌");
pytable[22].node[2].count=17;
strcpy(pytable[22].node[3].yinjie,"wang");
strcpy(pytable[22].node[3].first_hz,"汪");
pytable[22].node[3].count=10;
strcpy(pytable[22].node[4].yinjie,"wei");
strcpy(pytable[22].node[4].first_hz,"威");
pytable[22].node[4].count=33;
strcpy(pytable[22].node[5].yinjie,"wen");
strcpy(pytable[22].node[5].first_hz,"瘟");
pytable[22].node[5].count=10;
strcpy(pytable[22].node[6].yinjie,"weng");
strcpy(pytable[22].node[6].first_hz,"嗡");
pytable[22].node[6].count=3;
strcpy(pytable[22].node[7].yinjie,"wo");
strcpy(pytable[22].node[7].first_hz,"挝");
pytable[22].node[7].count=9;
strcpy(pytable[22].node[8].yinjie,"wu");
strcpy(pytable[22].node[8].first_hz,"巫");
pytable[22].node[8].count=29;
// x
strcpy(pytable[23].node[0].yinjie,"xi");
strcpy(pytable[23].node[0].first_hz,"昔");
pytable[23].node[0].count=35;
strcpy(pytable[23].node[1].yinjie,"xia");
strcpy(pytable[23].node[1].first_hz,"瞎");
pytable[23].node[1].count=13;
strcpy(pytable[23].node[2].yinjie,"xian");
strcpy(pytable[23].node[2].first_hz,"掀");
pytable[23].node[2].count=26;
strcpy(pytable[23].node[3].yinjie,"xiang");
strcpy(pytable[23].node[3].first_hz,"相");
pytable[23].node[3].count=20;
strcpy(pytable[23].node[4].yinjie,"xiao");
strcpy(pytable[23].node[4].first_hz,"萧");
pytable[23].node[4].count=18;
strcpy(pytable[23].node[5].yinjie,"xie");
strcpy(pytable[23].node[5].first_hz,"楔");
pytable[23].node[5].count=21;
strcpy(pytable[23].node[6].yinjie,"xin");
strcpy(pytable[23].node[6].first_hz,"薪");
pytable[23].node[6].count=10;
strcpy(pytable[23].node[7].yinjie,"xing");
strcpy(pytable[23].node[7].first_hz,"星");
pytable[23].node[7].count=15;
strcpy(pytable[23].node[8].yinjie,"xiong");
strcpy(pytable[23].node[8].first_hz,"兄");
pytable[23].node[8].count=7;
strcpy(pytable[23].node[9].yinjie,"xiu");
strcpy(pytable[23].node[9].first_hz,"休");
pytable[23].node[9].count=9;
strcpy(pytable[23].node[10].yinjie,"xu");
strcpy(pytable[23].node[10].first_hz,"墟");
pytable[23].node[10].count=19;
strcpy(pytable[23].node[11].yinjie,"xuan");
strcpy(pytable[23].node[11].first_hz,"轩");
pytable[23].node[11].count=10;
strcpy(pytable[23].node[12].yinjie,"xue");
strcpy(pytable[23].node[12].first_hz,"靴");
pytable[23].node[12].count=6;
strcpy(pytable[23].node[13].yinjie,"xun");
strcpy(pytable[23].node[13].first_hz,"勋");
pytable[23].node[13].count=14;
// y
strcpy(pytable[24].node[0].yinjie,"ya");
strcpy(pytable[24].node[0].first_hz,"压");
pytable[24].node[0].count=16;
strcpy(pytable[24].node[1].yinjie,"yan");
strcpy(pytable[24].node[1].first_hz,"焉");
pytable[24].node[1].count=33;
strcpy(pytable[24].node[2].yinjie,"yang");
strcpy(pytable[24].node[2].first_hz,"殃");
pytable[24].node[2].count=17;
strcpy(pytable[24].node[3].yinjie,"yao");
strcpy(pytable[24].node[3].first_hz,"邀");
pytable[24].node[3].count=15;
strcpy(pytable[24].node[4].yinjie,"ye");
strcpy(pytable[24].node[4].first_hz,"椰");
pytable[24].node[4].count=15;
strcpy(pytable[24].node[5].yinjie,"yi");
strcpy(pytable[24].node[5].first_hz,"一");
pytable[24].node[5].count=53;
strcpy(pytable[24].node[6].yinjie,"yin");
strcpy(pytable[24].node[6].first_hz,"茵");
pytable[24].node[6].count=16;
strcpy(pytable[24].node[7].yinjie,"ying");
strcpy(pytable[24].node[7].first_hz,"英");
pytable[24].node[7].count=18;
strcpy(pytable[24].node[8].yinjie,"yo");
strcpy(pytable[24].node[8].first_hz,"哟");
pytable[24].node[8].count=1;
strcpy(pytable[24].node[9].yinjie,"yong");
strcpy(pytable[24].node[9].first_hz,"拥");
pytable[24].node[9].count=15;
strcpy(pytable[24].node[10].yinjie,"you");
strcpy(pytable[24].node[10].first_hz,"幽");
pytable[24].node[10].count=20;
strcpy(pytable[24].node[11].yinjie,"yu");
strcpy(pytable[24].node[11].first_hz,"迂");
pytable[24].node[11].count=45;
strcpy(pytable[24].node[12].yinjie,"yuan");
strcpy(pytable[24].node[12].first_hz,"鸳");
pytable[24].node[12].count=20;
strcpy(pytable[24].node[13].yinjie,"yue");
strcpy(pytable[24].node[13].first_hz,"曰");
pytable[24].node[13].count=10;
strcpy(pytable[24].node[14].yinjie,"yun");
strcpy(pytable[24].node[14].first_hz,"耘");
pytable[24].node[14].count=12;
// z
strcpy(pytable[25].node[0].yinjie,"za");
strcpy(pytable[25].node[0].first_hz,"匝");
pytable[25].node[0].count=3;
strcpy(pytable[25].node[1].yinjie,"zai");
strcpy(pytable[25].node[1].first_hz,"栽");
pytable[25].node[1].count=7;
strcpy(pytable[25].node[2].yinjie,"zan");
strcpy(pytable[25].node[2].first_hz,"咱");
pytable[25].node[2].count=4;
strcpy(pytable[25].node[3].yinjie,"zang");
strcpy(pytable[25].node[3].first_hz,"赃");
pytable[25].node[3].count=3;
strcpy(pytable[25].node[4].yinjie,"zao");
strcpy(pytable[25].node[4].first_hz,"遭");
pytable[25].node[4].count=14;
strcpy(pytable[25].node[5].yinjie,"ze");
strcpy(pytable[25].node[5].first_hz,"责");
pytable[25].node[5].count=4;
strcpy(pytable[25].node[6].yinjie,"zei");
strcpy(pytable[25].node[6].first_hz,"贼");
pytable[25].node[6].count=1;
strcpy(pytable[25].node[7].yinjie,"zen");
strcpy(pytable[25].node[7].first_hz,"怎");
pytable[25].node[7].count=1;
strcpy(pytable[25].node[8].yinjie,"zeng");
strcpy(pytable[25].node[8].first_hz,"增");
pytable[25].node[8].count=4;
strcpy(pytable[25].node[9].yinjie,"zha");
strcpy(pytable[25].node[9].first_hz,"扎");
pytable[25].node[9].count=14;
strcpy(pytable[25].node[10].yinjie,"zhai");
strcpy(pytable[25].node[10].first_hz,"摘");
pytable[25].node[10].count=6;
strcpy(pytable[25].node[11].yinjie,"zhan");
strcpy(pytable[25].node[11].first_hz,"瞻");
pytable[25].node[11].count=17;
strcpy(pytable[25].node[12].yinjie,"zhang");
strcpy(pytable[25].node[12].first_hz,"樟");
pytable[25].node[12].count=15;
strcpy(pytable[25].node[13].yinjie,"zhao");
strcpy(pytable[25].node[13].first_hz,"招");
pytable[25].node[13].count=10;
strcpy(pytable[25].node[14].yinjie,"zhe");
strcpy(pytable[25].node[14].first_hz,"遮");
pytable[25].node[14].count=10;
strcpy(pytable[25].node[15].yinjie,"zhen");
strcpy(pytable[25].node[15].first_hz,"珍");
pytable[25].node[15].count=16;
strcpy(pytable[25].node[16].yinjie,"zheng");
strcpy(pytable[25].node[16].first_hz,"蒸");
pytable[25].node[16].count=15;
strcpy(pytable[25].node[17].yinjie,"zhi");
strcpy(pytable[25].node[17].first_hz,"芝");
pytable[25].node[17].count=43;
strcpy(pytable[25].node[18].yinjie,"zhong");
strcpy(pytable[25].node[18].first_hz,"中");
pytable[25].node[18].count=11;
strcpy(pytable[25].node[19].yinjie,"zhou");
strcpy(pytable[25].node[19].first_hz,"舟");
pytable[25].node[19].count=14;
strcpy(pytable[25].node[20].yinjie,"zhu");
strcpy(pytable[25].node[20].first_hz,"珠");
pytable[25].node[20].count=26;
strcpy(pytable[25].node[21].yinjie,"zhua");
strcpy(pytable[25].node[21].first_hz,"抓");
pytable[25].node[21].count=2;
strcpy(pytable[25].node[22].yinjie,"zhuai");
strcpy(pytable[25].node[22].first_hz,"拽");
pytable[25].node[22].count=1;
strcpy(pytable[25].node[23].yinjie,"zhuan");
strcpy(pytable[25].node[23].first_hz,"专");
pytable[25].node[23].count=6;
strcpy(pytable[25].node[24].yinjie,"zhuang");
strcpy(pytable[25].node[24].first_hz,"桩");
pytable[25].node[24].count=7;
strcpy(pytable[25].node[25].yinjie,"zhui");
strcpy(pytable[25].node[25].first_hz,"椎");
pytable[25].node[25].count=6;
strcpy(pytable[25].node[26].yinjie,"zhun");
strcpy(pytable[25].node[26].first_hz,"谆");
pytable[25].node[26].count=2;
strcpy(pytable[25].node[27].yinjie,"zhuo");
strcpy(pytable[25].node[27].first_hz,"捉");
pytable[25].node[27].count=11;
strcpy(pytable[25].node[28].yinjie,"zi");
strcpy(pytable[25].node[28].first_hz,"兹");
pytable[25].node[28].count=15;
strcpy(pytable[25].node[29].yinjie,"zong");
strcpy(pytable[25].node[29].first_hz,"鬃");
pytable[25].node[29].count=7;
strcpy(pytable[25].node[30].yinjie,"zou");
strcpy(pytable[25].node[30].first_hz,"邹");
pytable[25].node[30].count=4;
strcpy(pytable[25].node[31].yinjie,"zu");
strcpy(pytable[25].node[31].first_hz,"租");
pytable[25].node[31].count=8;
strcpy(pytable[25].node[32].yinjie,"zuan");
strcpy(pytable[25].node[32].first_hz,"钻");
pytable[25].node[32].count=2;
strcpy(pytable[25].node[33].yinjie,"zui");
strcpy(pytable[25].node[33].first_hz,"嘴");
pytable[25].node[33].count=4;
strcpy(pytable[25].node[34].yinjie,"zun");
strcpy(pytable[25].node[34].first_hz,"尊");
pytable[25].node[34].count=2;
strcpy(pytable[25].node[35].yinjie,"zuo");
strcpy(pytable[25].node[35].first_hz,"昨");
pytable[25].node[35].count=8;
return KB_OK;
}
int remv_pytable()
{
int i;
for(i=0;i<26;i++)
{
free(pytable[i].node);
if(pytable[i].node) return KB_ERROR;
}
return KB_OK;
}
char * lookup_pytable(char *slable)
// slable是当前输入的拼音音节字符
{
int slen,i,n,count=10,times=0;
// count是输出汉字字段的长度,times 是当前拼音音节在
// 查找表中被包含的次数,比如'w'被'wa'、'wai'等包含
unsigned short hz_code;
char *string_hz=NULL,temp_hz[4];
py_record_t *node;
slen=strlen(slable);
if ((slen>6)||(slen<1)) return NULL;
n=(slable[0]-'a')%26;
if (pytable[n].volume==0) return NULL;
for(i=0;i<pytable[n].volume;i++)
{
if(strstr(pytable[n].node[i].yinjie, slable)!=NULL)
{ if(times==0) node=&(pytable[n].node[i]);
times=times+1;
}
}
if (times==0) return NULL;
else if (times==1)
{
memcpy(&hz_code,node->first_hz,2);
count=node->count;
string_hz=(char *)malloc(count*2+1);
if (string_hz==NULL) return NULL;
strcpy(string_hz,node->first_hz);
for (int i=1;i<count;i++){
hz_code=hz_code+256;
if (hz_code>255*256) hz_code=(hz_code-94*256)+1;
memcpy(temp_hz,&hz_code,2);
temp_hz[2]='\0';
strcat(string_hz,temp_hz);
}
return(string_hz);
}
else
{
memcpy(&hz_code,node->first_hz,2);
if (node->count>10) count=node->count;
string_hz=(char *)malloc(count*2+1);
if (string_hz==NULL) return NULL;
strcpy(string_hz,node->first_hz);
for (int i=1;i<count;i++){
hz_code=hz_code+256;
if (hz_code>255*256) hz_code=(hz_code-94*256)+1;
memcpy(temp_hz,&hz_code,2);
temp_hz[2]='\0';
strcat(string_hz,temp_hz);
}
return(string_hz);
}
return NULL;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -