-
Notifications
You must be signed in to change notification settings - Fork 21
/
flypy_xhfast.schema.yaml
326 lines (301 loc) · 10.8 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
# Rime schema
# encoding: utf-8
# 方案说明
schema:
schema_id: flypy_xhfast
name: 飞鹤快拼
version: "2024.05.16"
author:
- boomker
description: |
小鹤双拼+辅助码
github.com:boomker/rime-fast-xhup
dependencies:
- melt_eng # 英文单词&词组 - 简明英汉词典(增强版)
- easy_en
- ecdict_reverse
- flypy_radical
- flypy_phrase # 中文词库 - 现代汉语词典 & 清华开源词库
# 选项开关
switches:
- name: ascii_mode
states: [中, E]
- name: ascii_punct
states: [。, .]
- name: full_shape
states: [半角, 全角]
- name: simplification
states: [ 简, 繁 ]
reset: 0
# 输入引擎
engine:
processors:
- lua_processor@pin_word_processor
- lua_processor@launcher_processor
- lua_processor@select_char_processor
- lua_processor@flypy_switch_processor
- lua_processor@pair_symbols_processor
- lua_processor@idiom_expand_processor
- lua_processor@cold_word_drop_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@flypy_key_help # /ok 触发进入双拼键位帮助
- table_translator@easy_en # /oe 触发进入英文输入模式
- lua_translator@pin_word_translator # 自定义置顶词
- lua_translator@flypy_help_translator # /oh 触发进入帮助菜单
- lua_translator@flypy_switch_translator # /so 触发进入选项切换菜单
- 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@history_translator # /hs 触发显示上屏历史
- 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@long_word_up_filter
- lua_filter@emoji_reduce_filter
- lua_filter@cold_word_drop_filter
- lua_filter@word_autocommit_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: # 自定义短语, 包含固顶字
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
comment_mark: " 📌"
enable_completion: false
enable_sentence: false
initial_quality: 99
# 成语短语
idiom_phrase: # 成语, 俗语缩写, 实现简拼
dictionary: ""
user_dict: idiom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 0.8
# 自动上屏短语
flypy_phrase: # 自动上屏短语
dictionary: flypy_phrase
auto_commit: false # 词条自动上屏开关
enable_encoder: false
enable_sentence: false
enable_completion: true
enable_user_dict: false
encode_commit_history: false
initial_quality: -1
# 键位帮助
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
# Emoji
emoji: # Emoji转换
option_name: emoji
opencc_config: emoji.json
tag: emoji
tips: all
tags: [ abc ]
inherit_comment: false
traditionalize: # 简体转繁体
option_name: simplification
opencc_config: s2t.json # s2t.json | s2hk.json | s2tw.json | s2twp.json
tips: none # 转换提示: all 都显示 | char 仅单字显示 | none 不显示。
tags: [abc] # 限制在对应 tag,不对其他如反查的内容做简繁转换
# 部件拆字反查
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:
make_sentence: "^[a-z]+[`][a-z`]*$" # ` 引导精准造词
punct: "^(/([0-9]0?|[A-Za-z]+))|(;[A-Za-z]+)$"
url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$"
# 标点符号
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: ";"}
"<": [《, "<", ‹, 〈, «, ⟨, ˂, ˱]
">": [》, ">", ›, 〉, », ⟩, ˃, ˲]
"/": ["/", /, ÷]
'\': [、, '\', \]
"|": ["|", ·, ・, |, "§", "¦", "‖", ︴]
"`": ["`", "```", ‵, ‶, ‷, ′, ″, ‴, ⁗]
"~": ["~", ~, ˜, ˷, ⸯ, ≈, ≋, ≃, ≅, ≇, ∽, ⋍, ≌, ﹏, ﹋, ﹌, ︴]
"%": ["%", %, "°", "℃", ‰, ‱, ℉, ℅, ℆, ℀, ℁, ⅍]
"$": [¥, "$", "€", "£", "¥", "¢", "¤", ₩]
"*": ["*", *, ·, ・, ×, ※, ❂, ⁂, ☮, ☯, ☣]
"(": ["(", (]
")": [")", )]
"[": ['[',「, 【, 〔, [, 〚, 〘]
"]": [']', 」, 】, 〕, ], 〛, 〙]
"{": [『, 〖, {]
"}": [』, 〗, }]
"#": "#"
"=": "="
symbols:
__include: symbols.custom:/symbols
# 从 default 继承快捷键
key_binder:
bindings:
# - { when: always, accept: Control+1, send_sequence: 'HelloWorld' }
- { when: composing, accept: Tab, send: Shift+Right }
- { when: composing, accept: Shift+Tab, send: Shift+Left }
- { when: composing, accept: Control+e, send: End }
- { when: composing, accept: Control+m, send: Return }
- { when: composing, accept: Control+k, send: Shift+Delete }
- { when: composing, accept: Control+w, send: Control+BackSpace }
- { when: has_menu, accept: Control+period, toggle: ascii_punct }
# 拼写设定
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/^(\w+)\[(\w)(\w)$/$1`$2$3/ # Flypy: AB`CD
- derive/^(\w+)\[(\w)(\w)$/$1`$2/ # Flypy: AB`C
# 超级简拼, 开启后可能性能不佳, 视情况开启
# 输入3个及以上编码字符, 按下`Ctrl+0`展开超级简拼
- abbrev/^(.).+$/$1/
# 左右并击飞键音码规则, 注释以下三行使用原版小鹤双拼
__patch:
algebra/+:
__include: flypy_chord_rule:/patch/speller/algebra