zoukankan      html  css  js  c++  java
  • paip.输入法编程词频调整原则发音长度优先

    paip.输入法编程--词频调整原则--发音长度优先


    作者Attilax ,  EMAIL:1466519819@qq.com 
    来源:attilax的专栏
    地址:http://blog.csdn.net/attilax




    准备打个 "提升" ,编码是 "tishen   sp"..


    江打的个"tishen" ,出来个"听审,提升"...


    听审的编码是"tinshen kb"...发音是 tinshen


    按发音还是按编码, 听审都到个"提升"的前头了...


    要不个"提升"提的个前头了...应该是按发音长度优先排序才对..


    增加一个列len_fain.  fault=0  ,not null


     update  gaopinzi  set len_fain=LENGTH(py)  where  LENGTH(py)>0




    [SQL]  update  gaopinzi  set len_fain=LENGTH(py)  where  LENGTH(py)>0


    受影响的行: 266638
    时间: 38.609s






    增加in up 触发器
    -------------------------


    CREATE TRIGGER `swe_len_fain4insert` BEFORE INSERT ON `gaopinzi` FOR EACH ROW begin
     update  gaopinzi  set len_fain=LENGTH(py)  where id=new.id;
    #insert  logx(idop,eventx,timex,demo,hezi,pyold,pynew)values( old.id,'update rec',now(),'',old.hezi,old.atian,new.atian);
    end;


    CREATE TRIGGER `swe_len_fain4up` BEFORE UPDATE ON `gaopinzi` FOR EACH ROW begin
      set    new.len_fain=LENGTH(new.py)  ;
    #insert  logx(idop,eventx,timex,demo,hezi,pyold,pynew)values( old.id,'update rec',now(),'',old.hezi,old.atian,new.atian);
    end;


    修改导出sql
    ------------
    SELECT SQL_NO_CACHE *,
    py,
    hezi,
    id,


    IF (
    gudin = 1,
    CONCAT(ATIAN, '#固'),
    ATIAN
    ) AS nyefa
    , lan_ord  lanOrd,lang
    FROM
    gaopinzi   
     force index(i_export)
    WHERE LENGTH(atian) >0 
    and ( del=0 or del is null)
      
    ORDER BY 
    lanOrd, atipydiff,len_fain,py,atian,
    gudinfejwe ,
    ord,
    iD 
     









  • 相关阅读:
    十天冲刺之三
    设计模式-模板方法模式
    设计模式-观察者模式
    设计模式-迭代子模式
    设计模式-责任链模式
    设计模式-门面模式
    1395. Count Number of Teams
    747. Largest Number At Least Twice of Others
    1160. Find Words That Can Be Formed by Characters
    1539. Kth Missing Positive Number
  • 原文地址:https://www.cnblogs.com/attilax/p/15199566.html
Copyright © 2011-2022 走看看