-
Notifications
You must be signed in to change notification settings - Fork 14
/
flypy_xhfast.schema.yaml
419 lines (386 loc) · 14.5 KB
/
flypy_xhfast.schema.yaml
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
# Rime schema
# encoding: utf-8
# 方案说明
schema:
schema_id: flypy_xhfast
name: 飞鹤快拼
version: "2024.05.05"
author:
- boomker
description: |
小鹤双拼+辅助码
github.com:boomker/rime-fast-xhup
dependencies:
- melt_eng # 英文单词&词组 - 简明英汉词典(增强版)
- easy_en
- ecdict_reverse
- flypy_radical
- flypy_phrase # 中文词库 - 现代汉语词典 & 清华开源词库
# - stroke
# 候选菜单
menu:
page_size: 9 # 候选词个数
# 选项开关
switches:
- name: ascii_mode
states: [中, E]
- name: ascii_punct
states: [。, .]
- name: emoji
states: [🈚️, 😄]
reset: 1
- name: full_shape
states: [半角, 全角]
- name: simplification
states: [ 简, 繁 ]
- name: extended_charset
states: [通用, 增廣]
reset: 1
- name: charset_comment
states: [码区提示关, 码区提示开]
reset: 0
# 输入引擎
engine:
processors:
- lua_processor@pin_word_processor
- lua_processor@launcher_processor
- lua_processor@pair_symbols_processor
- lua_processor@select_char_processor
- lua_processor@idiom_expand_processor
# - lua_processor@easy_en_processor
- lua_processor@cold_word_drop_processor
- lua_processor@flypy_switcher_processor
- lua_processor@word_append_space_processor
- lua_processor@word_autocommit_processor
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- affix_segmentor@easy_en
- affix_segmentor@make_sentence
- affix_segmentor@laTeX_formula
- affix_segmentor@radical_lookup
- affix_segmentor@chinese_number
- affix_segmentor@flypy_key_help
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- reverse_lookup_translator
- table_translator@idiom_phrase
- table_translator@custom_phrase
- table_translator@melt_eng
- table_translator@make_sentence # ` 精准造词
- table_translator@radical_lookup # ~ 触发进入部件组字模式
- table_translator@easy_en # /oe 触发进入英文输入模式
- table_translator@flypy_key_help # /ok 触发进入双拼键位帮助
- lua_translator@pin_word_translator # 自定义置顶词
- lua_translator@flypy_help_translator # /oh 触发进入帮助菜单
- lua_translator@lunar_translator # /nl 触发显示农历
- lua_translator@datetime_translator # date, week, time, /wd, /wk, /wt 触发
- lua_translator@launcher_translator # /jj, /fj 触发快捷命令(可改触发前缀)
- lua_translator@laTex_translator # /lt 触发 LaTeX 输入
- lua_translator@number_translator # /cn 触发繁体大写金额数字
- lua_translator@commit_history_translator # /hs 触发显示上屏历史
- lua_translator@idiom_expand_translator # /,0 置于输入码末尾触发简拼展开
# - lua_translator@easy_en_translator # / 置于输入码末尾触发英文展开
- lua_translator@word_custom_translator # ] 置于输入码末尾触发自定义单词入库
- lua_translator@word_autocaps_translator # A-Z 大写字母开头触发单词自动大写
- lua_translator@word_autocommit_translator # [ 单字全码和部分成语短语自动触发
- script_translator
filters:
- reverse_lookup_filter@radical_reverse_lookup
- reverse_lookup_filter@ecdict_reverse_lookup # 反查英文单词/词组的中文释义
- simplifier@emoji
- simplifier@traditionalize # 简繁切换
- lua_filter@fly_fixed_filter
- lua_filter@easy_en_filter
- lua_filter@charset_filter
- lua_filter@charset_comment_filter
- lua_filter@word_autocaps_filter
- lua_filter@emoji_reduce_filter
# - lua_filter@cn_space_en_filter
- lua_filter@cold_word_drop_filter
- lua_filter@word_autocommit_filter
- lua_filter@long_word_up_filter
- lua_filter@pin_word_filter
- lua_filter@launcher_filter
- uniquifier # 只能放到最后!
# 八股文
grammar:
language: zh-hans-t-essay-bgw
# 主翻译器, 小鹤双拼
translator:
dictionary: flypy_xhfast
spelling_hints: 1 # `0`: 关闭单字编码提示
initial_quality: 1.3
enable_user_dict: true
encode_commit_history: true # 上屏历史记录
contextual_suggestions: true # 开启八股文, 上下文联想
sentence_over_completion: true
# always_show_comments: true
# enable_encoder: true
# max_homophones: 7
comment_format:
- xform/^\w+[[](\w+)$/~$1/ ## 单字编码提示只显示辅助码部分
- xform/^~\w+\s.*$// ## 单字编码提示只显示辅助码部分
# "`" 精准造词
make_sentence: # 精准造词
__include: /translator # 复用上面的翻译器, 日志 warning 可忽略
enable_sentence: true
prefix: "`"
tips: "〔精准造词〕"
tag: make_sentence
# 次翻译器,英文
melt_eng: # 英文输入
dictionary: melt_eng
enable_encoder: false
enable_sentence: false
enable_user_dict: false
enable_completion: true # 是否启用英文输入联想补全
encode_commit_history: false
initial_quality: 1.1
comment_format:
- xform/.*// # 清空提示码
# 自定义短语: custom_phrase.txt
custom_phrase: # 自定义短语, 包含固顶字
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
comment_mark: " 📌"
enable_completion: false
enable_sentence: false
initial_quality: 99
# 成语短语:idiom_phrase.txt
idiom_phrase: # 成语, 俗语缩写, 实现简拼
dictionary: ""
user_dict: idiom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 0.8
flypy_key_help: # 小鹤双拼键位帮助
tag: flypy_key_help
dictionary: ""
user_dict: flypy_keymap
prefix: "/ok"
tips: "小鹤双拼查键"
db_class: stabledb
enable_completion: true
enable_sentence: false
initial_quality: 1
# 自动上屏短语
flypy_phrase: # 自动上屏短语
dictionary: flypy_phrase
enable_encoder: false
enable_sentence: false
enable_completion: true
enable_user_dict: false
encode_commit_history: false
initial_quality: -1
# Emoji
emoji:
option_name: emoji
opencc_config: emoji.json
tag: emoji
tips: all
tags: [ abc ]
inherit_comment: false
traditionalize: # 繁体转简体
option_name: simplification
opencc_config: t2s.json # s2t.json | s2hk.json | s2tw.json | s2twp.json
tips: none # 转换提示: all 都显示 | char 仅单字显示 | none 不显示。
tags: [abc] # 限制在对应 tag,不对其他如反查的内容做简繁转换
history: # 上屏历史记录
tips: "上屏历史"
tag: history
prefix: "/hs"
size: 30
history_num_max: 30
initial_quality: 1000
excluded_types: ["punct"]
pin_word: # 词条置顶配置
pin_word_key: "Control+t" # 词条置顶快捷键, 优先级高于`key_binder`全局配置
word_quality: 1000
comment_mark: " 🔝" # 不能留空
excluded_types: ["flypy_key_help", "easy_en", "radical_lookup"]
word_auto_commit: # 词条自动上屏
enable: false
long_word_up: # 长词升频到第 idx 个位置
idx: 3
excluded_codes: ["date", "rq", "week", "time", "lunar"]
cold_wold_reduce: # 生僻词条降频到第 idx 个位置
idx: 4
excluded_types: ["easy_en"]
emoji_reduce:
# Emoji 降频到第 idx 个位置
idx: 6
# 标点符号
punctuator:
import_preset: symbols
full_shape:
__include: default:/punctuator/full_shape # 从 default.yaml 导入配置
half_shape:
# __include: default:/punctuator/half_shape # 从 default.yaml 导入配置
",": {commit: ","}
".": {commit: "。"}
# ";": {commit: ";"} ## 取消注释后, 下行添加注释, 以恢复默认分号
";": [";", ";"]
'"': {pair: ['‘', '’']} ## 添加注释后:恢复默认引号
"'": {pair: ['“', '”']} ## 添加注释后:恢复默认引号
"<": [《, "<", ‹, 〈, «, ⟨, ˂, ˱]
">": [》, ">", ›, 〉, », ⟩, ˃, ˲]
"/": ["/", /, ÷]
'\': [、, '\', \]
"|": ["|", ·, ・, |, "§", "¦", "‖", ︴]
"`": ["`", "```", ‵, ‶, ‷, ′, ″, ‴, ⁗]
"~": ["~", ~, ˜, ˷, ⸯ, ≈, ≋, ≃, ≅, ≇, ∽, ⋍, ≌, ﹏, ﹋, ﹌, ︴]
"%": ["%", %, "°", "℃", ‰, ‱, ℉, ℅, ℆, ℀, ℁, ⅍]
"$": [¥, "$", "€", "£", "¥", "¢", "¤", ₩]
"*": ["*", *, ·, ・, ×, ※, ❂, ⁂, ☮, ☯, ☣]
"(": [(, "("]
")": [), ")"]
"[": ['[',「, 【, 〔, [, 〚, 〘]
"]": [']', 」, 】, 〕, ], 〛, 〙]
"{": [『, 〖, {]
"}": [』, 〗, }]
"#": "#"
"=": "="
# "@": "@"
symbols:
__include: symbols.custom:/symbols
# 部件拆字反查
radical_lookup:
tag: radical_lookup
dictionary: flypy_radical
enable_sentence: false
enable_user_dict: false
# enable_completion: true
prefix: "~"
suffix: "'"
tips: 〔部件组字〕
comment_format:
- erase/^.*$//
# 部件拆字滤镜
radical_reverse_lookup:
tags: [abc, radical_lookup]
overwrite_comment: false
dictionary: kMandarin
comment_format:
- xform/^(\w+)[[].*$/$1/
- xform/^/~/
#英文输入方案
easy_en:
tag: easy_en
dictionary: easy_en
enable_user_dict: true
enable_completion: true
enable_sentence: false
prefix: "/oe"
suffix: "'"
tips: "英文输入"
#英文反查释意
ecdict_reverse_lookup:
tags: [easy_en]
overwrite_comment: true # 是否开启中文释意注解
dictionary: ecdict_reverse
comment_format:
- xform/\\n/ | /
- xform/^/ /
- erase/^.$/
# 处理符合特定规则的输入码,如网址、反查
recognizer:
import_preset: default
patterns:
week: "^/wk$"
time: "^/wt$"
date: "^(/wd|/rq)$"
chinese_lunar: "^/nl$"
history: "^/hs$"
shortcuts: "^/fj$"
laTeX_formula: "^/lt(.*)$"
easy_en: "^/oe[a-zA-Z]*$"
flypy_help: "^/(oh|help)$"
flypy_key_help: "^/ok[a-z]*$"
chinese_number: "^/cn[0-9.]*$"
radical_lookup: "~[a-z]+$" # ~ 引导部件拆字, 使用小鹤双拼编码
make_sentence: "^[a-z]+[`][a-z`]*$" # ` 引导精准造词
punct: "^(/([0-9]0?|[A-Za-z]+))|(;[A-Za-z]+)$"
url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$"
# 从 default 继承快捷键
key_binder:
import_preset: default # 从 default.yaml 继承通用的
# search: "`" # 辅码引导符
select_first_character: "minus"
select_last_character: "equal"
pin_cand: "Control+t" # 候选词置顶
drop_cand: "Control+d" # 强制删词, 无视输入的编码
hide_cand: "Control+x" # 匹配当前输入码后隐藏指定的候选字词
turn_down_cand: "Control+j" # 匹配当前输入码后降频指定的候选字词
switch_comment: "Control+n" # 切换注释(小鹤形码 / 带调拼音 / 无)
commit_comment: "Control+p" # 注释上屏
switch_english: "Control+g" # 切换到英文输入方案
bindings:
- { when: has_menu, accept: semicolon, send: 2 }
- { when: has_menu, accept: apostrophe, send: 3 } ## 单引号用于第3候选
- { when: paging, accept: comma, send: Page_Up } ## 逗号返回上一页
- { when: has_menu, accept: period, send: Page_Down }
- { when: composing, accept: Control+e, send: End }
- { when: composing, accept: Control+k, send: Shift+Delete }
- { when: composing, accept: Control+i, send: Shift+Left }
- { when: composing, accept: Control+o, send: Shift+Right }
- { when: composing, accept: Tab, send: Shift+Right }
- { when: composing, accept: Control+m, send: Return }
- { when: composing, accept: Control+w, send: Control+BackSpace }
- { when: has_menu, accept: Control+0, toggle: simplification }
- { when: has_menu, accept: Control+period, toggle: ascii_punct }
- { when: has_menu, accept: Control+Shift+slash, toggle: emoji }
- { when: has_menu, accept: Control+Shift+apostrophe, toggle: charset_comment }
- { when: composing, accept: grave, send: "`" }
# `键 (grave, Tab 上面那个) 为词组逐字追加辅助码.
# - { when: always, accept: Control+1, send_sequence: 'HelloWorld' }
# 拼写设定
speller:
# 如果不想让什么标点直接上屏, 可以加在 alphabet, 或者编辑标点符号为两个及以上的映射
alphabet: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA[_/]
# initials 定义仅作为始码的按键,排除 ` 让单个的 ` 可以直接上屏
initials: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
delimiter: " '"
algebra:
- erase/^ng\[kk$/ # 取消「唔 ng」的独占
- erase/^ng\[kx$/ # 取消「嗯 ng」的独占
- erase/^n\[\w+$/ # 取消「嗯 n」的独占
- erase/^m\[\w+$/ # 取消「呒 m」的独占
- erase/^m\[\w+$/ # 取消「呣 m」的独占
## 字库编码到输入码的转换规则
- derive/^(\w+)\[(\w)(\w)$/$1\[$2$3/ # Flypy: AB[CD
- derive/^(\w+)\[(\w)(\w)$/$1\[$2/ # Flypy: AB[C
- derive/^(\w+)\[(\w)(\w)$/$1/ # Flypy: AB
# - derive/[[]// # 取消注释, 直接辅码, 无论有无 [ 均可引导
# 响应 ` 造词
- derive/^(\w+)\[(\w)(\w)$/$1`$2$3/ # Flypy: AB`CD
- derive/^(\w+)\[(\w)(\w)$/$1`$2/ # Flypy: AB`C
## 模糊音:
- derive/^([jqxy])v/$1u/
- derive/^([jqxy])u/$1v/
- derive/^(u)([h])/s$2/ # uh => sh
- derive/^(z)([^acdefghijklmnsu])/v$2/ # z => zh
- derive/^(c)([^acdefghijklmsuo])/i$2/ # c => ch
- derive/^(s)([^abcdefghijklmnu])/u$2/ # s => sh
- derive/^(i)g/$1f/ # [zcs][h]eng => [zcs][h]en
- derive/^([ypdbn])b/$1k/ # in => ing
# 超级简拼, 开启后可能性能不佳, 视情况开启
# 输入4个或更多以下字符,按下`0`触发超级简拼
- abbrev/^(.).+$/$1/
# 左右并击飞键音码规则, 注释以下三行使用原版小鹤双拼
__patch:
algebra/+:
__include: flypy_chord_rule:/patch/speller/algebra