mirror of
https://github.com/d0zingcat/rime-ice.git
synced 2026-05-13 23:16:54 +00:00
refactor: Lua 模块化
删除 `rime.lua`,拆分到 `lua/` 文件夹内。 方案中的 `- lua_xxx@xxx` 修改为 `- lua_xxx@*xxx`(加一个星号)。
This commit is contained in:
15
lua/t9_preedit.lua
Normal file
15
lua/t9_preedit.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
-- 九宫格专用
|
||||
-- 拼写规则通过 xlit 转写: xlit/abcdefghijklmnopqrstuvwxyz/22233344455566677778889999/
|
||||
-- 然后通过此 Lua 将输入框的数字转为对应的拼音或英文
|
||||
local function t9_preedit(input, env)
|
||||
for cand in input:iter() do
|
||||
if (string.find(cand.text, "%w+") ~= nil) then
|
||||
cand:get_genuine().preedit = cand.text
|
||||
else
|
||||
cand:get_genuine().preedit = cand.comment
|
||||
end
|
||||
yield(cand)
|
||||
end
|
||||
end
|
||||
|
||||
return t9_preedit
|
||||
Reference in New Issue
Block a user