Repository navigation
Expand file tree
/
Copy pathconfig_base.yaml
More file actions
486 lines (441 loc) · 23.8 KB
/
Copy pathconfig_base.yaml
File metadata and controls
486 lines (441 loc) · 23.8 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
switches_list:
- name: ascii_mode
reset: 0
states: [ 中, En ]
- name: full_shape
states: [ 半, 全 ] # 符号
- name: ascii_punct
states: [ 。,, ., ] # 中文标点,英文标点
- name: emoji
states: [ 💀, 😄 ]
- name: simplification
states: [ 简, 繁 ]
- name: charset_filter #自定义字集
states: [ 全集, 常用 ]
reset: 1
- name: prediction #输入候选预测
states: [ 关闭预测, 开启预测 ]
- name: pinyinhint # 拼音滤镜
states: [ 🔇, 🔊 ]
- name: unicode_comment # Unicode 区位提示
states: [ U关, U开 ]
- name: is_in_user_dict # 为输入过的内容加上标记
states: [ 🔕, 🔔 ]
switches_engine_script:
switches:
__include: switches_list
engine:
processors:
- lua_processor@*shortcut*processor # 快捷启动
- lua_processor@*select_character # 以词定字
- lua_processor@*moran_processor # Ctrl+l 快速取出/放回被吞掉的辅码,「;」次选跳过emoji
- lua_processor@*chinese_number*processor # 大写金额数字
- predictor # 输入候选预测
- ascii_composer # 处理英文模式及中英文切换
- recognizer # 与 matcher
- key_binder # 在特定条件下将按键绑定到其他按键,如重定义逗号、句号为候选翻页键
- speller # 把字母追加到编码串
- punctuator # 处理符号按键
- selector # 选字和换页功能
- navigator # 移动插入点
- express_editor # 空格确认当前输入,其他字符直接上屏
segmentors:
- ascii_segmentor
- matcher
- affix_segmentor@radical_lookup # 部件拆字自定义 tag
- affix_segmentor@stroke_lookup # 五笔画自定义 tag
- affix_segmentor@reverse_pinyin_lookup # 拼音单字自定义 tag
- affix_segmentor@tiger_lookup # 虎码自定义 tag
- abc_segmentor # 标记输入码的类型
- punct_segmentor # 割界,与前后方的其他编码区分开
- fallback_segmentor
translators:
- punct_translator # 转换标点符号
- reverse_lookup_translator # 默认反查
- script_translator # 码表转换
- table_translator@radical_lookup # 部件拆字反查
- table_translator@stroke_lookup # 五笔画反查
- table_translator@reverse_pinyin_lookup # 拼音单字反查
- table_translator@tiger_lookup # 虎码反查
- table_translator@quick_symbol_phrase # 快速符号短语词库
- history_translator@history # 重复上屏
- lua_translator@*calculator # /= 触发简易计算器
- lua_translator@*chinese_number*translator # /cn 触发大写金额数字
- lua_translator@*date_time # 日期输入 date, week, time, /wd, /wk, /wt 触发
- lua_translator@*chinese_lunar # 中国农历 /nl 触发显示
- lua_translator@*shortcut*translator # /jk, /kj 触发快捷命令
- lua_translator@*unicode # Unicode 输入
- lua_translator@*help_menu # /oh 触发进入帮助菜单
- predict_translator # 输入预测
- lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿
filters:
- lua_filter@*charset_filter@charset_filter # 自定义字集过滤lua;放在最上面完美解决简繁滤镜出错的问题
- reverse_lookup_filter@reverse_lookup_filter # 反查的filter
- simplifier@emoji # Emoji
- lua_filter@*reduce_emoji # 降低emoji在候选的位置
- simplifier@pinyinhint # 拼音滤镜
- simplifier@simplification # 简繁切换
- lua_filter@*autocap_filter # 英文自动大写
- lua_filter@*pin_cand_filter # 置顶候选项(顺序要求:置顶候选项 > Emoji > 简繁切换)
- lua_filter@*is_in_user_dict # 根据是否在用户词典,在 comment 上加上一个标记
- lua_filter@*en_spacer # 英文词条上屏自动空格
- lua_filter@*multiline_filter # 在词典里面候选支持\r, \r\n, \n, <br>分割分行。  表示空格
- lua_filter@*moran_charset_comment_filter # Unicode 區位提示
- uniquifier
switches_engine_table:
switches:
__include: switches_list
engine:
processors:
- lua_processor@*shortcut*processor # 快捷启动
- lua_processor@*select_character # 以词定字
- lua_processor@*moran_processor # Ctrl+l 快速取出/放回被吞掉的辅码,「;」次选跳过emoji
- lua_processor@*chinese_number*processor # 大写金额数字
- predictor # 输入候选预测
- ascii_composer # 处理英文模式及中英文切换
- recognizer # 与 matcher
- key_binder # 在特定条件下将按键绑定到其他按键,如重定义逗号、句号为候选翻页键
- speller # 把字母追加到编码串
- punctuator # 处理符号按键
- selector # 选字和换页功能
- navigator # 移动插入点
- express_editor # 空格确认当前输入,其他字符直接上屏
segmentors:
- ascii_segmentor
- matcher
- affix_segmentor@radical_lookup # 部件拆字自定义 tag
- affix_segmentor@stroke_lookup # 五笔画自定义 tag
- affix_segmentor@reverse_pinyin_lookup # 万象拼音自定义 tag
- affix_segmentor@tiger_lookup # 虎码自定义 tag
- abc_segmentor # 标记输入码的类型
- punct_segmentor # 割界,与前后方的其他编码区分开
- fallback_segmentor
translators:
- punct_translator # 转换标点符号
- reverse_lookup_translator # 默认反查
- table_translator # 码表转换
- table_translator@radical_lookup # 部件拆字反查
- table_translator@stroke_lookup # 五笔画反查
- table_translator@reverse_pinyin_lookup # 万象拼音反查
- table_translator@tiger_lookup # 虎码反查
- table_translator@quick_symbol_phrase # 快速符号短语词库
- history_translator@history # 重复上屏
- lua_translator@*calculator # /= 触发简易计算器
- lua_translator@*chinese_number*translator # /cn 触发大写金额数字
- lua_translator@*date_time # 日期输入 date, week, time, /wd, /wk, /wt 触发
- lua_translator@*chinese_lunar # 中国农历 /nl 触发显示
- lua_translator@*shortcut*translator # /jk, /kj 触发快捷命令
- lua_translator@*unicode # Unicode 输入
- lua_translator@*help_menu # /oh 触发进入帮助菜单
- predict_translator # 输入预测
- lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿
filters:
- lua_filter@*charset_filter@charset_filter # 自定义字集过滤lua;放在最上面完美解决简繁滤镜出错的问题
- reverse_lookup_filter@reverse_lookup_filter # 反查的filter
- simplifier@emoji # Emoji
- lua_filter@*reduce_emoji # 降低emoji在候选的位置
- simplifier@pinyinhint # 拼音滤镜
- simplifier@simplification # 简繁切换
- lua_filter@*autocap_filter # 英文自动大写
- lua_filter@*pin_cand_filter # 置顶候选项(顺序要求:置顶候选项 > Emoji > 简繁切换)
- lua_filter@*is_in_user_dict # 根据是否在用户词典,在 comment 上加上一个标记
- lua_filter@*en_spacer # 英文词条上屏自动空格
- lua_filter@*multiline_filter # 在词典里面候选支持\r, \r\n, \n, <br>分割分行。  表示空格
- lua_filter@*moran_charset_comment_filter # Unicode 區位提示
- uniquifier
opencc_config:
# Emoji
emoji:
option_name: emoji
opencc_config: emoji.json
tips: all # 转换提示: all 都显示 | char 仅单字显示 | none 不显示。
tags: [ abc, encode, punct ] # 设置其作用范围
inherit_comment: false # 在 corrector.lua 及反查中,emoji 返回空注释
# 简繁切换
simplification:
option_name: simplification
opencc_config: s2tw.json # s2t.json | s2hk.json | s2tw.json | s2twp.json
option_name: simplification
tips: all #简繁对照 转换提示: all 都显示 | char 仅单字显示 | none 不显示。
# 拼音滤镜
pinyinhint:
option_name: pinyinhint
opencc_config: moran_pinyinhint.json
show_in_comment: true # 是否仅将转换结果显示在备注中
tags: [ abc, encode, punct, reverse_lookup ] # 设置其作用范围
tips: char #如只想给单字加滤镜,可改为 char,全部为 all
comment_format:
# - 'xform/ / /'
# - "xform/^/ /"
reverse_config:
# 部件拆字反查
radical_lookup:
tag: radical_lookup
dictionary: radical_pinyin
enable_user_dict: false
enable_completion: true # 编码提示开关(提前显示尚未输入完整码的字)
prefix: "oiz" # 反查前缀
tips: "〔拆字〕"
comment_format:
- erase/^.*$//
# 五笔画反查
stroke_lookup:
tag: stroke_lookup
dictionary: stroke
enable_encoder: false # 是否启用 自动造词
enable_sentence: false # 是否启用造句模式
enable_user_dict: false
enable_completion: true # 编码提示开关(提前显示尚未输入完整码的字)
prefix: "obh" # 反查前缀
tips: "〔横h竖s撇p捺n折z〕"
preedit_format:
- xlit/hspnz/⼀⼁⼃⼂⼄/ # 康熙部首(橫豎撇點折)
# 拼音单字反查
reverse_pinyin_lookup:
tag: reverse_pinyin_lookup
dictionary: reverse_pinyin
enable_encoder: false # 是否启用 自动造词
enable_sentence: false # 是否启用造句模式
enable_user_dict: false
enable_completion: false # 编码提示开关(提前显示尚未输入完整码的字)
# prefix: "`"
tips: "〔反查〕"
comment_format:
- "xform/^/ /"
- xform/([nl])v/$1ü/
# 虎码反查
tiger_lookup:
tag: tiger_lookup
dictionary: tiger
enable_encoder: false # 是否启用 自动造词
enable_sentence: false # 是否启用造句模式
enable_user_dict: false
enable_completion: true # 编码提示开关(提前显示尚未输入完整码的字)
prefix: "ohm"
tips: "〔虎码〕"
comment_format:
- "xform/^/ /"
reverse_lookup_filter: #该反查过滤器名
tags: [radical_lookup,stroke_lookup,reverse_pinyin_lookup,tiger_lookup] #挂在这个tag所对应的翻译器上
overwrite_comment: true
dictionary: reverse_pinyin #反查所得词库
# comment_format:
# - xform/(\w\w);(\w\w);/$1[$2]/
# - xform/(\w\w);(\w\w),(\w\w);/$1[$2][$3]/
recognizer_config:
recognizer:
import_preset: default
patterns:
# punct: "^(/([0-9]0?|[A-Za-z]+))|(;[A-Za-z]+)$"
punct: '^/([0-9]0?|[A-Za-z]+)$' # 响应 symbols
# reverse_lookup: "^`[a-z]*'?$" # 响应反查
uppercase: "" #中文状态大写锁定直接上屏
email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$" # email @ 之后不上屏
url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$" # URL
calculator: "^(/=|cC)(.*)$" # 简易计算器
chinese_number: "^(/cn|cN)[0-9.]+$" # 中文大写数字(金额)
week: "^(/wk|week|oxq|owk)$" # 响应星期输入
time: "^(/wt|time|osj|owt)$" # 响应时间输入
date: "^(/wd|date|orq|owd)$" # 响应日期输入
timestamp: "^/uts$" # 时间戳
chinese_lunar: "^(/nl|nL)[0-9]*$" # 中国农历(可反查)
shortcuts_app: "^/jk[a-z]*$" # 快捷指令(启动应用)
shortcuts_cmd: "^/kj[a-z]*$" # 快捷指令(执行命令)
unicode: "^U[a-f0-9]+" # 脚本将自动获取第 2 个字符 U 作为触发前缀,响应 lua_translator@unicode,输出 Unicode 字符
help_menu: "^(/oh|oH)$" # 帮助菜单
radical_lookup: "^oiz[A-Za-z]*$" # 响应部件拆字的反查,与 radical_lookup/prefix 匹配
stroke_lookup: "^obh[A-Za-z]*$" # 响应五笔画的反查,与 stroke_lookup/prefix 匹配
reverse_pinyin_lookup: "(^(`[a-z`]+))|(^([a-z]{2}(`[a-z`]?|[a-z`]`))|^([a-z]{4}`))" # 响应 临时「`」统配反查
tiger_lookup: "^ohm[a-z]*'?$" # 响应虎码的反查,与 tiger_lookup/prefix 匹配
key_config:
options_toggle:
__append:
# emoji开关
- { when: always, accept: "Shift+space", toggle: emoji, }
# 切换中英标点
- { when: always, accept: "Control+period", toggle: ascii_punct, }
# 切换简繁
- { when: always, accept: "Control+Shift+4", toggle: simplification, }
# 切换简繁(Mac)
- { when: always, accept: "Control+Shift+dollar", toggle: simplification, }
# 切换全半角
- { when: always, accept: "Control+Shift+5", toggle: full_shape, }
# 切换全半角(Mac)
- { when: always, accept: "Control+Shift+percent", toggle: full_shape, }
# 显示拼音滤镜
- { when: has_menu, accept: "Control+comma", toggle: pinyinhint }
# 自定义字集开关
- { when: always, accept: "Control+Shift+Q", toggle: charset_filter }
# 拼音滤镜开关
- { when: always, accept: "Control+Shift+P", toggle: pinyin }
keys:
__append:
# 打字时,; 选中第2个候选字发送
- { accept: semicolon, send: 2, when: has_menu}
# 打字时,' 选中第3个候选字发送 (音码方案需要此键 分词,形码单独启用)
# - { accept: apostrophe, send: 3, when: has_menu}
# 打字时,[ 选中第4个候选字发送
- { accept: bracketleft, send: 4, when: has_menu}
# 打字时,] 选中第5个候选字发送
- { accept: bracketright, send: 5, when: has_menu}
# 打字时,\ 选中第6个候选字发送
- { accept: backslash, send: 6, when: has_menu}
# 打字时,Caps_Lock 选中第4个候选字发送
- { accept: Caps_Lock, send: 4, when: has_menu}
# 打字时,Caps_Lock 选中第4个候选字发送
- { accept: Release+Caps_Lock, send: Release+4, when: has_menu}
# 减号向前翻页
- { accept: minus, send: Page_Up, when: paging}
# 等于号向后翻页
- { accept: equal, send: Page_Down, when: has_menu}
# 删除用户自造词
- { when: composing, accept: "Control+k", send: Shift+Delete }
# 按词清码
- { when: composing, accept: "Control+w", send: Control+BackSpace }
# Option/Alt + ←/→ 切换光标至下/上一个拼音
- { when: composing, accept: Alt+Left, send: Shift+Left }
- { when: composing, accept: Alt+Right, send: Shift+Right }
# 将小键盘 0~9 . 映射到主键盘,数字金额大写的 Lua 如 R1234.5678 可使用小键盘输入
- {accept: KP_0, send: 0, when: composing}
- {accept: KP_1, send: 1, when: composing}
- {accept: KP_2, send: 2, when: composing}
- {accept: KP_3, send: 3, when: composing}
- {accept: KP_4, send: 4, when: composing}
- {accept: KP_5, send: 5, when: composing}
- {accept: KP_6, send: 6, when: composing}
- {accept: KP_7, send: 7, when: composing}
- {accept: KP_8, send: 8, when: composing}
- {accept: KP_9, send: 9, when: composing}
- {accept: KP_Decimal, send: period, when: composing}
- {accept: KP_Enter, send: Return, when: composing}
# 使用 tab 翻页
tab_Page:
__append:
# Tab 向后翻页
- { accept: Tab, send: Page_Down, when: has_menu}
# Shift+Tab 向前翻页
- { accept: Shift+Tab, send: Page_Up, when: paging}
# 使用 tab 在不同音节间跳转
tab跳转音节:
__append:
- { accept: Tab, send: Control+Right, when: has_menu }
- { accept: Tab, send: Control+Right, when: composing }
# 使用 tab 切换候选
tab_switch:
__append:
# 打字时,Tab 选中下一个候选
- { accept: Tab, send: Down, when: has_menu}
# 打字时,Shift+Tab 选中上一个候选
- { accept: Shift+Tab, send: Up, when: has_menu}
# 使用 「(」或「)」 在不同音节间跳转
数字9和0跳转音节:
__append:
- { when: has_menu, accept: 9, send: Control+Right }
- { when: composing, accept: 0, send: Control+Right }
数字9和0充当候选4&5:
__append:
# 打字时,9 选中第4个候选字发送
- { accept: 9, send: 4, when: has_menu}
# 打字时,0 选中第5个候选字发送
- { accept: 0, send: 5, when: has_menu}
# 使用大写字母追加输入到上一个音节末尾
capital_for_last_syllable:
__append:
- { when: has_menu, accept: Shift+A, send_sequence: "{Control+Left}a{Control+Right}" }
- { when: has_menu, accept: Shift+B, send_sequence: "{Control+Left}b{Control+Right}" }
- { when: has_menu, accept: Shift+C, send_sequence: "{Control+Left}c{Control+Right}" }
- { when: has_menu, accept: Shift+D, send_sequence: "{Control+Left}d{Control+Right}" }
- { when: has_menu, accept: Shift+E, send_sequence: "{Control+Left}e{Control+Right}" }
- { when: has_menu, accept: Shift+F, send_sequence: "{Control+Left}f{Control+Right}" }
- { when: has_menu, accept: Shift+G, send_sequence: "{Control+Left}g{Control+Right}" }
- { when: has_menu, accept: Shift+H, send_sequence: "{Control+Left}h{Control+Right}" }
- { when: has_menu, accept: Shift+I, send_sequence: "{Control+Left}i{Control+Right}" }
- { when: has_menu, accept: Shift+J, send_sequence: "{Control+Left}j{Control+Right}" }
- { when: has_menu, accept: Shift+K, send_sequence: "{Control+Left}k{Control+Right}" }
- { when: has_menu, accept: Shift+L, send_sequence: "{Control+Left}l{Control+Right}" }
- { when: has_menu, accept: Shift+M, send_sequence: "{Control+Left}m{Control+Right}" }
- { when: has_menu, accept: Shift+N, send_sequence: "{Control+Left}n{Control+Right}" }
- { when: has_menu, accept: Shift+O, send_sequence: "{Control+Left}o{Control+Right}" }
- { when: has_menu, accept: Shift+P, send_sequence: "{Control+Left}p{Control+Right}" }
- { when: has_menu, accept: Shift+Q, send_sequence: "{Control+Left}q{Control+Right}" }
- { when: has_menu, accept: Shift+R, send_sequence: "{Control+Left}r{Control+Right}" }
- { when: has_menu, accept: Shift+S, send_sequence: "{Control+Left}s{Control+Right}" }
- { when: has_menu, accept: Shift+T, send_sequence: "{Control+Left}t{Control+Right}" }
- { when: has_menu, accept: Shift+U, send_sequence: "{Control+Left}u{Control+Right}" }
- { when: has_menu, accept: Shift+V, send_sequence: "{Control+Left}v{Control+Right}" }
- { when: has_menu, accept: Shift+W, send_sequence: "{Control+Left}w{Control+Right}" }
- { when: has_menu, accept: Shift+X, send_sequence: "{Control+Left}x{Control+Right}" }
- { when: has_menu, accept: Shift+Y, send_sequence: "{Control+Left}y{Control+Right}" }
- { when: has_menu, accept: Shift+Z, send_sequence: "{Control+Left}z{Control+Right}" }
- { when: has_menu, accept: Shift+BackSpace, send_sequence: "{Control+Left}{BackSpace}{Control+Right}" }
Lua_config:
# 重复上屏
history:
input: ;d
size: 1 # 重复前几次上屏
initial_quality: 1 # 初始权重
# 输入候选预测
predictor:
db: predict.db
#每次最大预测候选
#默认为0,这意味着显示所有候选人
#您可以将其设置为与page_size相同,这样句点就不会触发下一页
max_candidates: 5
#最大连续预测次数
#默认为0,这意味着没有限制
max_iterations: 1
# 快速符号短语词库
quick_symbol_phrase:
dictionary: ""
user_dict: custom_phrase/quick_symbol_phrase # 自定义快符
db_class: stabledb
enable_completion: false # 补全提示
enable_sentence: false # 禁止造句
initial_quality: 1 # custom_phrase 的权重
# editor 用来定制操作键的行为,以下是默认行为 https://github.com/rime/librime/blob/master/src/rime/gear/editor.cc
editor:
bindings:
space: confirm # 空格键:上屏候选项
Return: commit_raw_input # 回车键:上屏原始输入
Control+Return: commit_script_text # Ctrl+回车键:上屏变换后输入(经过 preedit_format 转换的)
Control+Shift+Return: commit_comment # Ctrl+Shift+回车键:上屏 comment
BackSpace: revert # 退格键:向前删除(撤消上次输入)
Delete: delete # Delete 键:向后删除
Control+BackSpace: back_syllable # Ctrl+退格键:删除一个音节
Control+Delete: delete_candidate # Ctrl+Delete键:删除或降权候选项
Escape: cancel # Esc 键:取消输入
# Lua 配置: 自定义字集过滤 (影响范围)
charset_filter:
tags: [ abc, encode, punct, reverse_pinyin_lookup, reverse_lookup ]
# 「常用」字符集设置
# 不影响「全集」:全集仍显示*所有*字符
#
# both: 允许繁体和简体同时显示
# simp: 只显示简化字
# trad: 只显示繁体字
charset: simp # 或 simp, trad
# Lua 配置:Emoji 降频到第 idx 个位置
emoji_reduce:
idx: 6
octagram:
disable:
__patch:
grammar: {}
enable_for_sentence: # (整句输入模式)
__patch:
grammar:
language: zh-hans-t-essay-bgw # rime官方模型
collocation_max_length: 4 # 最大搭配长度
collocation_min_length: 3 # 最小搭配长度
enable_for_fixed: # (固定候选模式)
__patch:
grammar:
language: zh-hans-t-essay-bgc
collocation_max_length: 4
collocation_min_length: 2
# fixed/+:
# contextual_suggestions: true
# max_homographs: 7
# translator/+:
# contextual_suggestions: true
# max_homographs: 7