This commit is contained in:
parent
c3cf9b7028
commit
0dc60fb756
19
rime.lua
19
rime.lua
@ -10,17 +10,6 @@ function date_translator(input, seg, env)
|
|||||||
local week = config:get_string(env.name_space .. "/week") or "xq"
|
local week = config:get_string(env.name_space .. "/week") or "xq"
|
||||||
local datetime = config:get_string(env.name_space .. "/datetime") or "dt"
|
local datetime = config:get_string(env.name_space .. "/datetime") or "dt"
|
||||||
local timestamp = config:get_string(env.name_space .. "/timestamp") or "ts"
|
local timestamp = config:get_string(env.name_space .. "/timestamp") or "ts"
|
||||||
-- if input == "s" then
|
|
||||||
-- local cand = Candidate("date", seg.start, seg._end, ("%.f"):format(collectgarbage('count')), "")
|
|
||||||
-- cand.quality = 100
|
|
||||||
-- yield(cand)
|
|
||||||
-- end
|
|
||||||
-- if input == "xxx" then
|
|
||||||
-- collectgarbage()
|
|
||||||
-- local cand = Candidate("date", seg.start, seg._end, "collectgarbage()", "")
|
|
||||||
-- cand.quality = 100
|
|
||||||
-- yield(cand)
|
|
||||||
-- end
|
|
||||||
-- 日期
|
-- 日期
|
||||||
if (input == date) then
|
if (input == date) then
|
||||||
local cand = Candidate("date", seg.start, seg._end, os.date("%Y-%m-%d"), "")
|
local cand = Candidate("date", seg.start, seg._end, os.date("%Y-%m-%d"), "")
|
||||||
@ -173,7 +162,7 @@ function long_word_filter(input, env)
|
|||||||
local i = 1
|
local i = 1
|
||||||
for cand in input:iter() do
|
for cand in input:iter() do
|
||||||
-- 找齐了或者 l 太大了,就不找了
|
-- 找齐了或者 l 太大了,就不找了
|
||||||
if (s == count) or (#l > 100) then
|
if (s == count) or (#l > 50) then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
local leng = utf8.len(cand.text)
|
local leng = utf8.len(cand.text)
|
||||||
@ -194,6 +183,12 @@ function long_word_filter(input, env)
|
|||||||
for cand in input:iter() do
|
for cand in input:iter() do
|
||||||
yield(cand)
|
yield(cand)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 如果内存大于 5000 的话,GC 一次,最小间隔 60s
|
||||||
|
-- if collectgarbage('count') > 5000 and (os.time() - last_gc_time) > 60 then
|
||||||
|
-- collectgarbage("collect")
|
||||||
|
-- last_gc_time = os.time()
|
||||||
|
-- end
|
||||||
end
|
end
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
-- 降低部分英语单词在候选项的位置
|
-- 降低部分英语单词在候选项的位置
|
||||||
|
Loading…
x
Reference in New Issue
Block a user