forked from cnfeat/Rime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xkjd6.schema.yaml
412 lines (379 loc) · 11.7 KB
/
xkjd6.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
# Rime schema settings
# encoding: utf-8
schema:
schema_id: xkjd6
name: 键道6
version: "1"
dependencies:
- xkjd6cx
- pinyin_simp
- liangfen
# Layout config
layout:
topup:
topup_this: "bcdefghjklmnpqrstwxyz"
topup_with: "avuio;"
algebra:
- derive/^[bcdefghjklmnpqrstwxyz;]([bcdefghjklmnpqrstwxyz;][avuio].*)$/`$1/
- derive/^([bcdefghjklmnpqrstwxyz;])[bcdefghjklmnpqrstwxyz;]([avuio].*)$/$1`$2/
- derive/^([bcdefghjklmnpqrstwxyz;`]{2})[avuio](.*)$/$1`$2/
- derive/^([bcdefghjklmnpqrstwxyz;`]{2}[avuio`]).(.*)$/$1`$2/
- derive/^([bcdefghjklmnpqrstwxyz;`]{2}[avuio`]{2}).(.*)$/$1`$2/
- derive/^([bcdefghjklmnpqrstwxyz;`]{2}[avuio`]{3}).(.*)$/$1`$2/
- derive/^([bcdefghjklmnpqrstwxyz;`]{2}[avuio`]{4}).(.*)$/$1`$2/
- derive/^([bcdefghjklmnpqrstwxyz;`]{2}[avuio`]{5}).$/$1`/
- derive/^[bcdefghjklmnpqrstwxyz;]{2}([avuio`]*)$/``$1/
patterns:
special: "^(?:;?[avuio])[a-z]{0,}"
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: jffh
reset: 0
states: [ 简体, 繁體 ]
- name: EN2en
reset: 1
- options: [_key_']
states: [造词]
- name: emoji_cn #Emoji开关
reset: 1 # 1为默认开启
states: [ 关闭emj,开启emj ]
- name: ascii_punct
states: [ 。,, ., ]
punctuator:
import_preset: symbols
full_shape:
' ' : { commit: ' ' }
',' : { commit: , }
'.' : { commit: 。 }
'<' : [ 《, 〈, «, ‹ ]
'>' : [ 》, 〉, », › ]
'?' : { commit: ? }
';' : { commit: ; }
':' : { commit: : }
'''' : { pair: [ '‘', '’' ] }
'"' : { pair: [ '“', '”' ] }
# '/' : { commit: / }
'\' : [ 、, \ ]
'|' : [ ·, |, '§', '¦' ]
'`' : `
'~' : ~
'!' : { commit: ! }
'@' : [ @, ☯ ]
'#' : [ #, ⌘ ]
'%' : [ %, '°', '℃' ]
'$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ]
'^' : { commit: …… }
'&' : &
'*' : [ *, ·, ・, ×, ※, ❂ ]
'(' : (
')' : )
'-' : -
'_' : ——
'+' : +
'=' : [ '=' ]
'[' : [ 「, 【, 〔, [ ]
']' : [ 」, 】, 〕, ] ]
'{' : [ 『, 〖, { ]
'}' : [ 』, 〗, } ]
half_shape:
',' : { commit: , }
'.' : { commit: 。 }
'<' : [ 《, 〈, «, ‹ ]
'>' : [ 》, 〉, », › ]
# '/' : { commit: / }
'?' : { commit: ? }
';' : { commit: ; }
':' : { commit: : }
'''' : { pair: [ '‘', '’' ] }
'"' : { pair: [ '“', '”' ] }
'\' : [ 、, '\', \ ]
'|' : [ ·, '|', |, '§', '¦' ]
'`' : '`'
'~' : [ '~', ~ ]
'!' : { commit: ! }
'@' : '@'
'#' : '#'
'%' : [ '%', %, '°', '℃' ]
'$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ]
'^' : { commit: …… }
'&' : '&'
'*' : [ '*', *, ·, ・, ×, ※, ❂ ]
'(' : (
')' : )
'-' : '-'
'_' : ——
'+' : '+'
'=' : '='
'[' : [ 「, 【, 〔, [ ]
']' : [ 」, 】, 〕, ] ]
'{' : [ 『, 〖, { ]
'}' : [ 』, 〗, } ]
engine:
processors:
- lua_processor@xuanchongjsq
- ascii_composer
- recognizer
- key_binder
- lua_processor@topup_processor
- lua_processor@smart_2
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- affix_segmentor@pinyin_simp
- affix_segmentor@quanpinerfen
- affix_segmentor@xkjdWXYZ
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- lua_translator@jisuanqi
- lua_translator@xuanchongjsq
- lua_translator@shijian
- punct_translator
- table_translator
- reverse_lookup_translator
- table_translator@custom_phrase
- table_translator@xkjdWXYZ
- table_translator@xkjdYY
- table_translator@xkjdZZ
- table_translator@xkjdWW
- table_translator@xkjd6_user
- lua_translator@number_translator
- history_translator@repeat_history
- history_translator@repeat_history2
- script_translator@quanpinerfen
- script_translator@pinyin_simp
filters:
- simplifier
- reverse_lookup_filter@pinyin_simp_lookup
- reverse_lookup_filter@quanpinerfen_lookup
- simplifier@emoji_cn
- simplifier@jffh
- simplifier@bmms
- simplifier@EN2en
- simplifier@ascii_punct
- lua_filter@xkjd6_filter
- uniquifier
speller:
auto_select: false
alphabet: "zyxwvutsrqponmlkjihgfedcba;"
initials: "abcdefghijklmnopqrstuvwxyz;"
delimiter: " '"
algebra:
- derive/[0-9]$// #无数字
- derive|^;|/|
translator:
dictionary: xkjd6.extended
enable_charset_filter: false
enable_completion: true
enable_encoder: true
enable_sentence: false
enable_user_dict: false
encode_commit_history: true
max_phrase_length: 6
initial_quality: 0
comment_format:
# - xform|~||
- xform/[0-9]// #无数字
repeat_history:
input: i #重复上次上屏内容
size: 1
initial_quality: 10000
repeat_history2:
input: ;f #重复上次上屏内容
size: 1
initial_quality: 10000
EN2en:
opencc_config: EN2en.json
option_name: EN2en
emoji_cn:
opencc_config: emoji.json
option_name: emoji_cn
tips: all
jffh:
opencc_config: s2tw.json
option_name: jffh
ascii_punct:
option_name: ascii_punct
bmms:
opencc_config: pinyin.json
option_name: bmms
show_in_comment: true
comment_format:
- xform/'/ /
pinyin_simp_lookup:
tags: [pinyin_simp]
dictionary: xkjd6cx #反查其码
overwrite_comment: true
pinyin_simp:
tag: pinyin_simp
dictionary: pinyin_simp
enable_sentence: true
enable_completion: true
enable_user_dict: false
prefix: "u"
tips: "〔全拼〕"
#↓二分反查方案
quanpinerfen_lookup:
tags: [quanpinerfen]
dictionary: xkjd6cx #反查其码
overwrite_comment: true
quanpinerfen:
tag: quanpinerfen
dictionary: liangfen
enable_sentence: true
enable_completion: true
enable_user_dict: false
prefix: "v"
tips: "〔二分〕"
custom_phrase:
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
enable_sentence: false
reverse_lookup:
dictionary: xkjd6cx
comment_format:
- xform/^/〔/
- xform/$/〕/
- xform/ /, /
xkjdWXYZ:
tag: xkjdWXYZ
dictionary: xkjd6.extended
user_dict: xkjd6_user
# ↓ 用户词典格式,tabledb(文本) 或 userdb (二进制)。
db_class: tabledb
# db_class: userdb
enable_charset_filter: false
enable_completion: true
enable_encoder: true
enable_sentence: true
enable_user_dict: true
encode_commit_history: false
preedit_format:
- xform|1|_|
comment_format:
- xform|1|_|
# - xform|~||
prefix: "a"
tips: "〔造词〕"
xkjdYY:
__include: /xkjdWXYZ
tag: xkjdYY
dictionary: xkjd_Y
prefix: "~E"
tips: "〔Y〕"
xkjdZZ:
__include: /xkjdWXYZ
tag: xkjdZZ
dictionary: xkjd_Z
prefix: "~R"
tips: "〔Z〕"
xkjdWW:
__include: /xkjdWXYZ
tag: xkjdWW
dictionary: xkjd_W
prefix: "~T"
tips: "〔W〕"
xkjd6_user:
dictionary: ""
user_dict: xkjd6_user
db_class: stabledb
enable_sentence: false
enable_completion: true
comment_format:
- xform/[0-9]// #无数字
# - xform|~||
initial_quality: -1
# punctuator:
# import_preset: default
# half_shape:
# '''' : [ '‘', '’' , '\', '﹨' ]
key_binder:
# import_preset: default
bindings:
- {accept: "Shift+space", send: space, when: composing} #小狼毫输入法中进行引导造词时的上屏组合键(Shift+space),同文输入法则需要点击候选词上屏
# - {accept: "space", send: 1, when: composing} #引导造词中空格等于首选,空格就丧失了上屏的功能(在引导造词中)
- {accept: semicolon, send: 2, when: has_menu} #分号次选
- {accept: apostrophe, send: 3, when: has_menu} #撇号三选
- { when: always, accept: "Control+period", toggle: ascii_punct }
- {accept: minus, send: Page_Up, when: has_menu}
- {accept: equal, send: Page_Down, when: has_menu}
- {accept: comma, send: Page_Up, when: has_menu}
- {accept: period, send: Page_Down, when: has_menu}
# - {accept: bracketleft, send: Page_Up, when: has_menu} # [上翻页
# - {accept: bracketright, send: Page_Down, when: has_menu} # ]下翻页
- { when: always, accept: F6, select: .next }
- { when: always, accept: F7, toggle: jffh }
# - { when: has_menu, accept: "'", send: 2 }
- { when: has_menu, accept: "&", toggle: emoji_cn}
- { when: has_menu, accept: "^", toggle: bmms}
- {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_Subtract, send: -, when: has_menu}
- {accept: KP_Divide, send: /, when: has_menu}
- {accept: KP_Multiply, send: "*", when: has_menu}
- {accept: KP_Add, send: +, when: has_menu}
- {accept: KP_Decimal, send: ".", when: has_menu}
# - {accept: "Shift+space", send: space, when: composing} #小狼毫输入法中进行引导造词时的上屏组合键(Shift+space),同文输入法则需要点击候选词上屏
# # - {accept: "space", send: 1, when: composing} #引导造词中空格等于首选,空格就丧失了上屏的功能(在引导造词中)
# - {accept: ";", send: 2, when: composing} #分号次选
# - { when: always, accept: "Control+period", toggle: ascii_punct }
# - {accept: minus, send: Page_Up, when: has_menu}
# - {accept: equal, send: Page_Down, when: has_menu}
# - {accept: comma, send: Page_Up, when: has_menu}
# - {accept: period, send: Page_Down, when: has_menu}
# - { when: always, accept: F6, select: .next }
# - { when: always, accept: F7, toggle: jffh }
# - { when: has_menu, accept: "'", send: 2 }
# - { when: has_menu, accept: "&", toggle: emoji_cn}
# - { when: has_menu, accept: "^", toggle: bmms}
# - {accept: KP_0, send: 0, when: has_menu}
# - {accept: KP_1, send: 1, when: has_menu}
# - {accept: KP_2, send: 2, when: has_menu}
# - {accept: KP_3, send: 3, when: has_menu}
# - {accept: KP_4, send: 4, when: has_menu}
# - {accept: KP_5, send: 5, when: has_menu}
# - {accept: KP_6, send: 6, when: has_menu}
# - {accept: KP_7, send: 7, when: has_menu}
# - {accept: KP_8, send: 8, when: has_menu}
# - {accept: KP_9, send: 9, when: has_menu}
# - {accept: KP_Subtract, send: -, when: has_menu}
# - {accept: KP_Divide, send: /, when: has_menu}
# - {accept: KP_Multiply, send: "*", when: has_menu}
# - {accept: KP_Add, send: +, when: has_menu}
# - {accept: KP_Decimal, send: ".", when: has_menu}
recognizer:
import_preset: default
patterns:
reverse_lookup: "[a-z`]*`+[a-z`]*"
punct: "^/([0-9]0?|[a-z]+)$"
xkjdWXYZ: "^a['/a-z][a-z,./:?!']*'?$"
pinyin_simp: "^u[a-z']*'?$"
quanpinerfen: "^v[a-z']*'?$"
jsq: "^=[^;']+$"
# xkjdWXYZ: "^'['/a-z][a-z0-9,./:?!']*'?$"
topup:
__include: "layout/topup"
min_length: 4
max_length: 6
auto_clear: true
min_length_danzi: 2
topup_command: true