2023-05-08 10:42:21 +02:00
|
|
|
|
-- Rime Lua 扩展 https://github.com/hchunhui/librime-lua
|
|
|
|
|
-- 文档 https://github.com/hchunhui/librime-lua/wiki/Scripting
|
|
|
|
|
|
2023-08-06 12:37:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- processors:
|
2023-05-16 16:21:36 +02:00
|
|
|
|
|
2023-06-07 11:47:19 +02:00
|
|
|
|
-- 以词定字,可在 default.yaml key_binder 下配置快捷键,默认为左右中括号 [ ]
|
2023-05-08 10:42:21 +02:00
|
|
|
|
select_character = require("select_character")
|
2023-05-16 16:21:36 +02:00
|
|
|
|
|
2023-08-06 12:37:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- translators:
|
|
|
|
|
|
2023-06-07 11:47:19 +02:00
|
|
|
|
-- 日期时间,可在方案中配置触发关键字。
|
2023-05-08 10:42:21 +02:00
|
|
|
|
date_translator = require("date_translator")
|
2023-05-16 16:21:36 +02:00
|
|
|
|
|
|
|
|
|
-- Unicode,U 开头
|
2023-05-08 10:42:21 +02:00
|
|
|
|
unicode = require("unicode")
|
2023-05-16 16:21:36 +02:00
|
|
|
|
|
|
|
|
|
-- 数字、人民币大写,R 开头
|
|
|
|
|
number_translator = require("number_translator")
|
|
|
|
|
|
2023-08-06 12:37:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- filters:
|
|
|
|
|
|
|
|
|
|
-- 错音错字提示
|
|
|
|
|
corrector = require("corrector")
|
|
|
|
|
|
|
|
|
|
-- v 模式 symbols 优先(全拼)
|
|
|
|
|
v_filter = require("v_filter")
|
|
|
|
|
|
2023-05-30 16:06:38 +02:00
|
|
|
|
-- 自动大写英文词汇
|
|
|
|
|
autocap_filter = require("autocap_filter")
|
2023-05-21 04:59:21 +02:00
|
|
|
|
|
2023-06-07 11:47:19 +02:00
|
|
|
|
-- 降低部分英语单词在候选项的位置,可在方案中配置要降低的单词
|
|
|
|
|
reduce_english_filter = require("reduce_english_filter")
|
|
|
|
|
|
2023-05-21 04:59:21 +02:00
|
|
|
|
|
2023-08-06 12:37:28 +02:00
|
|
|
|
|
|
|
|
|
|
2023-05-21 04:59:21 +02:00
|
|
|
|
-- 默认未启用:
|
|
|
|
|
|
2023-06-29 14:25:04 +02:00
|
|
|
|
-- 长词优先(全拼)
|
|
|
|
|
-- 在 engine/filters 增加 - lua_filter@long_word_filter
|
2023-08-06 12:37:28 +02:00
|
|
|
|
-- 在方案里写配置项:
|
2023-06-29 14:25:04 +02:00
|
|
|
|
-- 提升 count 个词语,插入到第 idx 个位置。
|
|
|
|
|
-- 示例:将 2 个词插入到第 4、5 个候选项,输入 jie 得到「1接 2解 3姐 4饥饿 5极恶」
|
|
|
|
|
-- long_word_filter:
|
|
|
|
|
-- count: 2
|
|
|
|
|
-- idx: 4
|
|
|
|
|
long_word_filter = require("long_word_filter")
|
|
|
|
|
|
2023-06-07 11:47:19 +02:00
|
|
|
|
-- 中英混输词条自动空格
|
|
|
|
|
-- 在 engine/filters 增加 - lua_filter@cn_en_spacer
|
|
|
|
|
cn_en_spacer = require("cn_en_spacer")
|
|
|
|
|
|
2023-09-28 17:51:24 +02:00
|
|
|
|
-- 英文词条上屏自动空格
|
|
|
|
|
-- 在 engine/filters 增加 - lua_filter@en_spacer
|
|
|
|
|
en_spacer = require("en_spacer")
|
|
|
|
|
|
2023-09-28 18:21:41 +02:00
|
|
|
|
-- 九宫格,将输入框的数字转为对应的拼音或英文,iRime 用,Hamster 不需要。
|
2023-05-21 04:59:21 +02:00
|
|
|
|
-- 在 engine/filters 增加 - lua_filter@t9_preedit
|
2023-05-16 16:21:36 +02:00
|
|
|
|
t9_preedit = require("t9_preedit")
|
|
|
|
|
|
2023-08-06 12:37:28 +02:00
|
|
|
|
-- 根据是否在用户词典,在 comment 上加上一个星号 *
|
2023-05-21 04:59:21 +02:00
|
|
|
|
-- 在 engine/filters 增加 - lua_filter@is_in_user_dict
|
|
|
|
|
-- 在方案里写配置项:
|
|
|
|
|
-- is_in_user_dict: true 为输入过的内容加星号
|
|
|
|
|
-- is_in_user_dict: flase 为未输入过的内容加星号
|
2023-05-08 10:42:21 +02:00
|
|
|
|
is_in_user_dict = require("is_in_user_dict")
|
2023-05-16 16:21:36 +02:00
|
|
|
|
|
2023-05-21 04:59:21 +02:00
|
|
|
|
-- 词条隐藏、降频
|
|
|
|
|
-- 在 engine/processors 增加 - lua_processor@cold_word_drop_processor
|
|
|
|
|
-- 在 engine/filters 增加 - lua_filter@cold_word_drop_filter
|
|
|
|
|
-- 在 key_binder 增加快捷键:
|
|
|
|
|
-- turn_down_cand: "Control+j" # 匹配当前输入码后隐藏指定的候选字词 或候选词条放到第四候选位置
|
|
|
|
|
-- drop_cand: "Control+d" # 强制删词, 无视输入的编码
|
2023-05-08 10:42:21 +02:00
|
|
|
|
cold_word_drop_processor = require("cold_word_drop.processor")
|
|
|
|
|
cold_word_drop_filter = require("cold_word_drop.filter")
|