forked from Mintimate/oh-my-rime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
terra_pinyin.schema.yaml
executable file
·440 lines (419 loc) · 14.1 KB
/
terra_pinyin.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
schema:
schema_id: terra_pinyin
name: "地球拼音-薄荷定制"
version: '24.05.29'
author:
- 佛振 <chen.sst@gmail.com>
- mintimate < @Mintimate|https://www.mintimate.cn >
description: |
「漢語拼音」,以符號按鍵 - / < \ 輸入四聲
拼音碼表根據 CC-CEDICT 改編
dependencies:
- wubi98_mint
- stroke
- radical_pinyin # 参考 https://github.com/mirtlecn/rime-radical-pinyin
- melt_eng # 英文方案
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 英文 ]
- name: emoji_suggestion
states: [ "😣️","😁️"]
reset: 0
- name: full_shape
states: [ 半角, 全角 ]
reset: 0
- name: transcription
states: [ 简体 , 繁体 ]
reset: 0
- name: ascii_punct
states: [ "。," , ".," ]
reset: 0
engine:
processors:
- lua_processor@*select_character # 以词定字
- lua_processor@*codeLengthLimit_processor # 使用Lua限制输入内容的最大长度(防止过长而卡顿)
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- affix_segmentor@wubi98_mint
- affix_segmentor@radical_reverse_lookup
- affix_segmentor@stroke
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- lua_translator@*mint_date_time_translator # 时间、日期、星期、月份
- lua_translator@*number_translator # 金额大小写
- lua_translator@*chineseLunarCalendar_translator # 农历
- punct_translator
- table_translator@custom_phrase
- table_translator@melt_eng # 英文输入(作为子翻译器,优先级需要比原生的低)
- reverse_lookup_translator@wubi98_mint
- reverse_lookup_translator@radical_reverse_lookup
- reverse_lookup_translator@stroke
- script_translator
- lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿
filters:
- lua_filter@*autocap_filter # 英文自动大写
- simplifier@emoji_suggestion # Emoji OpenCC
- simplifier@transcription_cc # 繁体&简体 OpenCC
- lua_filter@*reduce_english_filter # 降低部分英语单词在候选项的位置
- uniquifier # 去重
# 简繁切换
transcription_cc:
option_name: transcription
opencc_config: s2t.json # s2t.json | s2hk.json | s2tw.json | s2twp.json
tips: none # 转换提示: all 都显示 | char 仅单字显示 | none 不显示。
excluded_types: [ reverse_lookup ] # 不转换反查(两分拼字)的内容
# Emoji模块
emoji_suggestion:
opencc_config: emoji.json
option_name: emoji_suggestion
tips: all
inherit_comment: false
# 最大输入长度
codeLengthLimit_processor: 25
# 中国农历配置
chineseLunarCalendar_translator: lunar
# Lua 配置: 降低部分英语单词在候选项的位置。
# 详细介绍 https://dvel.me/posts/make-rime-en-better/#短单词置顶的问题
# 正常情况: 输入 rug 得到 「1.rug 2.如果 …… 」
# 降低之后: 输入 rug 得到 「1.如果 2.rug …… 」
reduce_english_filter:
mode: all # all | none | custom | 『留白』
idx: 2 # 降低到第 idx 个位置
# 自定义的单词列表,示例列表没有降低部分常用单词,如 and cat mail Mac but bad shit ……
words: [aid, ann,
bail, bait, bam, band, bans, bat, bay, bend, bent, benz, bib, bid, bien, biz, boc, bop, bos, bud, buf,
cab, cad, cain, cam, cans, cap, cas, cef, chad, chan, chap, chef, cher, chew, chic, chin, chip, chit, coup, cum, cunt, cur,
dab, dag, dal, dam, dent, dew, dial, diet, dim, din, dip, dis, dit, doug, dub, dug, dunn,
fab, fax, fob, fog, foul, fur,
gag, gail, gain, gal, gam, gaol, ged, gel, ger, guam, gus, gut,
hail, ham, hank, hans, hat, hay, heil, heir, hem, hep, hud, hum, hung, hunk, hut,
jim, jug,
kat,
lab, lad, lag, laid, lam, laos, lap, lat, lax, lay, led, leg, lex, liam, lib, lid, lied, lien, lies, linn, lip, lit, liz, lob, lug, lund, lung, lux,
mag, maid, mann, mar, mat, med, mel, mend, mens, ment, mil, mins, mint, mob, moc, mop, mos, mot, mud, mug, mum, nail,
nap, nat, nay, neil, nib, nip, noun, nous, nun, nut,
pac, paid, pail, pain, pair, pak, pal, pam, pans, pant, pap, par, pat, paw, pax, pens, pic, pier, pies, pins, pint, pit, pix, pod, pop, pos, pot, pour, pow, pub,
rand, rant, rent, rep, res, ret, rex, rib, rid, rig, rim, rub, rug, rum, runc, runs,
sac, sail, sal, sam, sans, sap, saw, sax, sew, sham, shaw, shin, sig, sin, sip, sis, suit, sung, suns, sup, sur, sus,
tad, tail, taj, tar, tax, tec, ted, tel, ter, tex, tic, tied, tier, ties, tim, tin, tit, tour, tout, tum, me,
wag, wand, womens, wap, wax, weir, won,
yan, yen]
speller:
alphabet: 'zyxwvutsrqponmlkjihgfedcba-;/<,>\'
initials: zyxwvutsrqponmlkjihgfedcba
delimiter: " '"
algebra:
- xform/^r5$/er5/
- erase/^xx$/
- derive/^([zcs])h/$1/ # zh, ch, sh => z, c, s
- derive/^([zcs])([^h])/$1h$2/ # z, c, s => zh, ch, sh
- derive/([aei])n$/$1ng/ # en => eng, in => ing
- derive/([aei])ng$/$1n/ # eng => en, ing => in
- derive/([iu])an$/$lang/ # ian => iang, uan => uang
- derive/([iu])ang$/$lan/ # iang => ian, uang => uan
- derive/([aeiou])ng$/$1gn/ # dagn => dang
- derive/([dtngkhrzcs])o(u|ng)$/$1o/ # zho => zhong|zhou
- derive/ong$/on/ # zhonguo => zhong guo
- derive/ao$/oa/ # hoa => hao
- derive/([iu])a(o|ng?)$/a$1$2/ # tain => tian
- abbrev/^([a-z])[a-z]*$/$1/ # 简拼(首字母)
- abbrev/^([zcs]h).+$/$1/
- derive/^([nl])ve/$1ue/
- derive/^([jqxy])u/$1v/
- derive/([dtnlgkhrzcs])un/$1uen/
- derive/ui/uei/
- derive/iu/iou/
- derive/ao/oa/
- derive/([aeiou])ng/$1gn/
- derive/([iu])a(o|ng?)/a$1$2/
- derive/^([a-z]+)[0-5]$/$1/
- derive/([dtngkhrzcs])o(u|ng)$/$1o/
- derive/ong$/on/
- 'erase/^.*5$/'
- 'xlit 1234 -/<\'
- 'derive/^(.*)-$/$1;/'
- 'derive/^(.*)<$/$1,/'
- 'derive/^(.*)\\$/$1>/'
translator:
dictionary: terra_pinyin
initial_quality: 1.2
spelling_hints: 3 # ~字以內候選標註完整帶調拼音
preedit_format:
- xform/([nl])v/$1ü/
- xform/([nl])ue/$1üe/
- xform/([nl])üen/$1uen/
- xform/([jqxy])v/$1u/
- xform/eh/ê/
- 'xform ([aeiou])(ng?|r)([-;/<,>\\]) $1$3$2'
- 'xform ([aeo])([iuo])([-;/<,>\\]) $1$3$2'
- 'xform a[-;] ā'
- 'xform a/ á'
- 'xform a[<,] ǎ'
- 'xform a[>\\] à'
- 'xform e[-;] ē'
- 'xform e/ é'
- 'xform e[<,] ě'
- 'xform e[>\\] è'
- 'xform o[-;] ō'
- 'xform o/ ó'
- 'xform o[<,] ǒ'
- 'xform o[>\\] ò'
- 'xform i[-;] ī'
- 'xform i/ í'
- 'xform i[<,] ǐ'
- 'xform i[>\\] ì'
- 'xform u[-;] ū'
- 'xform u/ ú'
- 'xform u[<,] ǔ'
- 'xform u[>\\] ù'
- 'xform ü[-;] ǖ'
- 'xform ü/ ǘ'
- 'xform ü[<,] ǚ'
- 'xform ü[>\\] ǜ'
comment_format:
- xform ([aeiou])(ng?|r)([1234]) $1$3$2
- xform ([aeo])([iuo])([1234]) $1$3$2
- xform a1 ā
- xform a2 á
- xform a3 ǎ
- xform a4 à
- xform e1 ē
- xform e2 é
- xform e3 ě
- xform e4 è
- xform o1 ō
- xform o2 ó
- xform o3 ǒ
- xform o4 ò
- xform i1 ī
- xform i2 í
- xform i3 ǐ
- xform i4 ì
- xform u1 ū
- xform u2 ú
- xform u3 ǔ
- xform u4 ù
- xform v1 ǖ
- xform v2 ǘ
- xform v3 ǚ
- xform v4 ǜ
- xform/([nljqxy])v/$1ü/
- xform/eh[0-5]?/ê/
- xform/([a-z]+)[0-5]/$1/
enable_user_dict: true # 开启用户词典,根据用户输入调频(默认开启,此处再次声明)
custom_phrase:
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 1
melt_eng:
dictionary: melt_eng # 英文词典
enable_sentence: false # 关闭自动造句
enable_completion: false # 关闭自动提示
initial_quality: 0.8
wubi98_mint:
tag: wubi98_mint
dictionary: wubi98_mint
enable_user_dict: false
enable_completion: true
prefix: "Uw"
suffix: "'"
tips: 〔五笔〕
comment_format:
- xform ([aeiou])(ng?|r)([1234]) $1$3$2
- xform ([aeo])([iuo])([1234]) $1$3$2
- xform a1 ā
- xform a2 á
- xform a3 ǎ
- xform a4 à
- xform e1 ē
- xform e2 é
- xform e3 ě
- xform e4 è
- xform o1 ō
- xform o2 ó
- xform o3 ǒ
- xform o4 ò
- xform i1 ī
- xform i2 í
- xform i3 ǐ
- xform i4 ì
- xform u1 ū
- xform u2 ú
- xform u3 ǔ
- xform u4 ù
- xform v1 ǖ
- xform v2 ǘ
- xform v3 ǚ
- xform v4 ǜ
- xform/([nljqxy])v/$1ü/
- xform/eh[0-5]?/ê/
- xform/([a-z]+)[0-5]/$1/
stroke:
tag: stroke
dictionary: stroke
enable_user_dict: false
prefix: 'Ui'
suffix: "'"
tips: 〔笔画〕
preedit_format:
- xlit/hspnz/一丨丿丶乙/
comment_format:
- xform/([nl])v/$1ü/
- xform ([aeiou])(ng?|r)([1234]) $1$3$2
- xform ([aeo])([iuo])([1234]) $1$3$2
- xform a1 ā
- xform a2 á
- xform a3 ǎ
- xform a4 à
- xform e1 ē
- xform e2 é
- xform e3 ě
- xform e4 è
- xform o1 ō
- xform o2 ó
- xform o3 ǒ
- xform o4 ò
- xform i1 ī
- xform i2 í
- xform i3 ǐ
- xform i4 ì
- xform u1 ū
- xform u2 ú
- xform u3 ǔ
- xform u4 ù
- xform v1 ǖ
- xform v2 ǘ
- xform v3 ǚ
- xform v4 ǜ
- xform/([nljqxy])v/$1ü/
- xform/eh[0-5]?/ê/
- xform/([a-z]+)[0-5]/$1/
radical_reverse_lookup:
tag: radical_lookup
dictionary: radical_pinyin
enable_completion: true
prefix: "Uu"
preedit_format:
- xform/([nljqxy])v/$1ü/
comment_format:
- xform/([nljqxy])v/$1ü/
- xform ([aeiou])(ng?|r)([1234]) $1$3$2
- xform ([aeo])([iuo])([1234]) $1$3$2
- xform a1 ā
- xform a2 á
- xform a3 ǎ
- xform a4 à
- xform e1 ē
- xform e2 é
- xform e3 ě
- xform e4 è
- xform o1 ō
- xform o2 ó
- xform o3 ǒ
- xform o4 ò
- xform i1 ī
- xform i2 í
- xform i3 ǐ
- xform i4 ì
- xform u1 ū
- xform u2 ú
- xform u3 ǔ
- xform u4 ù
- xform v1 ǖ
- xform v2 ǘ
- xform v3 ǚ
- xform v4 ǜ
- xform/([nljqxy])v/$1ü/
- xform/eh[0-5]?/ê/
- xform/([a-z]+)[0-5]/$1/
tips: 〔拆字〕
reverse_lookup:
tags: [wubi98_mint,stroke,radical_lookup]
overwrite_comment: false
punctuator:
import_preset: symbols
# 定义部分半角字符
half_shape:
"#": "#"
"*": "*"
'.' : { commit: 。 }
"`": "`"
"~": "~"
"@": "@"
"=": "="
"/": ["/", "÷",]
'\': "、"
"_" : "──"
"'": {pair: ["「", "」"]}
"[": ["【", "["]
"]": ["】", "]"]
"$": ["¥", "$", "€", "£", "¢", "¤"]
"<": ["《", "〈", "«", "<"]
">": ["》", "〉", "»", ">"]
recognizer:
import_preset: default
patterns:
url: "^[a-z]+[.].+$"
punct: "^/([0-9]0?|[a-z]+)$"
wubi98_mint: "Uw[a-z]*'?$"
stroke: "Ui[a-z]*'?$"
radical_lookup: "Uu[a-z]*'?$"
uppercase: "" # 覆写默认的 uppercase 使其可以在输入大写后,输入数字
key_binder:
bindings:
- {accept: "Control+Shift+E", toggle: emoji_suggestion, when: always}
- {accept: "Control+Shift+1", toggle: transcription, when: has_menu}
- {accept: "Control+Shift+exclam", toggle: transcription, when: has_menu}
- {accept: bracketleft, send: Page_Up, when: paging} # 使用`[`进行向上翻页(第一页时候无效)
- {accept: bracketright, send: Page_Down, when: has_menu} # 使用`]`进行向下翻页
- {accept: minus, send: Page_Up, when: paging} # 使用`-`进行向上翻页(第一页时候无效)
- {accept: equal, send: Page_Down, when: has_menu} # 使用`=`进行向下翻页
# Emacs 风格的快捷键
- { when: composing, accept: Control+p, send: Up } # composing 时,Control+p 等同于 Up 键
- { when: composing, accept: Control+n, send: Down }
- { when: composing, accept: Control+b, send: Left }
- { when: composing, accept: Control+f, send: Right }
- { when: composing, accept: Control+a, send: Home }
- { when: composing, accept: Control+e, send: End }
- { when: composing, accept: Control+d, send: Delete }
- { when: composing, accept: Control+k, send: Shift+Delete } # 删除到行尾
- { when: composing, accept: Control+g, send: Escape } # 退出编码
- { when: composing, accept: Alt+v, send: Page_Up } # 翻页
- { when: composing, accept: Control+v, send: Page_Down }
# 按词移动光标
- { when: composing, accept: ISO_Left_Tab, send: Shift+Left } # ISO_Left_Tab 是 Shift+Tab
- { when: composing, accept: Shift+Tab, send: Shift+Left }
- { when: composing, accept: Tab, send: Shift+Right }
# 翻页
- { when: paging, accept: minus, send: Page_Up } # 编码窗口翻页
- { when: has_menu, accept: equal, send: Page_Down }
- { when: paging, accept: comma, send: Page_Up } # 候选窗口翻页
- { when: has_menu, accept: period, send: Page_Down }
- { when: predicting, accept: comma, send: comma } # 在预编码模式下,不当作快捷键
- { when: predicting, accept: period, send: period }
# 切换状态
- { when: always, accept: Control+Shift+1, select: .next } # 切换输入方案
- { when: always, accept: Control+Shift+2, toggle: ascii_mode } # 切换中/西文模式
- { when: always, accept: Control+Shift+3, toggle: full_shape } # 切换全角/半角
- { when: always, accept: Control+Shift+4, toggle: simplification } # 切换简体/繁体
- { when: always, accept: Control+Shift+5, toggle: extended_charset } # 切换扩展字符
- { when: always, accept: Shift+space, toggle: full_shape } # 另一种切换全角/半角的方式
- { when: always, accept: Control+period, toggle: ascii_punct } # 切换中/西文标点
menu:
# 候选词个数
page_size: 6