fix(lua): corrector.lua now clears specific cand.comment
This commit is contained in:
parent
dc4f52d4d0
commit
62f3e107a0
@ -161,6 +161,9 @@ translator:
|
||||
spelling_hints: 8 # corrector.lua :为了让错音错字提示的 Lua 同时适配全拼双拼,将拼音显示在 comment 中
|
||||
always_show_comments: true # corrector.lua :Rime 默认在 preedit 等于 comment 时取消显示 comment,这里强制一直显示,供 corrector.lua 做判断用。
|
||||
initial_quality: 1.2 # 拼音的权重应该比英文大
|
||||
comment_format: # 标记拼音注释,供 corrector.lua 做判断用
|
||||
- xform/^/[/
|
||||
- xform/$/]/
|
||||
preedit_format: # preedit_format 影响到输入框的显示和“Shift+回车”上屏的字符
|
||||
- xform/([bpmnljqxy])n/$1in/
|
||||
- xform/(\w)g/$1eng/
|
||||
|
@ -161,6 +161,9 @@ translator:
|
||||
spelling_hints: 8 # corrector.lua :为了让错音错字提示的 Lua 同时适配全拼双拼,将拼音显示在 comment 中
|
||||
always_show_comments: true # corrector.lua :Rime 默认在 preedit 等于 comment 时取消显示 comment,这里强制一直显示,供 corrector.lua 做判断用。
|
||||
initial_quality: 1.2 # 拼音的权重应该比英文大
|
||||
comment_format: # 标记拼音注释,供 corrector.lua 做判断用
|
||||
- xform/^/[/
|
||||
- xform/$/]/
|
||||
preedit_format: # preedit_format 影响到输入框的显示和“Shift+回车”上屏的字符
|
||||
- xform/o(\w)/0$1/
|
||||
- xform/(\w)q/$1ei/
|
||||
|
@ -161,6 +161,9 @@ translator:
|
||||
spelling_hints: 8 # corrector.lua :为了让错音错字提示的 Lua 同时适配全拼双拼,将拼音显示在 comment 中
|
||||
always_show_comments: true # corrector.lua :Rime 默认在 preedit 等于 comment 时取消显示 comment,这里强制一直显示,供 corrector.lua 做判断用。
|
||||
initial_quality: 1.2 # 拼音的权重应该比英文大
|
||||
comment_format: # 标记拼音注释,供 corrector.lua 做判断用
|
||||
- xform/^/[/
|
||||
- xform/$/]/
|
||||
preedit_format: # preedit_format 影响到输入框的显示和“Shift+回车”上屏的字符
|
||||
- xform/([bpmfdtnljqx])n/$1iao/
|
||||
- xform/(\w)g/$1eng/
|
||||
|
@ -161,6 +161,9 @@ translator:
|
||||
spelling_hints: 8 # corrector.lua :为了让错音错字提示的 Lua 同时适配全拼双拼,将拼音显示在 comment 中
|
||||
always_show_comments: true # corrector.lua :Rime 默认在 preedit 等于 comment 时取消显示 comment,这里强制一直显示,供 corrector.lua 做判断用。
|
||||
initial_quality: 1.2 # 拼音的权重应该比英文大
|
||||
comment_format: # 标记拼音注释,供 corrector.lua 做判断用
|
||||
- xform/^/[/
|
||||
- xform/$/]/
|
||||
preedit_format: # preedit_format 影响到输入框的显示和“Shift+回车”上屏的字符
|
||||
- xform/([aoe])(\w)/0$2/
|
||||
- xform/([bpmnljqxy])n/$1in/
|
||||
|
@ -161,6 +161,9 @@ translator:
|
||||
spelling_hints: 8 # corrector.lua :为了让错音错字提示的 Lua 同时适配全拼双拼,将拼音显示在 comment 中
|
||||
always_show_comments: true # corrector.lua :Rime 默认在 preedit 等于 comment 时取消显示 comment,这里强制一直显示,供 corrector.lua 做判断用。
|
||||
initial_quality: 1.2 # 拼音的权重应该比英文大
|
||||
comment_format: # 标记拼音注释,供 corrector.lua 做判断用
|
||||
- xform/^/[/
|
||||
- xform/$/]/
|
||||
preedit_format: # preedit_format 影响到输入框的显示和“Shift+回车”上屏的字符
|
||||
- xform/([aoe])(\w)/0$2/
|
||||
- xform/([bpmnljqxy])n/$1in/
|
||||
|
@ -161,6 +161,9 @@ translator:
|
||||
spelling_hints: 8 # corrector.lua :为了让错音错字提示的 Lua 同时适配全拼双拼,将拼音显示在 comment 中
|
||||
always_show_comments: true # corrector.lua :Rime 默认在 preedit 等于 comment 时取消显示 comment,这里强制一直显示,供 corrector.lua 做判断用。
|
||||
initial_quality: 1.2 # 拼音的权重应该比英文大
|
||||
comment_format: # 标记拼音注释,供 corrector.lua 做判断用
|
||||
- xform/^/[/
|
||||
- xform/$/]/
|
||||
preedit_format: # preedit_format 影响到输入框的显示和“Shift+回车”上屏的字符
|
||||
- xform/o(\w)/0$1/ # 零聲母先改爲0,以方便後面的轉換
|
||||
- xform/([jqxy])n/$1ue/ # 提前轉換雙拼碼 n 和 g,因爲轉換後的拼音裏就快要出現這兩個字母了,那時將難以分辨出雙拼碼
|
||||
|
@ -113,11 +113,14 @@ end
|
||||
function M.func(input)
|
||||
for cand in input:iter() do
|
||||
-- cand.comment 是目前输入的词汇的完整拼音
|
||||
local c = M.corrections[cand.comment]
|
||||
if c and cand.text == c.text then
|
||||
cand:get_genuine().comment = string.gsub(M.style, "{comment}", c.comment)
|
||||
elseif cand.type == "user_phrase" or cand.type == "phrase" or cand.type == "sentence" then
|
||||
cand:get_genuine().comment = ""
|
||||
local pinyin = cand.comment:match("^[(.-)]$")
|
||||
if pinyin and #pinyin > 0 then
|
||||
local c = M.corrections[pinyin]
|
||||
if c and cand.text == c.text then
|
||||
cand:get_genuine().comment = string.gsub(M.style, "{comment}", c.comment)
|
||||
else
|
||||
cand:get_genuine().comment = ""
|
||||
end
|
||||
end
|
||||
yield(cand)
|
||||
end
|
||||
|
@ -293,6 +293,9 @@ translator:
|
||||
spelling_hints: 8 # corrector.lua :为了让错音错字提示的 Lua 同时适配全拼双拼,将拼音显示在 comment 中
|
||||
always_show_comments: true # corrector.lua :Rime 默认在 preedit 等于 comment 时取消显示 comment,这里强制一直显示,供 corrector.lua 做判断用。
|
||||
initial_quality: 1.2 # 拼音的权重应该比英文大
|
||||
comment_format: # 标记拼音注释,供 corrector.lua 做判断用
|
||||
- xform/^/[/
|
||||
- xform/$/]/
|
||||
preedit_format: # preedit_format 影响到输入框的显示和“Shift+回车”上屏的字符
|
||||
- xform/([jqxy])v/$1u/ # 显示为 ju qu xu yu
|
||||
# - xform/([nl])v/$1ü/ # 显示为 nü lü
|
||||
|
Loading…
Reference in New Issue
Block a user