-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用更多rime-melt的lua? #101
Comments
#35 可以增加英文造词了 |
你用的方案,全拼就是 |
谢谢,刚发了消息我自己就找到了 |
Lua重构了以后,custom_en这个function建议放在哪个lua文件里? |
和以前其实差不多。
|
按照你说得,不工作啊。新建了一个custom_en.lua文件,然后在rime_ice.schema.yaml里加上了- lua_translator@*custom_en |
小狼毫更新一下 librime #133 |
大佬,你有试验过重构后这个方法工作吗?我现在又改回去了 |
试了,可以。 local function custom_en(input, seg, env)
if (string.sub(input, -1) == "_") then
local inpu = string.gsub(input, "[_]+$", "")
if (string.len(inpu) > 1 and string.sub(input, 1, 1) ~= "_") then
if (string.sub(input, -2) == "__") then
path = "/Users/dvel/Library/Rime/en_dicts/custom_en.dict.yaml"
local file = io.open(path, "a")
file:write("\n" .. inpu .. "\t" .. inpu)
file:close()
yield(Candidate("pin", seg.start, seg._end, inpu, " 已保存"))
else
yield(Candidate("pin", seg.start, seg._end, inpu, " -保存"))
end
end
end
end
return custom_en
2023-05-05-000429.mp4 |
咋这么奇怪啊,我的设置跟你的一模一样。但当我输入“aa”,然后(Shift + 一个减号)就直接上屏了,变成“啊啊——” 是不是还有那个地方没设置? |
得让下划线不上屏,不然怎么用下划线。 patch:
recognizer/patterns/+:
underscore: "^[A-Za-z]+_.*" |
我把default.yaml 里解开 underscore: "^[A-Za-z]+_.*" 的注释。就能工作了 但我看了之前的配置,以前的default.yaml 里下划线也是被注释掉的,我也没有搞过default.custom.yaml,奇怪了。我再研究研究,但谢谢,已经工作了 |
找到原因了,在之前的版本里,在rime_ice.schema.yaml里面是把下划线解开的。新版本里没有了 |
https://github.com/tumuyan/rime-melt/blob/master/lua/melt.lua
The text was updated successfully, but these errors were encountered: