forked from gaboolic/rime-shuangpin-fuzhuma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
moqi_xh.schema.yaml
executable file
·467 lines (424 loc) · 15 KB
/
moqi_xh.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
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
# Rime schema
# encoding: utf-8
# https://github.com/gaboolic/rime-shuangpin-fuzhuma
schema:
schema_id: moqi_xh
name: 墨奇音形+鹤拼
version: "2024-05-11"
author:
- gaboolic
description: |
墨奇音形 https://github.com/gaboolic/rime-shuangpin-fuzhuma/wiki/%E5%A2%A8%E5%A5%87%E7%A0%81%E6%8B%86%E5%88%86%E8%A7%84%E5%88%99
dependencies:
- reverse_moqima
- radical_flypy
- stroke
- zrlf
- emoji
- easy_en
- jp_sela
switches:
- name: ascii_mode
reset: 0 #新对话默认状态,0为中文,1为英文
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: traditionalization
states: [ 简, 繁 ]
- name: emoji
states: [ 💀, 😄 ]
- name: chaifen
states: [ 不拆, 扌斥 ]
- name: mars
reset: 0
states: [ 地, 煋 ] #火星文
- name: ascii_punct
states: [ 。,, ., ]
engine:
processors:
- ascii_composer
- recognizer
- lua_processor@*sbxlm.key_binder # 绑定按键
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- affix_segmentor@emojis
- affix_segmentor@verbatim ## not as the last of this list
- affix_segmentor@easy_en_simp
- affix_segmentor@jp_sela
- fallback_segmentor
translators:
- punct_translator
- table_translator@custom_phrase
- table_translator@custom_phrase_kf
- table_translator@custom_phrase_mqzg
- table_translator@custom_phrase_super_2jian
- table_translator@custom_phrase_super_3jian
- table_translator@custom_phrase_super_3jian_no_conflict
- reverse_lookup_translator
- reverse_lookup_translator@reverse_moqima
- reverse_lookup_translator@reverse_chaizi
- reverse_lookup_translator@reverse_stroke
- reverse_lookup_translator@reverse_zrlf
- reverse_lookup_translator@reverse_cj
- script_translator
- lua_translator@date_translator # 时间、日期、星期
- lua_translator@lunar # 农历
- table_translator@emojis ## 添加注释后:停用ae模式emoji输入
- table_translator@easy_en_simp ## 添加注释后:停用单词输入
- table_translator@jp_sela ## 添加注释后:停用日语输入
- lua_translator@unicode # Unicode
- lua_translator@number_translator # 数字、金额大写
- lua_translator@calc_translator # 计算器
filters:
- lua_filter@long_word_filter # 长词优先(顺序要求:长词优先 > Emoji)
- simplifier@emoji # Emoji
# - lua_filter@reduce_emoji_filter # 按需启用,作用是降低Emoji在候选项中的位置排序(顺序要求:Emoji > 降低排序)
- simplifier@chaifen
- simplifier@chaifen_all
- simplifier@chinese_english
- simplifier@traditionalize # 简繁切换
- simplifier@mars #火星文
- uniquifier
# 计算器触发关键字
calc_translator:
trigger: V
# Lua 配置: 日期、时间、星期、ISO 8601、时间戳的触发关键字
date_translator:
date: date # 日期: 2022-11-29
time: time # 时间: 18:13
week: week # 星期: 星期二
datetime: datetime # ISO 8601: 2022-11-29T18:13:11+08:00
timestamp: timestamp # 时间戳: 1669716794
# Lua 配置:农历的触发关键字
lunar: anl # 农历: 二〇二三年冬月二十 癸卯年(兔)冬月二十
# Lua 配置:长词优先
# 提升 count 个词语,插入到第 idx 个位置。
# 示例:将 2 个词插入到第 1 个候选项,输入 总算 得到「1总算 2纵」
long_word_filter:
count: 2
idx: 1
speller:
# 如果不想让什么标点直接上屏,可以加在 alphabet,或者编辑标点符号为两个及以上的映射
alphabet: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA[/|
# initials 定义仅作为始码的按键,排除 ` 让单个的 ` 可以直接上屏
initials: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
# 第一位<空格>是拼音之间的分隔符;第二位<'>表示可以手动输入单引号来分割拼音。
delimiter: " '"
## speller 未允许 aj 表示 an
algebra:
# - xform/^([aoe])$/$1$1/
# - xform/^(ang)$/ah/
# - xform/^([^\[]*)iu$/$1Q/
# - xform/^([^\[]*)ei$/$1W/
# - xform/uan$/R/
# - xform/^([^\[]*)[uv]e$/$1T/
# - xform/^([^\[]*)un$/$1Y/
# - xform/^sh([^\[]+)/U$1/
# - xform/^ch([^\[]+)/I$1/
# - xform/^zh([^\[]+)/V$1/
# - xform/^([^\[]*)uo$/$1O/
# - xform/^([^\[]*)ie$/$1P/
# - xform/i?ong$/S/
# - xform/ing$|uai$/K/
# - xform/^([^\[]+)ai$/$1D/
# - xform/^([^\[]+)en$/$1F/
# - xform/^([^\[]+)eng$/$1G/
# - xform/[iu]ang$/L/
# - xform/(.)ang$/$1H/
# - xform/^([^\[]*)ian$/$1M/
# - xform/^([^\[]+)an$/$1J/
# - xform/^([^\[]+)ou$/$1Z/
# - xform/^([^\[]*)[iu]a$/$1X/
# - xform/^([^\[]*)iao$/$1N/
# - xform/^([^\[]+)ao$/$1C/
# - xform/^([^\[]*)ui$/$1V/
# - xform/^([^\[]*)in$/$1B/
# - xlit/QWRTYUIOPSDFGHJKLZXCVBNM/qwrtyuiopsdfghjklzxcvbnm/
# 模糊音 可选择性开启
# - derive/^z([a-z])/v$1/
# - derive/^c([a-z])/i$1/
# - derive/^s([a-z])/u$1/
# - derive/^v([a-z])/z$1/
# - derive/^i([a-z])/c$1/
# - derive/^u([a-z])/s$1/
# - derive/^([jqxy])u/$1v/ # 开启jv=ju的模式
- derive/^(..)[[].+$/$1/ # 纯双拼的情况
- derive/^(..[[].).+$/$1/ # 双拼+一位辅助码的情况
- derive|^(.+)[[](\w)(\w)$|$1$2$3o| # 整句模式下,输入syffo 出单字 增强单字性能
- derive|^(.+)[[](\w)(\w)$|$1$2$3/| # 整句模式下,输入syff/ 出单字 增强单字性能
- derive/[[]//
## 飞键 可选择性开启
# - derive/^([yh])j/$1q/
# - derive/^qx/qw/
# - derive/^jn/jv/
# - derive/^mn/mv/
# - derive/^jm/jz/
# - derive/^([y])h/$1g/
# - derive/^([rgv])f/$1m/
# - derive/^([rgv])c/$1n/
translator:
dictionary: moqi.extended
enable_completion: false
## 默认为不超过 2 个字的候选项显示输入码;将 2 改为 0 可关闭编码提示,
## 改为 1 则是只显示单字的输入码,依此类推。
spelling_hints: 1
comment_format:
- "xform/(^|[ '])[^[]+[[]/$1/" ## 编码提示只显示辅助码部分
enable_user_dict: false # 是否开启自动调频
preedit_format:
# 复制用户输入, 一份转大写保持原样, 一份由正则转为全拼显示
# - xform/(^.*$)/\U$1\E\t => $1 <=/
# # 小鹤双拼转全拼, 忽略辅码
# - xform/([ '][aoe])(\w)\w{0,2}/$1$2/
# - xform/([ ']\w)([aeiou])\w{0,2}/$1$2/
# - xform/([ '][bpmfdtnljqx])n\w{0,2}/$1iao/
# - xform/([ ']\w)g\w{0,2}/$1eng/
# - xform/([ ']\w)q\w{0,2}/$1iu/
# - xform/([ ']\w)w\w{0,2}/$1ei/
# - xform/([ '][dtnlgkhjqxyvuirzcs])r\w{0,2}/$1uan/
# - xform/([ ']\w)t\w{0,2}/$1ve/
# - xform/([ ']\w)y\w{0,2}/$1un/
# - xform/([ '][dtnlgkhvuirzcs])o\w{0,2}/$1uo/
# - xform/([ ']\w)p\w{0,2}/$1ie/
# - xform/([ '][jqx])s\w{0,2}/$1iong/
# - xform/([ ']\w)s\w{0,2}/$1ong/
# - xform/([ ']\w)d\w{0,2}/$1ai/
# - xform/([ ']\w)f\w{0,2}/$1en/
# - xform/([ ']\w)h\w{0,2}/$1ang/
# - xform/([ ']\w)j\w{0,2}/$1an/
# - xform/([ '][gkhvuirzcs])k\w{0,2}/$1uai/
# - xform/([ ']\w)k\w{0,2}/$1ing/
# - xform/([ '][jqxnl])l\w{0,2}/$1iang/
# - xform/([ ']\w)l\w{0,2}/$1uang/
# - xform/([ ']\w)z\w{0,2}/$1ou/
# - xform/([ '][gkhvuirzcs])x\w{0,2}/$1ua/
# - xform/([ ']\w)x\w{0,2}/$1ia/
# - xform/([ ']\w)c\w{0,2}/$1ao/
# - xform/([ '][dtgkhvuirzcs])v\w{0,2}/$1ui/
# - xform/([ ']\w)b\w{0,2}/$1in/
# - xform/([ ']\w)m\w{0,2}/$1ian/
# - "xform/(^|[ '])v/$1zh/"
# - "xform/(^|[ '])i/$1ch/"
# - "xform/(^|[ '])u/$1sh/"
# - xform/([ '][jqxy])v\w{0,2}/$1u/
# - xform/([ '][nl])v\w{0,2}/$1ü/
# # 双拼编码大写转回小写
# - xform/(^[^a-z=<>]*)/\L$1\E/
# - xform/=> */[/
# - xform/ *<=/]/
custom_phrase:
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 1
# 无冲突的3简
custom_phrase_super_3jian_no_conflict:
dictionary: ""
user_dict: custom_phrase_super_3jian_no_conflict
db_class: stabledb
enable_sentence: false
enable_completion: false
initial_quality: -1 #本表词和系统词重码居后
custom_phrase_kf:
dictionary: ""
user_dict: custom_phrase_kf
db_class: stabledb
enable_sentence: false
enable_completion: false
initial_quality: -1 #本表词和系统词重码居后
custom_phrase_mqzg:
dictionary: ""
user_dict: custom_phrase_mqzg
db_class: stabledb
enable_sentence: false
enable_completion: false
initial_quality: -1 #本表词和系统词重码居后
custom_phrase_super_2jian:
dictionary: ""
user_dict: custom_phrase_super_2jian
db_class: stabledb
enable_sentence: false
enable_completion: false
initial_quality: -1 #本表词和系统词重码居后
custom_phrase_super_3jian:
dictionary: ""
user_dict: custom_phrase_super_3jian
db_class: stabledb
enable_sentence: false
enable_completion: false
initial_quality: -1 #本表词和系统词重码居后
reverse_moqima:
tag: reverse_moqima
dictionary: reverse_moqima
enable_completion: true
prefix: "amq"
suffix: "'"
tips: 〔墨奇反查〕
preedit_format:
# - xlit/hspnz/一丨丿丶乙/
reverse_chaizi:
tag: reverse_chaizi
dictionary: radical_flypy # https://github.com/mirtlecn/rime-radical-pinyin
enable_completion: true
prefix: "az"
suffix: "'"
tips: 〔部件组字〕
preedit_format:
# - xlit/hspnz/一丨丿丶乙/
reverse_zrlf:
tag: reverse_zrlf
dictionary: zrlf
enable_completion: true
prefix: "alf"
suffix: "'"
tips: 〔自然兩分〕
preedit_format:
# - xlit/hspnz/一丨丿丶乙/
reverse_cj:
tag: reverse_cj
dictionary: cangjie5
enable_completion: true
prefix: "acj"
suffix: "'"
tips: 〔仓颉〕
preedit_format:
- xform/^acj/仓颉5:/
- xlit|abcdefghijklmnopqrstuvwxyz|日月金木水火土竹戈十大中一弓人心手口尸廿山女田難卜符|
reverse_stroke:
tag: reverse_stroke
dictionary: stroke # stroke
enable_completion: true
prefix: "ab"
suffix: "'"
tips: 〔筆畫hspnz〕 # 〔筆畫〕
preedit_format:
- xlit/hspnz/一丨丿丶乙/
# 显示墨奇码拆分
chaifen:
option_name: chaifen
opencc_config: moqi_chaifen.json
tips: char
show_in_comment: true
comment_format:
- "xform/ / /"
chaifen_all:
option_name: chaifen_all
opencc_config: moqi_chaifen_all.json
tips: char
show_in_comment: true
comment_format:
- "xform/ / /"
#中文转英文
chinese_english:
option_name: chinese_english
opencc_config: chinese_english.json
tips: char
comment_format:
- "xform/-/ /"
# Emoji
emoji:
option_name: emoji
opencc_config: emoji.json
inherit_comment: false # 在 corrector.lua 及反查中,emoji 返回空注释
# 简繁切换
traditionalize:
option_name: traditionalization
opencc_config: s2t.json # s2t.json | s2hk.json | s2tw.json | s2twp.json
tips: none # 转换提示: all 都显示 | char 仅单字显示 | none 不显示。
tags: [ abc, number, gregorian_to_lunar ] # 限制在对应 tag,不对其他如反查的内容做简繁转换
# 火星文切换
mars:
opencc_config: martian.json
option_name: mars
# 标点符号
# punctuator 下面有三个子项:
# full_shape 全角标点映射
# half_shape 半角标点映射
# symbols Rime 的预设配置是以 '/' 前缀开头输出一系列字符,自定义的 symbols_caps_v.yaml 修改成了 '/' 开头。
punctuator:
full_shape:
__include: default:/punctuator/full_shape # 从 default.yaml 导入配置
half_shape:
__include: default:/punctuator/half_shape # 从 default.yaml 导入配置
symbols:
__include: symbols_caps_v:/symbols # 从 symbols_caps_v.yaml 导入配置
key_binder:
import_preset: default
bindings:
#- { when: composing, accept: Tab, send: '[' } ## 取消注释后:tab引导辅助码
- { when: composing, accept: Control+m, send: Return }
- { when: composing, accept: Control+w, send: Control+BackSpace }
- { when: has_menu, accept: semicolon, send: 2 }
# - { when: has_menu, accept: slash, send: 3 } # 用/进行选3
- { when: composing, accept: Control+i, send: Shift+Right }
- { when: composing, accept: Control+o, send: Shift+Left }
# 显示墨奇码拆分的快速开关
- { when: has_menu, accept: "Control+p", toggle: chaifen }
- { when: has_menu, accept: "Control+l", toggle: chaifen_all }
- { when: has_menu, accept: "Control+e", toggle: chinese_english }
- { match: "[a-z]{2,3}", accept: Tab, send_sequence: "|1" }
# - { when: composing, match: "[a-z]{2}", accept: Tab, send: '|' }
## 对以下4行取消注释后:启用光标回退至特定音节后、补充辅助码的功能
## (自然码等其他双拼用户请在 pinyin_switch.yaml 中设置)
#- { when: composing, accept: Control+1, send_sequence: '{Home}{Shift+Right}[' }
#- { when: composing, accept: Control+2, send_sequence: '{Home}{Shift+Right}{Shift+Right}[' }
#- { when: composing, accept: Control+3, send_sequence: '{Home}{Shift+Right}{Shift+Right}{Shift+Right}[' }
#- { when: composing, accept: Control+4, send_sequence: '{Home}{Shift+Right}{Shift+Right}{Shift+Right}{Shift+Right}[' }
recognizer:
# import_preset: default
patterns:
uppercase: "^[A-Z].*$"
#punct: '^/[0-9A-Za-z]+$' # 此正则无法使用1~0进行快速选择
punct: '^/[0-9A-z][0A-z]?[A-z]?+$' # 此正则在/+数字的情况下只能通过1~9进行快速选择,而不能使用0,其余情况皆为正常
## 拆字、笔画、仓颉:
reverse_moqima: "^amq[A-Za-z]*$" # "[[]b[a-z]*'?$"
reverse_chaizi: "^az[a-z]*'?$" # "[[]b[a-z]*'?$"
reverse_stroke: "^ab[A-Za-z]*$"
reverse_cj: "^acj[A-Za-z]*$"
reverse_zrlf: "^alf[A-Za-z]*$"
emojis: "^ae[a-z]*'?$" # "^ae.*$"
easy_en_simp: "^aw[a-z]*"
jp_sela: "^aj[a-z]*"
unicode: "^U[a-f0-9]+" # 脚本将自动获取第 2 个字符 U 作为触发前缀,响应 lua_translator@unicode,输出 Unicode 字符
number: "^R[0-9]+[.]?[0-9]*" # 脚本将自动获取第 2 个字符 R 作为触发前缀,响应 lua_translator@number_translator,数字金额大写
gregorian_to_lunar: "^N[0-9]{1,8}" # 脚本将自动获取第 2 个字符 N 作为触发前缀,响应 lua_translator@lunar,公历转农历,输入 N20240115 得到「二〇二三年腊月初五」
emojis:
tag: emojis
dictionary: emoji
enable_completion: true
prefix: "ae"
#suffix: "'"
tips: " Emoji"
easy_en_simp:
tag: easy_en_simp
dictionary: easy_en
enable_completion: true
enable_sentence: false
prefix: "aw"
# suffix: "'"
tips: "英文单词(可去元音)"
spelling_hints: 9
comment_format:
- xform/^.+$//
jp_sela:
tag: jp_sela
dictionary: jp_sela
enable_completion: true
enable_sentence: false
prefix: "aj"
# suffix: "'"
tips: "日语"
spelling_hints: 9
comment_format:
- xform/^.+$//