librime-lua icon indicating copy to clipboard operation
librime-lua copied to clipboard

Extending RIME with Lua scripts

Results 138 librime-lua issues
Sort by recently updated
recently updated
newest added

https://github.com/rime/librime/tree/9086de3dd802d20f1366b3080c16e2eedede0584

add CommitHistoryReg CommitRecordReg **iter() 是有問題** 可否 加入 commit_history:iter() 能力有限 ,不會用c 做iter ```lua for i,v in next , env.engine.context.commit_history:to_table() do yield( Candidate( v.type, seg.start, seg._end, v.text, 'history') ) end

您好,我现在想写个插件,只让候选词中的一部分词能上屏,但我查看 API 似乎没有能自定义字符串上屏的功能?

链接: https://pan.baidu.com/s/1DFR6jd83ufj40BJqG-64Qw  提取码:8ajy 一 包含以下功能 1. 手工造词、删词、置顶候选(dict_proc + dict_filter) 1) 可以手工添加2-7字词组(不能带非汉字符号) 2) 可以删除系统自带词组,但不能删除单字 3) 可以置顶单字或词组,之前的首选词会变成次选 4) 操作实时生效,无须重新部署 5) 增删记录自动保存在新文件,后台不会修改系统原有固定词库 2. 候选只显示单字开关(需要自行增加option: single_char控制) 3. 候选字符集,只显示GB2312简体(6700字)或GBK全集(含繁体、生僻约2万字)  (通过默认option: extended_charset控制) wubi86自带字表有将近8万字,有做裁减 4. 调整候选顺序,单字=>二字=>三字以上(sort_filter,默认开启) 5....

目前版本已可以調用 parents methos processor 大部份都是調用 contex.composition()

想判断 librime-lua 版本,看是否支持某接口,做一些异常捕获。 现有方案好像是通过判断是否有 某方法 来判断版本: ```lua local function Version() local ver if Opencc and Opencc('s2t.json').convert_word then ----------- 构造 return 200 elseif rime_api.regex_match then return 197 elseif rime_api.get_distribution_name then return...

只要 產生實例後 memory 就會長大 Opencc('t2s.json') 擇一暫時停用 opencc ```lua -- rime.lua Opencc= nil -- 禁用 opencc -- bypass Opencc= function(fn) return { convert= function(self,text) return text end, convert_text = function(self,text) return...

查閱了 https://github.com/hchunhui/librime-lua/wiki/Scripting#candidate Candidate(简单的)候选词。 候選詞接口中沒有weight屬性,是否能增加這個接口? 我想通過詞庫的權重篩選詞,類似代碼如下: ``` local function filter(input) local l = {} for cand in input:iter() do if (cand.weight > 50000) then yield(cand) end end end return filter ```...

我在开发一个韩文输入法,目标是平常输入韩文的时候不显示menu (page_size = 0),menu只在反查汉字的时候显示。基于[PR135](https://github.com/hchunhui/librime-lua/pull/135),我写了一个简单版本的processor,当按下F10键时会改变朙月拼音的page_size。不过`env.engine.apply_schema`报错说attempt to call a nil value (field 'apply_schema'),`env.engine:apply_schema`也有类似报错。 报错message: ``` E0930 14:06:07.148494 44123520 lua_gears.cc:150] LuaProcessor::ProcessKeyEvent error(2): /Users/kevin/Library/Rime/lua/page_size_processor.lua:20: attempt to call a nil value (field 'apply_schema') ``` processor代码如下:...

As title, I want to add a feature, which can load config files from all lua files in a specified directory such as `$sharedir/lua.conf.d` and `$userdir/lua.conf.d`. It is helpful for...