-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrime.lua
29 lines (28 loc) · 914 Bytes
/
rime.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- v0.1.0.0
number_translator = require("number")
custom_commit_text_translator = require("custom")
-- piau_im_translator = require("piau_im")
-- function get_date(input, seg, env)
-- --- 以 show_date 爲開關名或 key_binder 中 toggle 的對象
-- on = env.engine.context:get_option("show_date")
-- if on and input == "date" then
-- --- Candidate(type, start, end, text, comment)
-- yield(Candidate("date", seg.start, seg._end, os.date("%Y年%m月%d日"), " 日期"))
-- end
-- end
---
-- function single_char_first(input, env)
-- --- 以 single_char 爲開關名或 key_binder 中 toggle 的對象
-- on = env.engine.context:get_option("single_char")
-- local cache = {}
-- for cand in input:iter() do
-- if not on or utf8.len(cand.text) == 1 then
-- yield(cand)
-- else
-- table.insert(cache, cand)
-- end
-- end
-- for i, cand in ipairs(cache) do
-- yield(cand)
-- end
-- end