paip.输入法编程----删除双字词简拼
paip.输入法编程----删除双字词简拼
作者Attilax , EMAIL:1466519819@qq.com
来源:attilax的专栏
地址:http://blog.csdn.net/attilax
双字词简拼重码太多了,意义不大,决定要从词库删除...
1.查询双字词记录
-------------------
主要步骤是a.查询汉字表,找到拼音码长度>1的汉字.
b.取出词库词,截取第一个字...
c.词库词跟汉字表的对比...
SELECT
*
FROM
gaopinzi
WHERE
LENGTH(atian) = 2
AND LENGTH(hezi) = 6
and (ord is null or ord =99)
AND gudin = 0
AND lang IS NULL
AND (
LEFT (hezi, 1) IN (
SELECT
hezi
FROM
hezibyao
WHERE
LENGTH(atian) > 1
)
)
ORDER BY
id
记录条数..
2.导出要删除的词库ID到临时表,加上主键,以便速度解锁
------------------------------------------------------
insert tmp
SELECT
id
FROM
gaopinzi
WHERE
LENGTH(atian) = 2
AND LENGTH(hezi) = 6
and (ord is null or ord =99)
AND gudin = 0
AND lang IS NULL
AND (
LEFT (hezi, 1) IN (
SELECT
hezi
FROM
hezibyao
WHERE
LENGTH(atian) > 1
)
)
ORDER BY
id
3.批量删除
-----------
delete FROM
gaopinzi
WHERE
ID IN (
SELeCT ID FROM tmp
)
4.严正删除的数量
---------------------