paip.输入法编程--英文ati化By音标原理与中文atiEn处理流程 python 代码为例


paip.输入法编程--英文ati化By音标原理与中文atiEn处理流程 python 代码为例

#---目标
1. en vs enPHati
2.en vs enPhAtiSmp
3.cn vs enPHati
4. cn vs enPhAtiSmp


#两个方法,一个获得enPhAtied代码,一个获得哪的smp版本..

def convert2atiEnPnNoSpltr(old):
       a=old.replace("@", "").replace("-", "")
       return a
def Smp(old):
        """odl=@n-@y-u@t-@rw-@t-
        """
        old=trim(old,"@")
        
        r=""
        a=old.split("@")
        
        for val in a:
            a2=val.split("-")
            csnt=a2[0]
            r=r+csnt
        #endfor
        old=trim(old,"-")
        if(isStartWithVowel(old)):
            startx=old[0]
            r=startx+r
        if(len(trim(old))<=3) :
            
            return old
        return r


        作者 老哇的爪子 Attilax 艾龙,  EMAIL:1466519819@qq.com
转载请注明来源: http://blog.csdn.net/attilax


#---导出为输入法词库格式.
en  vs  atiEnPh  and atiENPHsmp

SELECT encn.en,atiNoSpltr  FROM `grejx_def`  encn  
left JOIN  `enphonetic` enph
on enph.en=encn.en
where atiNoSpltr is not null   and encn.en is not null


SELECT encn.en,atismp  FROM `grejx_def`  encn  
left JOIN  `enphonetic` enph
on enph.en=encn.en
where atismp is not null   and encn.en is not null


#--  cn vs atiEnPh and smp




SELECT clrbrkt, atiNoSpltr  FROM `grejx_def`  encn  
left JOIN  `enphonetic` enph
on enph.en=encn.en
where atiNoSpltr is not null   and clrbrkt is not null



SELECT encn.en, clrbrkt,atiNoSpltr,atismp,enph.id  FROM `grejx_def`  encn  
left JOIN  `enphonetic` enph
on enph.en=encn.en
where atismp is not null and LENGTH(atiNoSpltr)<=4
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值