-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_bopomofo.schema.yaml
783 lines (755 loc) · 30 KB
/
my_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
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
# Rime schema
# encoding: utf-8
schema:
schema_id: my_bopomofo
name: 我的注音
version: '0.0.2.10'
author:
- 居正中 AlanJui <alanjui.1960@gmail.com>
description: |
【輸入類型】:注音輸入法
【拼音系統】:方音符號
【注音符號】:方音符號
【字典編碼】:台羅音標
【聲調標示】:
(1) 台羅八聲調;
(2) 使用數值標示聲調,以利閱讀。
dependencies:
- stroke
switches:
- name: ascii_mode
reset: 0
states: [漢文, ABC]
- name: full_shape
reset: 0
states: [半形, 全形]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- fluency_editor
#### 0.2 版 (含) 之前使用的是沒有佇列功能的 express_editor。
#### 為了更彈性地選字,0.3 板之後換為 fluency_editor。
# - express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- affix_segmentor@learning
- affix_segmentor@zhuyin
# - affix_segmentor@pinyin
- punct_segmentor
- fallback_segmentor
# - affix_segmentor@custom_reverse_lookup
translators:
# - echo_translator
- punct_translator
- script_translator
# - r10n_translator # aka script_translator
# - reverse_lookup_translator
- script_translator@learning
# - table_translator@bopomo_onion_phrase
- script_translator@zhuyin
filters:
- simplifier
- uniquifier
- reverse_lookup_filter@tsuim_reverse_lookup_hidepinyin
- reverse_lookup_filter@tsuim_reverse_lookup
# - reverse_lookup_filter@bpm_reverse_lookup
speller:
alphabet: '1q!a2wsxedE?cyhnbYHNBuj8ik,9l-UJ*I<(Lmp/0;:. 43657'
initials: '1q!a2wsxedE?cyhnbYHNBuj8ik,9l-UJ*I<(Lmp/0;:.'
finals: ' 43657'
delimiter: "'"
use_space: true
algebra:
#--------------------------------------------------------------------------
# 調整字典台語音標字母
# 定義【台語音標】與【音標編碼】的對映關係
#--------------------------------------------------------------------------
# 去除零聲母
- derive/Ø//
#------------------------------------------------------------------
# 變調
#------------------------------------------------------------------
- derive/6/7/
# 舒聲變調(1 2 3 5 7)
- derive/1/7/ # 第一調 → 第七調
- derive/2/1/ # 第二調 → 第一調
- derive/3/2/ # 第三調 → 第二調
- derive/7/3/ # 第七調 → 第三調
- derive/5/7/ # 第五調 → 第七調
- derive/5/3/ # 第五調 → 第三調
# 入聲變調(4 8)
# - derive/(?<![ktp])4/2/ # -ㆷ 第四調 → 第二調
# - derive/(?<![ktp])8/3/ # -ㆷ 第八調 → 第三調
- derive/(?<![ptkh])4/8/ # -ㆷ 第四調 → 第八調
- derive/(?<![ptkh])8/4/ # -ㆷ 第八調 → 第四調
#------------------------------------------------------
# 設定韻母的【注音編碼】
#------------------------------------------------------
# 元音調母 oo [ɔ] = O
- xform/oo/O/ # ㆦ (O) = oo
# 複合韻母拼音編碼
- xform/ai/y/ # ㄞ (y) = ai
- xform/au/x/ # ㄠ (x) = au
#------------------------------------------------------
# 鼻音韻母
# ann ==> nna ==> Na ==> Ba ==> ㄥㄚ ==> ㆩ
#------------------------------------------------------
# 設定鼻音韻母代表拼音字母
- xform/([aiueoyx])nn/B$1/ # 鼻音韻母以【拼音字母編碼】以 B 代表
# 元音鼻音韻母
- xform/Ba/A/ # ㆩ (A) = ann
- xform/Bi/I/ # ㆪ (I) = inn
- xform/Bu/U/ # ㆫ (U) = unn
- xform/Be/E/ # ㆥ (E) = enn
- xform/Bo/Q/ # ㆧ (Q) = oonn
# 複合鼻音韻母
- xform/By/Y/ # ㆮ (Y) = ainn
- xform/Bx/X/ # ㆯ (X) = aunn
# --------------------------------------------------------------------------
# 鼻音韻尾(m/ng/n)拼音字母編碼
# m :預設當【聲母ㄇ】
- xform/m(?=\d)/M/ # ㆬ (M) = -m: m 後接調號,當【韻尾韻母】ㆬ = ㄇ
# ng :預設當【韻母ㆭ】
- xform/ng(?=\d)/W/ # ㆭ (W) = -ng:ng 後接調號,當【韻尾韻母】ㆭ = ㄥ
# n :預設當【聲母ㄋ】)
- xform/n(?=\d)/N/ # ㄣ (N) = -n: n 後接調號,當【韻尾韻母】ㄣ,
#------------------------------------------------------
# 鼻音韻尾韻母
# - xform/aM/{/ # ㆰ ({) = am
# - xform/OM/}/ # ㆱ (}) = om
- xform/aW/L/ # ㄤ (L) = ang
- xform/OW/H/ # ㆲ (H) = ong
- xform/aN/@/ # ㄢ (@) = an
#------------------------------------------------------------------
# 地方腔韻母
- xform/ir/R/ # ㆨ = ir
# --------------------------------------------------------------------------
# 特殊處理規則
# --------------------------------------------------------------------------
# 以下韻母,其拼音字母 o ,實為 oo ,國際音標為:[ɔ]
# iong / iok
- xform/io(?=(ng|k))/iO/
# om / op ; ong / ok
- xform/o(?=[MpWk])/O/
#------------------------------------------------------------------
# 【地方腔】相容規則
#------------------------------------------------------------------
- derive/er([Wk])/i$1/
- derive/er([Nt])/u$1/
- derive/ere/ue/
- derive/er/e/
- derive/ei/e/ # 漳州腔
- derive/ur/u/ # 廈門腔
- derive/ou/O/
- derive/ee/e/ # 漳州/泉州腔
#------------------------------------------------------------------
# 聲母用台語音標編碼
# - 雙唇音: p, ph, b, m
# - 舌尖中音(齒齦音): t, th, n, l
# - 舌根音(軟顎音): k, kh, g, ng
# - 舌尖前音(齒齦音): c, ch, j, s
# - 喉音(聲門音):h
# --------------------------------------------------------------------------
# 舌尖前音(齒齦音): z[c], c[ch], j[j], s[s]
- xform/^ts/c/ # 與台羅拼音相容 (ts=z, tsh=c)
- xform/^c(?!h)/z/ # ㄗ (z) = c = ts (c 後非 h )
- xform/^ch/c/ # ㄘ (c) = ch = tsh
# Zi-[zi-], Ci-[ci-], Si-[si-], Ji- [ji-]
- derive/^z(?=i)/Z/ # ㄗ --> ㄐ
- derive/^c(?=i)/C/ # ㄘ --> ㄑ
- derive/^s(?=i)/S/ # ㄙ --> ㄒ
- derive/^j(?=i)/J/ # ㆡ --> ㆢ
#------------------------------------------------------------------
# 雙唇音: p[p], P[ph], b[b], m[m]
- xform/^ph/P/ # ㄆ (P) = ph
- derive/^b/ph/ # ㆠ (b) = b = ㄅㄏ
# --------------------------------------------------------------------------
# 舌尖中音(齒齦音): t[t], T[th], n[n], l[l]
- xform/^th/T/ # ㄊ (T) = th
# --------------------------------------------------------------------------
# 舌根音(軟顎音): k[k], K[kh], g[g], ng[ng]
- xform/^kh/K/ # ㄎ (K) = kh
- derive/^g/kh/ # ㆣ (g) = g = ㄍㄏ
# ng 可為聲母,亦可為韻母
- xform/^ng(\D)/w/ # ㄫ (w) = ng :ng 後面不接【數值】(即【調號】)
#--------------------------------------------------------------------------
# 入聲韻尾轉換
# (1) -m ==> -p
# (2) -n ==> -t
# (3) -ng ==> -k
#
# (1) ap, ip, iap,
# (2) at, it, ut, iat, uat
# (3) ak, ik, ok, iak, iok
# (4) ah, ih, uh, eh, ooh, oh, aih, auh, iah, iuh, ioh, uah, uih, ueh, iauh, uaih
#--------------------------------------------------------------------------
# - xform/(a|i|ia)p[48]/${1}P0/
# - xform/(a|i|u|ia|ua)t[48]/${1}T0/
# - xform/(a|i|O|ia|iO)k[48]/${1}K0/
# - xform/(a|i|u|e|O|o|Y|x|ia|iu|iO|ua|ui|ue|ix|uy)h[48]/$1h0/
#--------------------------------------------------------------------------
- xform/[48]/0/ # 設定【入聲】之【聲調】值,不論4或8,皆以0代
#--------------------------------------------------------------------------
# 設定讀取 ‘字典’ 漢字拼音的 ‘解析格式'
#--------------------------------------------------------------------------
- derive/^([A-Za-z]+)\d$/$1/
#=======================================================================
# 台語音標之拼音字母輸入【簡化規則】
#=======================================================================
# 可只輸入:【聲母】與【調號】
- abbrev/^([pPbmtTnlkKgwhzcsj]).+/$1/
# 用 n 代表所有的鼻音母音
# - abbrev/([iu]B?[aiueoyx])/B/
# - abbrev/([iu]?[AIUEQYX])/B/
- abbrev/[AIUEQYX]/B/
# 平、上、去聲漢字,可以免輸入調號(1/2/3/5/7);但【去聲】(調號:4/8)不適用
- abbrev/^(\D+)([12357])$/$1/
# - abbrev/[iuaOoeyxMLQYBDG]+0/0/ # 用 . 代表所有的入聲韻母
# - abbrev/[iuaOoeyxMLQYMNW]+0/0/ # 用 . 代表所有的入聲韻母
#-----------------------------------------------------------------------
# 字典編碼轉換按鍵
# 定義【拼音字元編碼】與【鍵盤按鍵】對映關聯
#-----------------------------------------------------------------------
- "xlit|pPbmtTnlkKgwhzcsjZCSJiuaOoeyxRIUAQEYXMNW@LHB123570|1q!a2wsxedE?cyhnbYHNBuj8ik,9l-UJ*I<(Lmp/0;:. 43657|"
translator:
dictionary: tl_ji_khoo_peh_ue
prism: tlpa_holok_hong_im
spelling_hints: 20
always_show_comments: true
initial_quality: 0.75
preedit_format:
#--------------------------------------------------------------------------
# 按鍵轉注音符號:定義鍵盤【按鍵】與【注音符號】的對映關聯
# 操作輸入法時,在輸入介面壓下的【按鍵】,與之對映的注音符號(ㄅㄆㄇ),
# 將根據此處的定義,於輸入介面顯示相對應的注音符號
#--------------------------------------------------------------------------
- xform/ /ˉ/
- xform/'/ /
#--------------------------------------------------------------------------
# 定義【鍵盤按鍵】與【注音符號】對映關聯
#--------------------------------------------------------------------------
- xlit|1q!a2wsxedE?cyhnbYHNBuj8ik,9l-UJ*I<(Lmp/0;:.43657|ㄅㄆㆠㄇㄉㄊㄋㄌㄍㄎㆣㄥㄏㄗㄘㄙㆡㄐㄑㄒㆢㄧㄨㄚㆦㄜㆤㄞㄠㆨㆪㆫㆩㆧㆥㆮㆯㆬㄣㆭㄢㄤㆲnˋ˪ˊ˫˙|
#--------------------------------------------------------------------------
# 聲母校調
#--------------------------------------------------------------------------
# - xform/ㄅㄏ/ㆠ/
# - xform/ㄍㄏ/ㆣ/
- xform/ㄗ(ㄧ|ㆪ)/ㄐ$1/
- xform/ㄘ(ㄧ|ㆪ)/ㄑ$1/
- xform/ㄙ(ㄧ|ㆪ)/ㄒ$1/
- xform/ㆡ(ㄧ|ㆪ)/ㆢ$1/
- xform/ㄗnㄧ/ㄐㆪ/
- xform/ㄘnㄧ/ㄑㆪ/
- xform/ㄙnㄧ/ㄒㆪ/
- xform/ㆡnㄧ/ㆢㆪ/
#--------------------------------------------------------------------------
# 韻母校調
#--------------------------------------------------------------------------
- xform/ㄚㄧ/ㄞ/ # ai
- xform/ㄚㄨ/ㄠ/ # au
- xform/ㄚㆭ/ㄤ/ # ang
- xform/ㄚㄣ/ㄢ/ # an
- xform/ㄚㆬ/ㆰ/ # am
- xform/ㆦㆭ/ㆲ/ # ong
- xform/ㆦㆬ/ㆱ/ # om
- xform/ㄧㆭ/ㄧㄥ/ # ing
#--------------------------------------------------------------------------
# 鼻音韻母轉換
#--------------------------------------------------------------------------
# 複合鼻音韻母
- xform/nㄧㄚ/ㄧㆩ/ # iann = Nia
- xform/nㄧㄠ/ㄧㆯ/ # iaunn = Niau
- xform/nㄧㄨ/ㄧㆫ/ # iunn = Niu
- xform/nㄨㄚ/ㄨㆩ/ # uann = Nua
- xform/nㄨㄞ/ㄨㆮ/ # uainn = Nuai
- xform/nㄨㄧ/ㄨㆪ/ # uinn = Nui
# 元音韻母
- xform/nㄧ/ㆪ/
- xform/nㄨ/ㆫ/
- xform/nㄚ/ㆩ/
- xform/nㆦ/ㆧ/
- xform/nㆤ/ㆥ/
# 複合韻母
- xform/nㄞ/ㆮ/
- xform/nㄠ/ㆯ/
#------------------------------------------------------
# 入聲韻 p t k h
- xform/ㄅ(˙)/ㆴ$1/ # ㄅ/ㄆ
- xform/ㄉ(˙)/ㆵ$1/ # ㄉ/ㄊ
- xform/ㄍ(˙)/ㆻ$1/ # ㄍ/ㄎ
- xform/ㄏ(˙)/ㆷ$1/ # ㄏ
comment_format:
#======================================================
# 速簡對映法
#======================================================
- xform/^ts/c/ # 可與台語拼音相容
- xform/Ø//
- xform/6/7/
# 連續輸入用【拼音分隔符號】換成空白
- xform/'/ /
#------------------------------------------------------
# 為候選字之拼音字母,建立轉換格式
#------------------------------------------------------
- xform/^([Øa-z]+\d)$/〔$1〕/
#------------------------------------------------------
# 鼻音韻母
# ann ==> nna ==> Na ==> Ba ==> ㄥㄚ ==> ㆩ
#------------------------------------------------------
# - xform/nn/N/
# - xform/n/ⁿ/
- xform/([iu]?(ai|au|[iuaoe]))nn/ⁿ$1/
#------------------------------------------------------------------
# 定義【地方腔】與【優勢腔】相容之處理規則
#------------------------------------------------------------------
- xform/er(ng|k)/i$1/
- xform/er(n|t)/u$1/
- xform/ere/ue/
- xform/er/e/
- xform/ei/e/ # 漳州腔
- xform/ur/u/ # 廈門腔
- xform/ou/oo/
- xform/ee/e/ # 漳州/泉州腔
#------------------------------------------------------
# 聲母用台語音標編碼
# - 雙唇音: p, ph, b, m
# - 舌尖中音(齒齦音): t, th, n, l
# - 舌根音(軟顎音): k, kh, g, ng
# - 舌尖前音(齒齦音): c, ch, j, s
# - 喉音(聲門音):h
# --------------------------------------------------------------------------
# 雙唇音: p[p], P[ph], b[b], m[m]
- xform/ph/P/ # ㄆ
# --------------------------------------------------------------------------
# 舌尖中音(齒齦音): t[t], T[th], n[n], l[l]
- xform/th/T/ # ㄊ
# --------------------------------------------------------------------------
# 舌根音(軟顎音): k[k], K[kh], g[g], ng[ng]
- xform/kh/K/ # ㄎ
# ng 可為聲母,亦可為韻母
- xform/ng(?![1-9])/w/ # ng 當【聲母】ㄫ:ng 後面不接調號 (也就是說 ng 後面會有一個母音) 時,ng 為 ㄫ
# --------------------------------------------------------------------------
# 舌尖前音(齒齦音): z[c], c[ch], j[j], s[s]
- xform/c(?!h)/z/ # ㄗ(拼音字母 c 之後不是接 h 的【c】換成【z】)
- xform/ch/c/ # ㄘ
# --------------------------------------------------------------------------
# Zi-[zi-], Ci-[ci-], Si-[si-], Ji-[ji-]
# - xform/z(?=i)/Z/ # ㄗ --> ㄐ
# - xform/c(?=i)/C/ # ㄘ --> ㄑ
# - xform/s(?=i)/S/ # ㄙ --> ㄒ
# - xform/j(?=i)/J/ # ㆡ --> ㆢ
# --------------------------------------------------------------------------
# 韻母用台語音標編碼
# --------------------------------------------------------------------------
# 元音調母 oo [ɔ] = O
- xform/oo/O/ # ㆦ (1)
# 鼻音韻尾 ioo [iɔ] : iong ==> iok
- xform/io(?=(ng|k))/iO/
# 鼻音韻尾 oo [ɔ] : om ==> op / ong ==> ok
- xform/o(?=(m|ng|p|k))/O/
#------------------------------------------------------------------
# 韻母
- xform/ai/y/ # ㄞ = ai
- xform/au/x/ # ㄠ = au
- derive/ann/A/ # ㆩ = ann
- derive/inn/I/ # ㆪ = inn
- derive/unn/U/ # ㆫ = unn
- derive/enn/E/ # ㆥ = enn
- derive/onn/Q/ # ㆧ = oonn
- derive/ynn/Y/ # ㆮ
- derive/xnn/X/ # ㆯ
- derive/ang/[/ # ㄤ = ang
- derive/am/{/ # ㆰ = am
- derive/an/@/ # ㄢ = an
- derive/Ong/]/ # ㆲ = ong
- derive/Om/}/ # ㆱ = om
- derive/ir/R/ # ㆨ = ir
#------------------------------------------------------------------
# 鼻音韻尾(m/ng/n)拼音字母編碼
#------------------------------------------------------------------
# -m (韻化輔音):預設當【聲母ㄇ】
- xform/m(?=\d)/M/ # m 當【韻母】ㄇ = ㆬ (方音符號)
# -ng (韻化輔音):預設當【韻母ㄥ】 = ㆭ (方音符號)
- xform/ng(?=\d)/W/ # ng 當【聲母】ㄥ = ㄫ (方音符號)
# -n (預設為【聲母ㄋ】)
- xform/n(?=\d)/N/ # n 當【韻母】ㄣ:拼音字母 n 後接調號,表:韻尾,
#--------------------------------------------------------------------------
# 入聲韻尾轉換
# (1) -m ==> -p
# (2) -n ==> -t
# (3) -ng ==> -k
#
# (1) ap, ip, iap,
# (2) at, it, ut, iat, uat
# (3) ak, ik, ok, iak, iok
# (4) ah, ih, uh, eh, ooh, oh, aih, auh, iah, iuh, ioh, uah, uih, ueh, iauh, uaih
#--------------------------------------------------------------------------
# - xform/(a|i|ia)p[48]/${1}P0/
# - xform/(a|i|u|ia|ua)t[48]/${1}T0/
# - xform/(a|i|O|ia|iO)k[48]/${1}K0/
# - xform/(a|i|u|e|O|o|Y|x|ia|iu|iO|ua|ui|ue|ix|uy)h[48]/$1h0/
#--------------------------------------------------------------------------
- xform/p([48])/ㆴ$1/
- xform/t([48])/ㆵ$1/
- xform/k([48])/ㆶ$1/
- xform/h([48])/ㆷ$1/
#--------------------------------------------------------------------------
- "xlit|pbPmtTnlkgKhzcsjZCSwiuMaOoeyxN@N[WRIUAQEYX}{]|ㄅㆠㄆㄇㄉㄊㄋㄌㄍㆣㄎㄏㄗㄘㄙㆡㄐㄑㄒㄫㄧㄨㆬㄚㆦㄜㆤㄞㄠnㄢㄣㄤㆭㆨㆪㆫㆩㆧㆥㆮㆯㆱㆰㆲ|"
- "xlit 123456780 ¹²³⁴⁵⁶⁷⁸⁰"
#======================================================
# 拼音系統設定
#======================================================
# 舌尖前音(齒齦音): z[c], c[ch], j[j], s[s]
- derive/^ts/c/ # 可用羅馬拼音
- derive/^c(?!h)/z/ # ㄗ(拼音字母 c 之後不是接 h 的【c】換成【z】)
- derive/^ch/c/ # ㄘ
- xform/6/7/
#======================================================
# 令候選字視窗,可顯示兩組「拼音/注音」
# 左邊:拼音(TLPA 拼音字母);右邊:注音符號。
#======================================================
# 連續輸入用【拼音分隔符號】換成空白
- xform/'/ /
#------------------------------------------------------
# 為候選字之拼音字母,建立轉換格式
#------------------------------------------------------
- xform/^([Øa-z]+\d)$/〔$1〕【《$1】/
#------------------------------------------------------
# 處理鼻音化韻母
# a/e/i/O/u/uai/iau/ai/au/ia/io/iu/ua/ui
#------------------------------------------------------
- xform/([iu]?(ai|au|[iuaoe]))nn/ⁿ$1/
#------------------------------------------------------
# 定義 ‘聲母’ 在 ‘拼音字母’ 與 ‘方音符號’ 對映規則
#------------------------------------------------------
# 舌齒音
- xform/《zi/ㄐㄧ《/
- xform/《ci/ㄑㄧ《/
- xform/《si/ㄒㄧ《/
- xform/《ji/ㆢㄧ《/
- xform/《Zi/ㄐㄧ《/
- xform/《Ci/ㄑㄧ《/
- xform/《Si/ㄒㄧ《/
- xform/《Ji/ㆢㄧ《/
- xform/《z/ㄗ《/
- xform/《c/ㄘ《/
- xform/《s/ㄙ《/
- xform/《j/ㆡ《/
#------------------------------------------------------
# 唇音(不送氣音/送氣音/濁音/鼻音)
- xform/《ph/ㄆ《/
- xform/《p(?!h)/ㄅ《/
- xform/《m(?!\d)/ㄇ《/ # m 後,非接調號值,才能當聲母
- xform/《b/ㆠ《/
# - xform/《b/ㄅㆷ《/
#------------------------------------------------------
# 舌根音
- xform/《k(?!h)/ㄍ《/
- xform/《kh/ㄎ《/
- xform/《ng(?!\d)/ㄫ《/ # ng 後,非接調號值,才能當聲母
- xform/《g/ㆣ《/
# - xform/《g/ㄍㆷ《/
#------------------------------------------------------
# 舌尖音
- xform/《t(?!h)/ㄉ《/
- xform/《th/ㄊ《/
- xform/《n(?!g)/ㄋ《/
- xform/《l/ㄌ《/
#------------------------------------------------------
# 喉音
- xform/《h/ㄏ《/
#------------------------------------------------------
# 鼻韻符號轉換 Na = 鼻ㄚ = ㆩ
#------------------------------------------------------
- xform/《ⁿ/《N/
#------------------------------------------------------
# i
#------------------------------------------------------
# 姜 iang / 堅 ian / 兼 iam
- xform/《iang/ㄧㄤ《/
- xform/《ian/ㄧㄢ《/
- xform/《ia([kt])/ㄧㄚ《$1/
- xform/《ia(m|p)/ㄧㄚ《$1/
# 經 ing / 巾 in / 金 im
- xform/《i(ng|k)/ㄧ《$1/
- xform/《i(n|t)/ㄧ《$1/
- xform/《i(m|p)/ㄧ《$1/
# 嘄 Niau / 嬌 iau
- xform/《(N?)(iau)/$1ㄧㄠ《/
# 驚 Nia / 迦 ia
- xform/《(N?)(ia)/$1ㄧㄚ《/
# 㳟 iong
- xform/《io(ng|k)/ㄧㆦ《$1/
# 薑 Nio / 茄 io
- xform/《(N?)(io)/$1ㄧㄜ《/
# 牛 Niu / 丩 iu
- xform/《(N?)(iu)/$1ㄧㄨ《/
# 泉腔
# - xform/《ir/ㄦ《/ # ㆨㄦ : 豬(ㄉㆨ tir,海口腔)、
- xform/《ir/ㆨ《/ # ㆨㄦ : 豬(ㄉㆨ tir,海口腔)、
# 梔 Ni / 居 i
- xform/《(N?)(i)/$1ㄧ《/
#------------------------------------------------------
# u
#------------------------------------------------------
# 閂 Nuai / 乖 uai
- xform/《(N?)(uai)/$1ㄨㄞ《/
# 光 uang / 觀 uan
- xform/《uang/ㄨㄤ《/
- xform/《uan/ㄨㄢ《/
- xform/《ua([kt])/ㄨㄚ《$1/
# 官 Nua / 瓜 ua
- xform/《(N?)(ua)/$1ㄨㄚ《/
# 褌 Nui / 規 ui
- xform/《(N?)(ui)/$1ㄨㄧ《/
# 糜 Nue / 檜 ue
- xform/《(N?)(ue)/$1ㄨㄝ《/
# 君 un
- xform/《u(n|t)/ㄨ《$1/
# 方音
- xform/《ur/ㄨ《/
# 艍 u
- xform/《u/ㄨ《/
#------------------------------------------------------
# a
#------------------------------------------------------
# 江 ang / 干 an / 甘 am
- xform/《ang/ㄤ《/
- xform/《an/ㄢ《/
- xform/《a([kt])/ㄚ《$1/
- xform/《a(m|p)/ㄚ《$1/
# 閒 Nai / 皆 ai
- xform/《(N?)(ai)/$1ㄞ《/
# 爻 Nau / 交 au
- xform/《(N?)(au)/$1ㄠ《/
# 監 Na / 膠 a
- xform/《(N?)(a)/$1ㄚ《/
#------------------------------------------------------
# e
#------------------------------------------------------
# 泉腔: erng, erk, eru, ere, ern er
- xform/《er(ng|k)/ㄧ《$1/ # 等 [terng2], 德 [terk4]
- xform/《er(n|t)/ㄧ《$1/ # 【恩】:ern1
- xform/《ere/ㄨㄝ《/ # 火【鷄】:kere1
- xform/《er/ㄜ《/ # 【火】鷄: her2
# 稽 ei / 嘉 ee
# - xform/《ei/ㄝ《/
# - xform/《ee/ㄝ《/
- xform/《ei/ㆤ《/
- xform/《ee/ㆤ《/
# 更 Ne / 伽 e
- xform/《N?(e)/ㆤ《/
#------------------------------------------------------
# oo
#------------------------------------------------------
# 公 ong / 箴 om
- xform/《o(ng|k)/ㆦ《$1/
- xform/《o(m|p)/ㆦ《$1/
# 姑 Noo / 沽 oo
- xform/《(N?)(oo)/$1ㆦ《/
#------------------------------------------------------
# o
#------------------------------------------------------
# 姑 No / 高 o
# - xform/《(N?)(o)/$1ㄛ《/
- xform/《o/ㄜ《/
# 泉州腔
- xform/《or/ㄜ《/
#------------------------------------------------------
# 鼻韻符號轉換 Na = 鼻ㄚ = ㆩ
#------------------------------------------------------
- xform/N/ⁿ/
- xform/ⁿㄧㄠ/ㄧㆯ/
- xform/ⁿㄧㄚ/ㄧㆩ/
- xform/ⁿㄧㄛ/ㄧㆧ/
- xform/ⁿㄧㄨ/ㄧㆫ/
- xform/ⁿㄨㄞ/ㄨㆮ/
- xform/ⁿㄨㄚ/ㄨㆩ/
- xform/ⁿㄨㄧ/ㄨㆪ/
- xform/ⁿㄨㆤ/ㄨㆥ/
- xform/ⁿㄧ/ㆪ/
- xform/ⁿㄨ/ㆫ/
- xform/ⁿㄚ/ㆩ/
- xform/ⁿㆦ/ㆧ/
- xform/ⁿㆤ/ㆥ/
- xform/ⁿㄞ/ㆮ/
- xform/ⁿㄠ/ㆯ/
#------------------------------------------------------
# 鼻音韻尾
# 陽聲韻: 姆[m-] / 鋼[ng-] / n
#------------------------------------------------------
# - xform/《m/ㄇ《/
# - xform/《ng/ㄥ《/
- xform/《m/ㆬ《/
- xform/《ng/ㆭ《/
- xform/《n/ㄣ《/
#------------------------------------------------------
# 入聲韻 p t k h
# - xform/《p/ㄆ《/
# - xform/《t/ㄊ《/
# - xform/《k/ㄎ《/
# - xform/《h/ㄏ《/
# - xform/《k/ㆻ《/
#------------------------------------------------------
- xform/《p/ㆴ《/
- xform/《t/ㆵ《/
- xform/《k/ㆶ《/
- xform/《h/ㆷ《/
#------------------------------------------------------
# 校調
#------------------------------------------------------
- xform/ㄗ(?=ㄧ)/ㄐ/
- xform/ㄘ(?=ㄧ)/ㄑ/
- xform/ㄙ(?=ㄧ)/ㄒ/
- xform/ㆡ(?=ㄧ)/ㆢ/
#------------------------------------------------------
- xform/ㄧㆭ/ㄧㄥ/
- xform/ㄚㆬ/ㆰ/
- xform/ㆦㆭ/ㆲ/
- xform/ㆦㆬ/ㆱ/
- xform/ㄥㄠ/ㆯ/
#------------------------------------------------------
# 轉換成聲調符號
#------------------------------------------------------
# 將【聲調數值】轉換成【聲調符號】
- xform/《0/˙/
- xform/《1/ˉ/
- xform/《2/ˋ/
- xform/《6/ˋ/
- xform/《3/˪/
- xform/《5/ˊ/
- xform/《7/˫/
- xform/《8/˙/
- xform/《4//
#======================================================
# 調整候選字視窗左半邊
#======================================================
# 左半邊 `零聲母` 不顥示處理 。
# 1. 零聲母 + 元音韻母 + 調號,如:Øu5, Øi1, ...
# 2. 零聲母 + 複合韻母 + 調號,如:Øiau1, Øiong2, Øuan2, Øuai1, ....
# 3. 零聲母 + 鼻音化韻母 + 調號,如:Øann1, Øi1, ...
#------------------------------------------------------
- xform/(〔)Ø/$1/
#------------------------------------------------------
# 與 TLPA+【台灣拼音進階版】相容
- xform/z/ts/
- xform/c/tsh/
#------------------------------------------------------
# 處理鼻音化韻母
# a/e/i/O/u/uai/iau/ai/au/ia/io/iu/ua/ui
#------------------------------------------------------
- xform/ⁿ([iu]?(ai|au|[iuaoe]|oo))/$1ⁿ/
#------------------------------------------------------
# 顯示調號:標調務必放在 ’零聲母處理‘ 及 ’鼻音韻母顯示‘ 之後
#------------------------------------------------------
- xform/0(?=〕)/⁰/
- xform/1(?=〕)/¹/
- xform/2(?=〕)/²/
- xform/3(?=〕)/³/
- xform/4(?=〕)/⁴/
- xform/5(?=〕)/⁵/
- xform/6(?=〕)/⁶/
- xform/7(?=〕)/⁷/
- xform/8(?=〕)/⁸/
#------------------------------------------------------
# 微調輸出
#------------------------------------------------------
- xform/Ø//
custom_phrase:
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 1
reverse_lookup:
dictionary: stroke
enable_completion: true
prefix: "`"
suffix: "'"
tips: 〔筆畫〕
preedit_format:
- xlit/hspnz/一丨丿丶乙/
comment_format:
- xform/e?r5$/er5/
- xform/iu/iou/
- xform/ui/uei/
- xform/ong/ung/
- xform/^yi?/i/
- xform/^wu?/u/
- xform/iu/v/
- xform/^([jqx])u/$1v/
- 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/1//
- 'xlit|bpmfdtnlgkhjqxZCSrzcsiuvaoeEAIOUMNKGR2345|ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦˊˇˋ˙|'
key_binder:
import_preset: default
bindings:
#---------------------------------------------------
# 使用【;】鍵,輸入【ㄤ】
- { when: composing, accept: semicolon, send: 'ㄤ' }
- { when: has_menu, accept: semicolon, send: 'ㄤ' }
#---------------------------------------------------
# 使用【-】鍵,輸入【調號】:7 (中音調)
- { when: composing, accept: minus, send: minus }
- { when: has_menu, accept: minus, send: minus }
#---------------------------------------------------
# 使用 【.】鍵,輸入【調號】:0(輕聲及入聲調)
- { when: composing, accept: period, send: period }
- { when: has_menu, accept: period, send: period }
#---------------------------------------------------
# 翻頁
#---------------------------------------------------
- { accept: "Control+p", send: Page_Up, when: composing }
- { accept: "Control+n", send: Page_Down, when: composing }
#---------------------------------------------------
# Vim Mode
#---------------------------------------------------
- { when: has_menu, accept: "Control+h", send: Page_Up }
- { when: has_menu, accept: "Control+l", send: Page_Down }
- { when: has_menu, accept: "Control+k", send: Up }
- { when: has_menu, accept: "Control+j", send: Down }
editor:
bindings:
space: commit # 選擇「備選漢字」
Return: commit_composition # 上屏原始的輸入:lau5
Control+Return: commit_script_text # 上屏顯示的輸入:lau⁵ / lâu
Shift+Return: commit_comment # 上屏候選項備注:ㄉㄚ˪〖柳交五〗
Control+Shift+Return: commit_raw_input # 將 Control+Return 綁定到 Lua 函數
menu:
alternative_select_labels: [ ①, ②, ③, ④, ⑤ ] # 修改候選標籤
alternative_select_keys: 12345 #如編碼字符佔用數字鍵則須另設選字鍵
page_size: 5 #選單每䈎顯示個數
style:
horizontal: false
font_face: "BopomofoRuby1909-v1, Noto Serif TC"
recognizer:
patterns:
email: ^[a-z][-_.0-9a-z]*@.*$
uppercase: ^[A-Z][-_+.'0-9A-Za-z]*$
url: ^(www[.]|https?:|ftp:|mailto:).*$
reverse_lookup: "`[a-z]*'?$"
punct: '`[^\s]$'
punctuator:
import_preset: piau_tian_hu_ho