-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflypy_xhfast.schema.yaml
399 lines (371 loc) · 12 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
# Rime schema
# encoding: utf-8
schema:
schema_id: flypy_xhfast
name: 飞鹤快拼
version: "0.7"
author:
- boomker
description: |
小鹤双拼+辅助码
dependencies:
- melt_eng # 英文单词&词组 - 简明英汉词典(增强版)
- easy_en
- flypy_radical
- flypy_phrase # 中文词库 - 现代汉语词典 & 清华开源词库
# - emoji
# - stroke
switches:
- name: ascii_mode
states: [中文, 西文]
reset: 0
- name: ascii_punct
states: [。, .]
reset: 0
- name: emoji
states: [💀, 😄]
reset: 1
- name: full_shape
states: [半角, 全角]
reset: 0
- name: traditionalization
states: [简体, 繁体]
reset: 0
- name: charset_comment
states: [CC关, CC开]
reset: 0
- options: ["utf8", "gbk", "gb2312"] # 字符集选单
reset: 0 # 默认 UTF8
states:
- UTF-8
- GBK
- GB2312
engine:
processors:
- lua_processor@pin_word_processor
- lua_processor@launcher_processor
- lua_processor@pair_symbols_processor
- lua_processor@select_char_processor
- lua_processor@expand_idiom_abbr_processor
- lua_processor@cold_word_drop_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
- punct_segmentor
- affix_segmentor@mkst
- affix_segmentor@chinese_number
- affix_segmentor@easy_en_simp
- affix_segmentor@laTeX_formula
- affix_segmentor@dbpy_flypy_help
- affix_segmentor@radical_lookup
- fallback_segmentor
translators:
- punct_translator
- reverse_lookup_translator
- script_translator
# - table_translator@emojis
# - table_translator@flypy_phrase
- table_translator@mkst # 精准造词
- table_translator@custom_phrase
- table_translator@idiom_phrase
- table_translator@melt_eng
- table_translator@easy_en_simp # oy 触发单词输入
- table_translator@dbpy_flypy_help # oh 触发
- table_translator@radical_lookup # oq 触发
- lua_translator@commit_history_translator # hisz 触发
- lua_translator@datetime_translator # date, rq, week, time 触发
- lua_translator@launcher_translator # jj 快捷命令触发
- lua_translator@lunar_translator # cnl 触发
- lua_translator@laTex_translator # f/ 触发
- lua_translator@number_translator # n/ 触发
- lua_translator@en_custom_translator # `置于结尾处触发
- lua_translator@expand_idiom_abbr_translator # /置于结尾处触发
- lua_translator@engword_autocaps_translator # 大写字母开头触发
- lua_translator@word_autocommit_translator
filters:
- simplifier
- simplifier@emoji
- simplifier@traditionalize
- lua_filter@fly_fixed_filter
- lua_filter@pin_word_filter
- lua_filter@word_autocommit_filter
- lua_filter@engword_autocaps_filter
- lua_filter@word_append_space_filter
- lua_filter@emoji_reduce_filter
- lua_filter@long_word_up_filter
- lua_filter@cold_word_drop_filter
- lua_filter@charset_comment_filter
- reverse_lookup_filter@radical_reverse_lookup
- uniquifier # 只能放到最后!
speller:
alphabet: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA_[`/
initials: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
delimiter: " '"
# max_code_length: 8
# auto_select: true
# auto_select_pattern: '^\w+\[\w{2}$'
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/^(j)n/$1c/
- derive/^([jyn])t/$1d/ # t --> d
- derive/^([bjlmn])p/$1e/ # p --> e
- derive/^([djlnx])q/$1f/ # q --> f
- derive/^q([biklmnpsxy])/f$1/
- derive/^qt/fd/
- derive/^qu/fe/
- derive/^qr/fo/
- derive/^qq/fz/
- derive/^p([okifuhjbnmg])/e$1/
- derive/^pp/el/ # pp --> el
- derive/^dp/dl/ # dp --> dl
- derive/^([jkiu])y/$1w/ # [jkiu]y --> [jkiu]w
- derive/^y([ikb])/w$1/ # y[ikb] --> w[ikb]
- derive/^y([asderzc])/o$1/
- derive/^yu/ov/
- derive/^yy/ow/
- derive/^yh/wn/
- derive/^yj/wm/
- derive/^hy/hw/
- derive/^t([wy])/dw/ # t[wy] --> dw
- derive/^t([er])/df/ # t[er] --> df
- derive/^tk/rk/ # tk --> rk
- derive/^tg/rm/ # tg --> rm
- derive/^tp/rl/ # tp --> rl
- derive/^r([gv])/rb/ # r[gv] --> rb
- derive/^rf/rn/ # rf --> rn
- derive/^gf/gn/ # gf --> gn
- derive/^gr/gm/ # gr --> gm
- derive/^g([wy])/gi/
- derive/^xp/sl/
- derive/^xt/sb/
- derive/^xy/xo/
- derive/^xs/xh/
- derive/^nj/xj/
- derive/^nh/xh/
- derive/^nu/nx/
- derive/^no/nr/
- derive/^ly/nw/
- derive/^lm/nz/
- derive/^jm/jz/
- derive/^jx/ja/
- derive/^jb/jo/
- derive/^z([ws])/zk/
- derive/^za/zl/
- derive/^ze/zn/
- derive/^zr/zm/
- derive/^vr/vm/ # vr --> vm
- derive/^vf/vn/ # vf --> vn
- derive/^vg/vk/
- derive/^mb/ms/
- derive/^mh/mx/
- derive/^mk/me/
- derive/^mo/mr/
- derive/^mu/mv/
- derive/^b([hju])/a$1/
- derive/^b([fgknm])/s$1/
grammar:
language: zh-hans-t-essay-bgw
translator:
dictionary: flypy_xhfast
enable_user_dict: true
encode_commit_history: true # 上屏历史记录
contextual_suggestions: true # 开启八股文, 上下文联想
sentence_over_completion: true
# enable_encoder: true
# contextual_suggestions: true
# max_homophones: 7
initial_quality: 1.3
spelling_hints: 1 # `0`: 关闭单字编码提示
comment_format:
- xform/^\w+[[](\w+)$/~$1/ ## 单字编码提示只显示辅助码部分
- xform/^~\w+\s.*$// ## 单字编码提示只显示辅助码部分
# - xform/^\w+[[](\w+)\s\w+[[](\w+)$/~$2/ ## 单字编码提示只显示辅助码部分
# - xform/^\w+\s.*$// ## 单字编码提示只显示辅助码部分
mkst:
__include: /translator # 复用上面的翻译器,日志中带有 warning
enable_sentence: true
tips: "〔精准造词〕"
tag: mkst
custom_phrase: # 自定义短语, 包含固顶字词
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 9
idiom_phrase: # 成语, 俗语缩写, 实现简拼
dictionary: ""
user_dict: idiom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 0.8
melt_eng: # 英文单词
enable_encoder: false
encode_commit_history: false
enable_sentence: false
enable_completion: true # 是否启用英文输入联想补全
enable_user_dict: false
dictionary: melt_eng
initial_quality: 1.1
flypy_phrase:
enable_encoder: false
encode_commit_history: false
enable_sentence: false
enable_user_dict: false
enable_completion: true
dictionary: flypy_phrase
initial_quality: -1
punctuator:
import_preset: symbols
full_shape:
__include: default:/punctuator/full_shape # 从 default.yaml 导入配置
half_shape:
",": {commit: ","}
".": {commit: "。"}
";": {commit: ";"}
'"': {pair: ['‘', '’']} ## 添加注释后:恢复默认引号
"'": {pair: ['“', '”']} ## 添加注释后:恢复默认引号
"#": "#"
"=": "="
"<": [《, "<", ‹, 〈, «, ⟨, ˂, ˱]
">": [》, ">", ›, 〉, », ⟩, ˃, ˲]
"/": ["/", /, ÷]
'\': [、, '\', \]
"|": [·, ・, "|", |, "§", "¦", "‖", ︴]
"`": ["`", "```", ‵, ‶, ‷, ′, ″, ‴, ⁗]
"~": ["~", ~, ˜, ˷, ⸯ, ≈, ≋, ≃, ≅, ≇, ∽, ⋍, ≌, ﹏, ﹋, ﹌, ︴]
"%": ["%", %, "°", "℃", ‰, ‱, ℉, ℅, ℆, ℀, ℁, ⅍]
# '^': [^, ……]
# "$": [¥, "$", "€", "£", "¥", "¢", "¤", ₩]
"$": "¥"
"*": ["*", *, ·, ・, ×, ※, ❂, ⁂, ☮, ☯, ☣]
"(": [(, '(']
")": [), ')']
"[": [「, 【, 〔, [, 〚, 〘]
"]": [」, 】, 〕, ], 〛, 〙]
"{": [『, 〖, {]
"}": [』, 〗, }]
symbols:
__include: symbols.custom:/symbols
## 制表符
"/zb": [┌, └, ┐, ┘, ─, │, ├, ┤, ┬, ┴, ┼, ┏, ┗, ┓, ┛, ━, ┃, ┣, ┫, ┳, ┻, ╋]
key_binder:
import_preset: default
bindings:
- {when: has_menu, accept: Control+0, toggle: traditionalization}
- {when: has_menu, accept: Control+period, toggle: ascii_punct}
- {when: has_menu, accept: Control+slash, toggle: emoji}
- {when: composing, accept: Control+o, send: Shift+Left}
- {when: composing, accept: Control+i, send: Shift+Right}
- {when: composing, accept: Control+w, send: Control+BackSpace}
# - { when: composing, accept: Control+m, send: Return }
# - { when: always, accept: Control+1, send_sequence: 'HelloWorld' }
recognizer:
# import_preset: default
patterns:
punct: "^/([0-9]0?|[A-Za-z]+)$"
chinese_number: "^n/[0-9.]+$"
mkst: "^[a-z]+[[][a-z[[]]*$" # `[` 引导 精准造词
radical_lookup: "^oq[a-z]+'?$" # 部件拆字, 部件使用小鹤双拼编码
dbpy_flypy_help: "^oh.*$"
easy_en_simp: "^oy[a-z]*$"
laTeX_formula: "^f/(.*)$"
# emojis: "^of[a-z]*'?$"
menu:
page_size: 5
traditionalize:
option_name: traditionalization
opencc_config: s2t.json
tips: none
excluded_types: [radical_lookup]
emoji:
opencc_config: emoji.json
option_name: emoji
tag: emoji
excluded_types: [radical_lookup]
# emojis:
# tag: emojis
# dictionary: emoji
# enable_completion: true
# prefix: "of"
# suffix: "'"
# tips: " Emoji"
chinese_number:
tag: chinese_number
# prefix: "n/"
tips: " 中文数字简繁大小写 "
dbpy_flypy_help:
dictionary: ""
user_dict: dbpy_flypy_help
tag: dbpy_flypy_help
prefix: "oh"
tips: "小鹤双拼查键"
db_class: stabledb
enable_completion: true
enable_sentence: false
initial_quality: 1
easy_en_simp:
tag: easy_en_simp
dictionary: easy_en
enable_completion: true
enable_sentence: false
enable_user_dict: false
prefix: "oy"
suffix: "'"
tips: "英文单词(可去元音)"
spelling_hints: 9
comment_format:
- xform/^.+$//
radical_reverse_lookup:
tag: radical_reverse_lookup
overwrite_comment: false
# dictionary: flypy_xhfast
dictionary: kMandarin
comment_format:
- xform/^/~/
# - xform/$/)/
radical_lookup:
tag: radical_lookup
dictionary: flypy_radical
enable_sentence: false
enable_user_dict: false
enable_completion: true
tips: 〔部件组字〕
prefix: 'oq'
suffix: "'"
comment_format:
- erase/^.*$//
preedit_format:
# - xlit/hspnz/一丨丿丶乙/
laTeX_formula:
tag: LaTeX_Formula
prefix: "f/"
tips: " TeX 公式"
history: # 上屏历史记录
tag: history
history_num_max: 30
size: 30
input: "hisz"
initial_quality: 1000
excluded_type: "punct"