Skip to content

Commit 78ddf01

Browse files
committed
万象更新
1 parent 4822bff commit 78ddf01

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lua/demote_derive.lua

+12-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
--万象为了降低1位辅助码权重保证分词,提升2位辅助码权重为了4码高效,但是有些时候单字超越了词组,如自然码中:jmma 睑 剑麻,于是调序 剑麻 睑
33
--abbrev下根据辅助码提权匹配编码的单字
44
local M = {}
5+
56
function M.run_fuzhu(cand, env, initial_comment)
67
local patterns = {
78
tone = "([^;]*);",
@@ -90,7 +91,17 @@ function M.func(input, env)
9091

9192
for _, cand in ipairs(single_char_cands) do
9293
local comment = get_comment(cand, env) -- **调用 `M.run_fuzhu()` 解析辅助码**
93-
if comment == last_two_chars then
94+
95+
-- **使用 `,` 逗号分割辅助码,并检查是否有一个片段匹配**
96+
local matched = false
97+
for segment in comment:gmatch("[^,]+") do
98+
if segment == last_two_chars then
99+
matched = true
100+
break
101+
end
102+
end
103+
104+
if matched then
94105
moved_single = cand -- 记录这个单字
95106
else
96107
table.insert(reordered_singles, cand)

0 commit comments

Comments
 (0)