paip.输入法编程---词频调整--单字优先编码发音一致优先的问题跟调整
作者Attilax , EMAIL:1466519819@qq.com
来源:attilax的专栏
地址:http://blog.csdn.net/attilax
有个小问题
donva 冬 动物
但是,donva应该是"动物",排在前面..不过,按照py排序,"冬"在前头了..
解决方案: 编码发音一致优先原则
--------------------------------------
增加一个列,atipydiff..default sh 1 ..要是编码跟py一样,走0 最优先..
atipydiff的优先级
select *
FROM
gaopinzi
where atian=py
atipydiff=0
------------------------------
update gaopinzi set atipydiff=0 where atian=py
[SQL] update gaopinzi set atipydiff=0 where atian=py
受影响的行: 24
时间: 1.406s
增加触发器
---------------
set new.atipydiff= IF (
new.atian =new.py,
0,1);
set new.gudinfejwe= IF (
new.gudin =1,
0,1);
set new.atipydiff= IF (
new.atian =new.py,
0,1);
set new.len_fain= IF (
new.py is null or new.py = '',
0, LENGTH(new.py) );
set new.lang= IF (
new.lang is null or new.lang = '',
'chinese', new.lang );
set new.lan_ord= lang_ord(new.lang) ;
导出改为:
--------------------------
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)
and atian='donva'
ORDER BY
lanOrd,atipydiff,py,atian,
gudinfejwe ,
ord,
iD