parent
4ffe642c9b
commit
6f28f3dbb8
@ -7,19 +7,18 @@ local M = {}
|
|||||||
function M.init(env)
|
function M.init(env)
|
||||||
local config = env.engine.schema.config
|
local config = env.engine.schema.config
|
||||||
env.name_space = env.name_space:gsub('^*', '')
|
env.name_space = env.name_space:gsub('^*', '')
|
||||||
M.is_in_user_dict = config:get_bool(env.name_space)
|
M.is_in_user_dict = config:get_bool(env.name_space) or nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.func(input, env)
|
local is_user = {
|
||||||
|
user_table = true,
|
||||||
|
user_phrase = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
function M.func(input)
|
||||||
for cand in input:iter() do
|
for cand in input:iter() do
|
||||||
if M.is_in_user_dict then
|
if is_user[cand.type] == M.is_in_user_dict then
|
||||||
if cand.type == "user_phrase" then
|
cand.comment = cand.comment .. '*'
|
||||||
cand.comment = cand.comment .. '*'
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if cand.type ~= "user_phrase" then
|
|
||||||
cand.comment = cand.comment .. '*'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
yield(cand)
|
yield(cand)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user