fix: 修复句中反查对双拼编码的提取策略

This commit is contained in:
amzxyz
2026-01-04 20:29:50 +08:00
parent 1696a6375f
commit fcf4bef63b
2 changed files with 9 additions and 4 deletions

View File

@@ -66,7 +66,7 @@ function AP.init(env)
end
-- 英文enuser不受 add_* 开关影响,始终尝试启用)
env.en_memory = Memory(env.engine, env.engine.schema, "wanxiang_mixedcode")
env.en_memory = Memory(env.engine, env.engine.schema, "wanxiang_english")
-- 只要有一边需要,就挂上 commit/delete 通知
if env.en_memory or env.memory then

View File

@@ -74,12 +74,17 @@ local function expand_code_variant(main_projection, xlit_projection, part)
end
-- 3. 遍历所有种子(原始编码 + 缩写编码),统一进行规则投影
for _, code in ipairs(seeds) do
-- 应用 main_projection (非大写)
-- A. 应用 main_projection
if main_projection then
local p = main_projection:apply(code, true)
if p and #p > 0 then add(p) end
if p and #p > 0 then
add(p)
if #p == 4 then
add(p:sub(1,1) .. p:sub(3,3))
end
end
end
-- 应用 xlit_projection (大写笔画,不参与前面重复计算)
-- B. 应用 xlit_projection
if code:match('^%u+$') and xlit_projection then
local xlit_result = xlit_projection:apply(code, true)
if xlit_result and #xlit_result > 0 then add(xlit_result) end