-
Notifications
You must be signed in to change notification settings - Fork 0
/
triple_pinyin_bopomofo.schema.yaml
725 lines (675 loc) · 27 KB
/
triple_pinyin_bopomofo.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
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
# Rime schema
# encoding: utf-8
schema:
schema_id: triple_pinyin_bopomofo
name: 三碼注音
version: "1.4"
author:
- 佛振 <chen.sst@gmail.com>
- 阿森納裡 <15678407@qq.com>
description: |
15鍵內實現“聲母+介韻+去重碼&聲調”三碼輸入一個帶調音節;
介韻分為四區:ㄚ/ㄞ/ㄢ,ㄛ/ㄟ/ㄣ,ㄜ/ㄠ/ㄤ,ㄝ/ㄡ/ㄥ;
支持首碼簡拼(需使用隔音符)和前兩碼簡拼。
dependencies:
- luna_pinyin
- stroke
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: simplification
reset: 0
states: [ 繁體, 简体 ]
- name: ascii_punct
states: [ ,。, ,. ]
- options: [ VOICE_ASSIST1 ]
states: [ "🎙" ]
- options: [ _Keyboard_emoji ]
states: [ "😊" ]
- options: [ _Keyboard_symbols ]
states: [ "🔣" ]
- options: [ _Keyboard_clip ]
states: [ "📋" ]
- options: [ Menu ]
states: [ "方案" ]
- options: [ Theme_settings ]
states: [ "主题" ]
- options: [ Color_switch ]
states: [ "配色" ]
- options: [ Hint_switch ]
states: [ "助记" ]
- options: [ IME_switch ]
states: [ "🌐" ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor # 編輯器
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- reverse_lookup_translator@luna_pinyin_lookup
- reverse_lookup_translator@stroke_lookup
- script_translator
filters:
- simplifier
- uniquifier
speller:
alphabet: 'zyxwvutsrqponmlkjihgfedcba'
delimiter: " ;'"
# auto_clear: auto # manual|auto|max_length 空碼按下一鍵確認清屏|空碼自動清屏|達到最長碼時後碼頂上清屏
algebra:
# 音節修正合併
- erase/^xx$/
- xform/^m([1-5])$/mu$1/ # 鼻音m(呣)轉化爲mu
- xform/^r5$/er5/ # r5(兒)轉化爲er5
# - xform/^eh([1-5])$/e$1/ # 模糊音:eh(誒欸)、e合併
- xform/^wong([1-5])$/weng$1/ # 模糊音:wong、weng合併
# 拼音完整形式
- xform/^([jqx])u/$1v/
- xform/iu/iou/
- xform/ui/uei/
- xform/ong/ung/
- xform/^yi?/i/
- xform/^wu?/u/
- xform/iu/v/
- xform/([iuv])n/$1en/
# 異拼
# - derive/^([jqx])?veng/$1iong/ # veng->iong
# - derive/^(\w|[zcs]h)ueng/$1ong/ # ueng->ong
# 尖音處理
- xform/^ziou([1-5])$/buo$1/
- xform/^zii([1-5])$/buei$1/
- xform/^zi(\w+[1-5])$/bu$1/
- xform/^z(v\w*[1-5])$/b$1/
- xform/^ciou([1-5])$/puo$1/
- xform/^cii([1-5])$/puei$1/
- xform/^ci(\w+[1-5])$/pu$1/
- xform/^c(v\w*[1-5])$/p$1/
- xform/^siou([1-5])$/muo$1/
- xform/^sii([1-5])$/muei$1/
- xform/^si(\w+[1-5])$/mu$1/
- xform/^s(v\w*[1-5])$/m$1/
# 音節合併
- xform/^([zcs]h?|r)i([1-5])$/$1o$2/
- xform/^([zcs])([aoe]\w*)([1-5])$/$1hi$2$3/
- xform/^([zcs])u(an|eng?|ei|o)?([1-5])$/$1hv$2$3/
- xform/^fiao([1-5])$/riao$1/
- xform/^fu(eng)?([1-5])$/rv$1$2/
- xform/^f(\w+)([1-5])$/ri$1$2/
# 第1碼:聲母
- xform/^b/Q/
- xform/^p/W/
- xform/^m/E/
- xform/^[fr]/R/
- xform/^d/A/
- xform/^t/S/
- xform/^n/D/
- xform/^l/F/
- xform/^[gj]/Z/
- xform/^[kq]/X/
- xform/^[hx]/C/
- xform/^([aoeiuv])/V$1/
- xform/^zh?/T/
- xform/^ch?/G/
- xform/^sh?/B/
# 第2碼:介韻
- xform/^([QWERTASDFGZXCVB])(a|ai|an)([1-5])$/$1Q$2$3/
- xform/^([QWERTASDFGZXCVB])(o|ei|en)([1-5])$/$1W$2$3/
- xform/^([QWERTASDFGZXCVB])(e|ao|ang)([1-5])$/$1E$2$3/
- xform/^([QWERTASDFGZXCVB])(eh|ou|eng)([1-5])$/$1R$2$3/
- xform/^([QWERTASDFGZXCVB])(ia|iai|ian)([1-5])$/$1A$2$3/
- xform/^([QWERTASDFGZXCVB])(io|iei|ien|i)([1-5])$/$1S$2$3/
- xform/^([QWERTASDFGZXCVB])(iao|iang)([1-5])$/$1D$2$3/
- xform/^([RTGB])(ie)([1-5])$/$1D$2$3/
- xform/^([QWERTASDFGZXCVB])(ie|iou|ieng)([1-5])$/$1F$2$3/
- xform/^([QWERTASDFGZXCVB])(ua|uai|uan)([1-5])$/$1Z$2$3/
- xform/^([QWERTASDFGZXCVB])(uo|uei|uen)([1-5])$/$1X$2$3/
- xform/^([QWERTASDFGZXCVB])(uao|uang)([1-5])$/$1C$2$3/
- xform/^([QWERTASDFGZXCVB])(ue|uou|ueng|u)([1-5])$/$1V$2$3/
- xform/^([QWERTASDFGZXCVB])(va|vai|van|er)([1-5])$/$1T$2$3/
- xform/^([QWERTASDFGZXCVB])(vo|vei|ven|vao|vang)([1-5])$/$1G$2$3/
- xform/^([QWERTASDFGZXCVB])(ve|vou|veng|v)([1-5])$/$1B$2$3/
# 第3碼:去重碼&聲調
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[aeo]|eh|er)1$/$1Q/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[aeo]|eh|er)2$/$1W/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[aeo]|eh|er)3$/$1E/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[aeo]|eh|er)4$/$1R/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[aeo]|eh|er)5$/$1T/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[ae]i|[iuv]?ao|[iuv]?ou|[iuv])1$/$1A/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[ae]i|[iuv]?ao|[iuv]?ou|[iuv])2$/$1S/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[ae]i|[iuv]?ao|[iuv]?ou|[iuv])3$/$1D/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[ae]i|[iuv]?ao|[iuv]?ou|[iuv])4$/$1F/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[ae]i|[iuv]?ao|[iuv]?ou|[iuv])5$/$1G/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[ae]ng?)1$/$1Z/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[ae]ng?)2$/$1X/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[ae]ng?)3$/$1C/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[ae]ng?)4$/$1V/
- xform/^([QWERTASDFGZXCVB]{2})([iuv]?[ae]ng?)5$/$1B/
- erase/^[QWERTASDFGZXCVB][a-z]+/
- xlit/QWERTYUIOPASDFGHJKLZXCVBNM/qwertyuiopasdfghjklzxcvbnm/
- erase/^[yuiophjklnm]\w*/
# 簡拼
- derive/^t([qwertasdfgzxcvb]{2})$/y$1/
- derive/^g([qwertasdfgzxcvb]{2})$/h$1/
- derive/^b([qwertasdfgzxcvb]{2})$/n$1/
- abbrev/^([qwertasdfgzxcvbyhn])[qwertasdfgzxcvb]{2}$/$1/ # 首碼簡拼
- derive/^([qwertasdfgzxcvbyhn])t([qwertasdfgzxcvb])$/$1y$2/
- derive/^([qwertasdfgzxcvbyhn])g([qwertasdfgzxcvb])$/$1h$2/
- derive/^([qwertasdfgzxcvbyhn])b([qwertasdfgzxcvb])$/$1n$2/
- derive/^([qwertasdfgzxcvbyhn]{2})[qwertasdfgzxcvb]$/$1/ # 前兩碼簡拼
- derive/^([qwertasdfgzxcvbyhn]{2})[qwert]$/$1y/
- derive/^([qwertasdfgzxcvbyhn]{2})[asdfg]$/$1h/
- derive/^([qwertasdfgzxcvbyhn]{2})[zxcvb]$/$1n/
# - derive/^([qwertasdfgzxcvbyhn])([qwertasdfgzxcvbyhn]{2})$/$2/ # 後兩碼簡拼
translator:
dictionary: terra_pinyin
prism: triple_pinyin_bopomofo
spelling_hints: 4 # ~字以內候選標註完整帶調拼音
preedit_format:
# 1: 三碼注音輸入碼->數字標調拼音
- xform/\<q(\w*)/B$1/ # 第1碼:聲母
- xform/\<w(\w*)/P$1/
- xform/\<e(\w*)/M$1/
- xform/\<r(\w*)/R$1/
- xform/\<a(\w*)/D$1/
- xform/\<s(\w*)/T$1/
- xform/\<d(\w*)/N$1/
- xform/\<f(\w*)/L$1/
- xform/\<z(\w*)/G$1/
- xform/\<x(\w*)/K$1/
- xform/\<c(\w*)/H$1/
- xform/\<v(\w*)/Y$1/
- xform/\<[ty](\w*)/Z$1/
- xform/\<[gh](\w*)/C$1/
- xform/\<[bn](\w*)/S$1/
- xform/\<([BPMDTNLGKHYZCSR])(?!\w)\>/$1-/
- xform/\<([BPMDTNLGKHYZCSR])q(\w|\>)/$1Q$2/ # 第2碼:介韻
- xform/\<([BPMDTNLGKHYZCSR])w(\w|\>)/$1W$2/
- xform/\<([BPMDTNLGKHYZCSR])e(\w|\>)/$1E$2/
- xform/\<([BPMDTNLGKHYZCSR])r(\w|\>)/$1R$2/
- xform/\<([BPMDTNLGKHYZCSR])a(\w|\>)/$1iA$2/
- xform/\<([BPMDTNLGKHYZCSR])s(\w|\>)/$1iS$2/
- xform/\<([BPMDTNLGKHYZCSR])d(\w|\>)/$1iD$2/
- xform/\<([BPMDTNLGKHYZCSR])f(\w|\>)/$1iF$2/
- xform/\<([BPMDTNLGKHYZCSR])z(\w|\>)/$1uZ$2/
- xform/\<([BPMDTNLGKHYZCSR])x(\w|\>)/$1uX$2/
- xform/\<([BPMDTNLGKHYZCSR])c(\w|\>)/$1uC$2/
- xform/\<([BPMDTNLGKHYZCSR])v(\w|\>)/$1uV$2/
- xform/\<([BPMDTNLGKHYZCSR])t(\w|\>)/$1vT$2/
- xform/\<([BPMDTNLGKHYZCSR])y(\w|\>)/$1vY$2/
- xform/\<([BPMDTNLGKHYZCSR])g(\w|\>)/$1vG$2/
- xform/\<([BPMDTNLGKHYZCSR])h(\w|\>)/$1vH$2/
- xform/\<([BPMDTNLGKHYZCSR])b(\w|\>)/$1vB$2/
- xform/\<([BPMDTNLGKHYZCSR])n(\w|\>)/$1vN$2/
- xform/\<([BPMDTNLGKHYZCSR])Q(?!\w)\>/$1a-/
- xform/\<([BPMDTNLGKHYZCSR])iA(?!\w)\>/$1ia-/
- xform/\<([BPMDTNLGKHYZCSR])uZ(?!\w)\>/$1ua-/
- xform/\<([BPMDTNLGKHYZCSR])v[TY](?!\w)\>/$1va-/
- xform/\<([BPMDTNLGKHYZCSR])W(?!\w)\>/$1o-/
- xform/\<([BPMDTNLGKHYZCSR])iS(?!\w)\>/$1io-/
- xform/\<([BPMDTNLGKHYZCSR])uX(?!\w)\>/$1uo-/
- xform/\<([BPMDTNLGKHYZCSR])v[GH](?!\w)\>/$1vo-/
- xform/\<([BPMDTNLGKHYZCSR])E(?!\w)\>/$1e-/
- xform/\<([BPMDTNLGKHYZCSR])iD(?!\w)\>/$1ie-/
- xform/\<([BPMDTNLGKHYZCSR])uC(?!\w)\>/$1ue-/
- xform/\<([BPMDTNLGKHYZCSR])v[BN](?!\w)\>/$1vj-/
- xform/\<([BPMDTNLGKHYZCSR])R(?!\w)\>/$1j-/
- xform/\<([BPMDTNLGKHYZCSR])iF(?!\w)\>/$1ij-/
- xform/\<([BPMDTNLGKHYZCSR])uV(?!\w)\>/$1uj-/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]q(?!-)\>/$1$2A\x31/ # 第3碼:去重碼&聲調
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]w(?!-)\>/$1$2A\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]e(?!-)\>/$1$2A\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]r(?!-)\>/$1$2A\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]t(?!-)\>/$1$2A\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]y(?!-)\>/$1$2A\x30/
- xform/\<YvA([0-5])\>/er$1/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]a(?!-)\>/$1$2AI\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]s(?!-)\>/$1$2AI\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]d(?!-)\>/$1$2AI\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]f(?!-)\>/$1$2AI\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]g(?!-)\>/$1$2AI\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]h(?!-)\>/$1$2AI\x30/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]z(?!-)\>/$1$2AN\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]x(?!-)\>/$1$2AN\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]c(?!-)\>/$1$2AN\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]v(?!-)\>/$1$2AN\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]b(?!-)\>/$1$2AN\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[QAZTY]n(?!-)\>/$1$2AN\x30/
- xform/\<([ZCS])vAN([0-5])\>/$1uan$2/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]q(?!-)\>/$1$2O\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]w(?!-)\>/$1$2O\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]e(?!-)\>/$1$2O\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]r(?!-)\>/$1$2O\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]t(?!-)\>/$1$2O\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]y(?!-)\>/$1$2O\x30/
- xform/\<([ZCS]i?|R)O([0-5])\>/$1I$2/
- xform/\<([ZCS])vO([0-5])\>/$1uo$2/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]a(?!-)\>/$1$2EI\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]s(?!-)\>/$1$2EI\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]d(?!-)\>/$1$2EI\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]f(?!-)\>/$1$2EI\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]g(?!-)\>/$1$2EI\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]h(?!-)\>/$1$2EI\x30/
- xform/\<([BPMDTNLGKHY])iEI([0-5])\>/$1I$2/
- xform/\<([ZCS])vEI([0-5])\>/$1uei$2/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]z(?!-)\>/$1$2EN\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]x(?!-)\>/$1$2EN\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]c(?!-)\>/$1$2EN\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]v(?!-)\>/$1$2EN\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]b(?!-)\>/$1$2EN\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[WSXGH]n(?!-)\>/$1$2EN\x30/
- xform/\<([ZCS])vEN([0-5])\>/$1uen$2/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]q(?!-)\>/$1$2E\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]w(?!-)\>/$1$2E\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]e(?!-)\>/$1$2E\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]r(?!-)\>/$1$2E\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]t(?!-)\>/$1$2E\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]y(?!-)\>/$1$2E\x30/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]a(?!-)\>/$1$2AO\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]s(?!-)\>/$1$2AO\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]d(?!-)\>/$1$2AO\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]f(?!-)\>/$1$2AO\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]g(?!-)\>/$1$2AO\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]h(?!-)\>/$1$2AO\x30/
- xform/\<([BPMDTNLGKHYR])vAO([0-5])\>/$1V$2/
- xform/\<([ZCS])vAO([0-5])\>/$1u$2/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]z(?!-)\>/$1$2ANG\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]x(?!-)\>/$1$2ANG\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]c(?!-)\>/$1$2ANG\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]v(?!-)\>/$1$2ANG\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]b(?!-)\>/$1$2ANG\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iuv])?[EDCBN]n(?!-)\>/$1$2ANG\x30/
- xform/\<([ZCS])vANG([0-5])\>/$1ueng$2/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]q(?!-)\>/$1$2EH\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]w(?!-)\>/$1$2EH\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]e(?!-)\>/$1$2EH\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]r(?!-)\>/$1$2EH\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]t(?!-)\>/$1$2EH\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]y(?!-)\>/$1$2EH\x30/
- xform/\<([BPMDTNLGKHYZCSR])([iu])EH([0-5])\>/$1$2E$3/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]a(?!-)\>/$1$2OU\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]s(?!-)\>/$1$2OU\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]d(?!-)\>/$1$2OU\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]f(?!-)\>/$1$2OU\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]g(?!-)\>/$1$2OU\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]h(?!-)\>/$1$2OU\x30/
- xform/\<([BPMDTNLGKHYZCSR])uOU([0-5])\>/$1U$2/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]z(?!-)\>/$1$2ENG\x31/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]x(?!-)\>/$1$2ENG\x32/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]c(?!-)\>/$1$2ENG\x33/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]v(?!-)\>/$1$2ENG\x34/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]b(?!-)\>/$1$2ENG\x35/
- xform/\<([BPMDTNLGKHYZCSR])([iu])?[RFV]n(?!-)\>/$1$2ENG\x30/
- xform/\<G([iv][A-Z]+|[IV])([0-5])\>/j$1$2/
- xform/\<K([iv][A-Z]+|[IV])([0-5])\>/q$1$2/
- xform/\<H([iv][A-Z]+|[IV])([0-5])\>/x$1$2/
- xform/\<([ZCS])([AOEu][A-Z]+|[AOEIU])([0-5])\>/$1h$2$3/
- xform/\<([ZCS])i([A-Z]+[0-5])\>/$1$2/
- xform/\<RiAO([0-5])\>/fiao$1/
- xform/\<RV(ENG)?([0-5])\>/fu$1$2/
- xform/\<Ri([A-Z]+[0-5])\>/f$1/
- xlit/QWERTYUIOPASDFGHJKLZXCVBNM/qwertyuiopasdfghjklzxcvbnm/
- xform/\<(buo)([0-5])\>/ziou$2/ # 尖音處理
- xform/\<buei([0-5])\>/zii$1/
- xform/\<bu(\w+[0-5])\>/zi$1/
- xform/\<b(v\w*[0-5])\>/z$1/
- xform/\<(puo)([0-5])\>/ciou$2/
- xform/\<puei([0-5])\>/cii$1/
- xform/\<pu(\w+[0-5])\>/ci$1/
- xform/\<p(v\w*[0-5])\>/c$1/
- xform/\<(muo)([0-5])\>/siou$2/
- xform/\<muei([0-5])\>/sii$1/
- xform/\<mu(\w+[0-5])\>/si$1/
- xform/\<m(v\w*[0-5])\>/s$1/
- xform/veng(?!\S*-)/iong/ # 拼音完整形式
- xform/\<([jqx])v(?!\S*-)/$1u/
- xform/\<y([aoe])(?!\S*-)/$1/
- xform/([iuv])en(?!\S*-)/$1n/
- xform/([^y])ung(?!\S*-)/$1ong/
- xform/([^y])iou(?!\S*-)/$1iu/
- xform/\<yi([aoe])(?!.*-)/y$1/
- xform/uei(?!\S*-)/ui/
- xform/\<yu([0-5])(?!\S*-)/wu$1/
- xform/\<yu([aoe])(?!\S*-)/w$1/
- xform/\<yu([in])(?!\S*-)/we$1/
- xform/\<yv(?!\S*-)/yu/
# 2.1:數字標調拼音->帶調拼音(隔音符、簡拼處理):注音符號
- xform/'/"/ # 輸入的隔音符號'變換為"
- xform/ (\S+-)/ '$1/ # 簡拼前+隔音符
- xform/- /-' / # 簡拼後+隔音符
- xform/' '?/ '/
- xform/\<g([iv][aoej]-)/j$1/ # 前兩碼簡拼
- xform/\<k([iv][aoej]-)/q$1/
- xform/\<h([iv][aoej]-)/x$1/
- xform/\<y([aoej]-)/$1/
- xform/\<yu([aoej]-)/w$1/
- xform/\<([zcs])(u)?([aoej]-)/$1h$2$3/
- xform/\<([yzcs])i([aoej]-)/$1$2/
- xform/\<([yzcs])v([aoj]-)/$1u$2/
- xform/\<ri([aoej]-)/f$1/
- xform/\<rv([aoj]-)/fu$1/
- xform/(v|yu)a-/$1an-/
- xform/\<yuan-/eryuan-/
- xform/(v|yu)o-/$1en-/
- xform/(v|yu)j-/$1eh-/
- xform/j-/eh-/
- xform/\<g-/gj-/ # 首碼簡拼
- xform/\<k-/kq-/
- xform/\<(?<!e)h-/hx-/
- xform/\<y-/〇-/
- xform/\<([zcs])-/$1h$1-/
- xform/\<r-/rf-/
# 2.2:數字標調拼音->帶調拼音(全碼轉換):注音符號
- xform/([jqx])u/$1v/
- xform/iu/iou/
- xform/ui/uei/
- xform/ong/ung/
- xform/yi?/i/
- xform/wu?/u/
- xform/iu/v/
- xform/([iuv])n/$1en/
- xform/zh/Z/
- xform/ch/C/
- xform/sh/S/
- xform/ai/A/
- xform/ei/I/
- xform/ao/O/
- xform/ou/U/
- xform/ang/K/
- xform/eng/G/
- xform/an/M/
- xform/en/N/
- xform/er/R/
- xform/eh/E/
- xform/([iv])e(?!.*-)/$1E/
- xform/([ZCSrzcs])i(i|[0-5]|\>)/$1$2/
- xform/b/ㄅ/
- xform/p/ㄆ/
- xform/m/ㄇ/
- xform/f/ㄈ/
- xform/d/ㄉ/
- xform/t/ㄊ/
- xform/n/ㄋ/
- xform/l/ㄌ/
- xform/g/ㄍ/
- xform/k/ㄎ/
- xform/h/ㄏ/
- xform/j/ㄐ/
- xform/q/ㄑ/
- xform/x/ㄒ/
- xform/Z/ㄓ/
- xform/C/ㄔ/
- xform/S/ㄕ/
- xform/r/ㄖ/
- xform/z/ㄗ/
- xform/c/ㄘ/
- xform/s/ㄙ/
- xform/i/ㄧ/
- xform/u/ㄨ/
- xform/v/ㄩ/
- xform/a/ㄚ/
- xform/o/ㄛ/
- xform/e/ㄜ/
- xform/E/ㄝ/
- xform/A/ㄞ/
- xform/I/ㄟ/
- xform/O/ㄠ/
- xform/U/ㄡ/
- xform/M/ㄢ/
- xform/N/ㄣ/
- xform/K/ㄤ/
- xform/G/ㄥ/
- xform/R/ㄦ/
- xform/1/ˉ/
- xform/2/ˊ/
- xform/3/ˇ/
- xform/4/ˋ/
- xform/5/˙/
- xform/([^ˉˊˇˋ˙']) (?!')/$1 '/ # 無聲調後+隔音符
- xform/0//
- xform/(ˉ|ˊ|ˇ|ˋ|˙) '(?!\S*-)/$1 / # 聲調符號後去掉隔音符
# 3: 取消空格:取消空格
# - xform/(?<!-) '(?!\S*-)/ / # 取消零聲母音節前的隔音符
# - xform/([bpmfdtnljqxwzcs])-/$1/ # 取消首碼簡拼後的-
- xform/ // # 取消空格
- xlit|;"| '| # 把;替換為空格,恢復輸入的隔音符號'
comment_format: # 提示碼爲注音符號
- erase/\<xx\>/
- xform/\<m([1-5])\>/mu$1/ # 鼻音m(呣)轉化爲mu
- xform/\<r5\>/er5/ # r5(兒)轉化爲er5
- xform/([jqx])u(?!.*-)/$1v/
- xform/iu(?!.*-)/iou/
- xform/ui(?!.*-)/uei/
- xform/ong(?!.*-)/ung/
- xform/yi?(?!.*-)/i/
- xform/wu?(?!.*-)/u/
- xform/iu(?!.*-)/v/
- xform/([iuv])n(?!.*-)/$1en/
- xform/zh(?!.*-)/Z/
- xform/ch(?!.*-)/C/
- xform/sh(?!.*-)/S/
- xform/ai(?!.*-)/A/
- xform/ei(?!.*-)/I/
- xform/ao(?!.*-)/O/
- xform/ou(?!.*-)/U/
- xform/ang(?!.*-)/K/
- xform/eng(?!.*-)/G/
- xform/an(?!.*-)/M/
- xform/en(?!.*-)/N/
- xform/er(?!.*-)/R/
- xform/eh(?!.*-)/E/
- xform/([iv])e(?!.*-)/$1E/
- xform/([ZCSrzcs])i(i|[0-5]|\>)(?!.*-)/$1$2/
- xform/b(?!.*-)/ㄅ/
- xform/p(?!.*-)/ㄆ/
- xform/m(?!.*-)/ㄇ/
- xform/f(?!.*-)/ㄈ/
- xform/d(?!.*-)/ㄉ/
- xform/t(?!.*-)/ㄊ/
- xform/n(?!.*-)/ㄋ/
- xform/l(?!.*-)/ㄌ/
- xform/g(?!.*-)/ㄍ/
- xform/k(?!.*-)/ㄎ/
- xform/h(?!.*-)/ㄏ/
- xform/j(?!.*-)/ㄐ/
- xform/q(?!.*-)/ㄑ/
- xform/x(?!.*-)/ㄒ/
- xform/Z(?!.*-)/ㄓ/
- xform/C(?!.*-)/ㄔ/
- xform/S(?!.*-)/ㄕ/
- xform/r(?!.*-)/ㄖ/
- xform/z(?!.*-)/ㄗ/
- xform/c(?!.*-)/ㄘ/
- xform/s(?!.*-)/ㄙ/
- xform/i(?!.*-)/ㄧ/
- xform/u(?!.*-)/ㄨ/
- xform/v(?!.*-)/ㄩ/
- xform/a(?!.*-)/ㄚ/
- xform/o(?!.*-)/ㄛ/
- xform/e(?!.*-)/ㄜ/
- xform/E(?!.*-)/ㄝ/
- xform/A(?!.*-)/ㄞ/
- xform/I(?!.*-)/ㄟ/
- xform/O(?!.*-)/ㄠ/
- xform/U(?!.*-)/ㄡ/
- xform/M(?!.*-)/ㄢ/
- xform/N(?!.*-)/ㄣ/
- xform/K(?!.*-)/ㄤ/
- xform/G(?!.*-)/ㄥ/
- xform/R(?!.*-)/ㄦ/
- xform/1(?!.*-)/ˉ/
- xform/2(?!.*-)/ˊ/
- xform/3(?!.*-)/ˇ/
- xform/4(?!.*-)/ˋ/
- xform/5(?!.*-)/˙/
- xform/ // # 取消空格
luna_pinyin_lookup:
tag: luna_pinyin_lookup
dictionary: luna_pinyin
enable_completion: true
prefix: "`"
suffix: "'"
tips: 〔拼音反查〕
preedit_format:
- xform/([nl])v/$1ü/
- xform/([nl])ue/$1üe/
- xform/([jqxy])v/$1u/
comment_format: &comment # 反查提示碼爲三碼注音輸入碼
# 音節修正合併
- erase/\<xx\>/
- xform/\<m([1-5])\>/mu$1/ # 鼻音m(呣)轉化爲mu
- xform/\<r5\>/er5/ # r5(兒)轉化爲er5
# - xform/\<eh([1-5])\>/e$1/ # 模糊音:eh(誒欸)、e合併
- xform/\<wong([1-5])\>/weng$1/ # 模糊音:wong、weng合併
# 拼音完整形式
- xform/\<([jqx])u/$1v/
- xform/iu/iou/
- xform/ui/uei/
- xform/ong/ung/
- xform/\<yi?/i/
- xform/\<wu?/u/
- xform/iu/v/
- xform/([iuv])n/$1en/
# 異拼
# - derive/\<([jqx])?veng/$1iong/ # veng->iong
# - derive/\<(\w|[zcs]h)ueng/$1ong/ # ueng->ong
# 尖音處理
- xform/\<ziou([1-5])\>/buo$1/
- xform/\<zii([1-5])\>/buei$1/
- xform/\<zi(\w+[1-5])\>/bu$1/
- xform/\<z(v\w*[1-5])\>/b$1/
- xform/\<ciou([1-5])\>/puo$1/
- xform/\<cii([1-5])\>/puei$1/
- xform/\<ci(\w+[1-5])\>/pu$1/
- xform/\<c(v\w*[1-5])\>/p$1/
- xform/\<siou([1-5])\>/muo$1/
- xform/\<sii([1-5])\>/muei$1/
- xform/\<si(\w+[1-5])\>/mu$1/
- xform/\<s(v\w*[1-5])\>/m$1/
# 音節合併
- xform/\<([zcs]h?|r)i([1-5])\>/$1o$2/
- xform/\<([zcs])([aoe]\w*)([1-5])\>/$1hi$2$3/
- xform/\<([zcs])u(an|eng?|ei|o)?([1-5])\>/$1hv$2$3/
- xform/\<fiao([1-5])\>/riao$1/
- xform/\<fu(eng)?([1-5])\>/rv$1$2/
- xform/\<f(\w+)([1-5])\>/ri$1$2/
# 第1碼:聲母
- xform/\<b/Q/
- xform/\<p/W/
- xform/\<m/E/
- xform/\<[fr]/R/
- xform/\<d/A/
- xform/\<t/S/
- xform/\<n/D/
- xform/\<l/F/
- xform/\<[gj]/Z/
- xform/\<[kq]/X/
- xform/\<[hx]/C/
- xform/\<([aoeiuv])/V$1/
- xform/\<zh?/T/
- xform/\<ch?/G/
- xform/\<sh?/B/
# 第2碼:介韻
- xform/\<([QWERTASDFGZXCVB])(a|ai|an)([1-5])\>/$1Q$2$3/
- xform/\<([QWERTASDFGZXCVB])(o|ei|en)([1-5])\>/$1W$2$3/
- xform/\<([QWERTASDFGZXCVB])(e|ao|ang)([1-5])\>/$1E$2$3/
- xform/\<([QWERTASDFGZXCVB])(eh|ou|eng)([1-5])\>/$1R$2$3/
- xform/\<([QWERTASDFGZXCVB])(ia|iai|ian)([1-5])\>/$1A$2$3/
- xform/\<([QWERTASDFGZXCVB])(io|iei|ien|i)([1-5])\>/$1S$2$3/
- xform/\<([QWERTASDFGZXCVB])(iao|iang)([1-5])\>/$1D$2$3/
- xform/\<([RTGB])(ie)([1-5])\>/$1D$2$3/
- xform/\<([QWERTASDFGZXCVB])(ie|iou|ieng)([1-5])\>/$1F$2$3/
- xform/\<([QWERTASDFGZXCVB])(ua|uai|uan)([1-5])\>/$1Z$2$3/
- xform/\<([QWERTASDFGZXCVB])(uo|uei|uen)([1-5])\>/$1X$2$3/
- xform/\<([QWERTASDFGZXCVB])(uao|uang)([1-5])\>/$1C$2$3/
- xform/\<([QWERTASDFGZXCVB])(ue|uou|ueng|u)([1-5])\>/$1V$2$3/
- xform/\<([QWERTASDFGZXCVB])(va|vai|van|er)([1-5])\>/$1T$2$3/
- xform/\<([QWERTASDFGZXCVB])(vo|vei|ven|vao|vang)([1-5])\>/$1G$2$3/
- xform/\<([QWERTASDFGZXCVB])(ve|vou|veng|v)([1-5])\>/$1B$2$3/
# 第3碼:去重碼&聲調
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[aeo]|eh|er)1\>/$1Q/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[aeo]|eh|er)2\>/$1W/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[aeo]|eh|er)3\>/$1E/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[aeo]|eh|er)4\>/$1R/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[aeo]|eh|er)5\>/$1T/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[ae]i|[iuv]?ao|[iuv]?ou|[iuv])1\>/$1A/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[ae]i|[iuv]?ao|[iuv]?ou|[iuv])2\>/$1S/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[ae]i|[iuv]?ao|[iuv]?ou|[iuv])3\>/$1D/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[ae]i|[iuv]?ao|[iuv]?ou|[iuv])4\>/$1F/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[ae]i|[iuv]?ao|[iuv]?ou|[iuv])5\>/$1G/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[ae]ng?)1\>/$1Z/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[ae]ng?)2\>/$1X/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[ae]ng?)3\>/$1C/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[ae]ng?)4\>/$1V/
- xform/\<([QWERTASDFGZXCVB]{2})([iuv]?[ae]ng?)5\>/$1B/
- erase/\<[QWERTASDFGZXCVB][a-z]+/
- xlit/QWERTYUIOPASDFGHJKLZXCVBNM/qwertyuiopasdfghjklzxcvbnm/
- erase/\<[yuiophjklnm]\w*/
# 簡拼
# - derive/\<t([qwertasdfgzxcvb]{2})\>/y$1/
# - derive/\<g([qwertasdfgzxcvb]{2})\>/h$1/
# - derive/\<b([qwertasdfgzxcvb]{2})\>/n$1/
# - abbrev/\<([qwertasdfgzxcvbyhn])[qwertasdfgzxcvb]{2}\>/$1/ # 首碼簡拼
# - derive/\<([qwertasdfgzxcvbyhn])t([qwertasdfgzxcvb])\>/$1y$2/
# - derive/\<([qwertasdfgzxcvbyhn])g([qwertasdfgzxcvb])\>/$1h$2/
# - derive/\<([qwertasdfgzxcvbyhn])b([qwertasdfgzxcvb])\>/$1n$2/
# - derive/\<([qwertasdfgzxcvbyhn]{2})[qwertasdfgzxcvb]\>/$1/ # 前兩碼簡拼
# - derive/\<([qwertasdfgzxcvbyhn]{2})[qwert]\>/$1y/
# - derive/\<([qwertasdfgzxcvbyhn]{2})[asdfg]\>/$1h/
# - derive/\<([qwertasdfgzxcvbyhn]{2})[zxcvb]\>/$1n/
# - derive/\<([qwertasdfgzxcvbyhn])([qwertasdfgzxcvbyhn]{2})\>/$2/ # 後兩碼簡拼
# 變形
- xlit/qwertasdfgzxcvb/QWERTASDFGZXCVB/
stroke_lookup:
tag: stroke_lookup
dictionary: stroke
enable_completion: true
prefix: "~"
suffix: "'"
tips: 〔筆畫反查〕
preedit_format:
- xlit/hspnz/一丨丿丶乙/
comment_format: *comment
punctuator:
import_preset: symbols
key_binder:
import_preset: default
bindings:
- { accept: Return, send: "Shift+Return", when: composing }
- { accept: "Shift+Return", send: Return, when: composing }
- { accept: minus, send: minus, when: has_menu }
- { accept: minus, send: Page_Up, when: paging }
# - { accept: minus, send: Page_Up, when: has_menu }
# - { accept: equal, send: Page_Down, when: has_menu }
- { accept: comma, send: comma, when: paging }
# - { accept: comma, send: Page_Up, when: paging }
- { accept: period, send: period, when: has_menu }
# - { accept: period, send: Page_Down, when: has_menu }
# - { accept: semicolon, send: 2, when: has_menu }
# - { accept: apostrophe, send: 3, when: has_menu }
- {accept: "Control+Shift+5", toggle: ascii_punct, when: always}
- {accept: "Control+Shift+percent", toggle: ascii_punct, when: always}
- {accept: "Control+Shift+F", toggle: simplification, when: always}
recognizer:
import_preset: default
patterns:
email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"
uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$"
punct: '^/([0-9]0?|[A-Za-z]+)$'
luna_pinyin_lookup: "`[a-z]*'?$"
stroke_lookup: "~[a-z]*'?$"