-
Notifications
You must be signed in to change notification settings - Fork 0
/
DoMiSo_Phing_Im2.schema.yaml
486 lines (473 loc) · 18.1 KB
/
DoMiSo_Phing_Im2.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
# Rime schema
# encoding: utf-8
schema:
schema_id: DoMiSo_Phing_Im2
name: 135拼音法【台語音標+】
version: "0.0.2.11"
author:
- 居正中 <alanjui.1960@gmail.com>
description: |
【輸入類型】:拼音輸入法
【拼音系統】:135拼音法(DoMiSo拼音法)
【拼音字母】:台語音標(TLPA+音標方案)
【字典編碼】:台羅音標
【聲調標示】:
(1) 使用 135 拼音法;
(2) 使用符號標示聲調。
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- echo_translator
- punct_translator
- r10n_translator
- reverse_lookup_translator
filters:
- simplifier
- uniquifier
speller:
#------------------------------------------------------
# 定義使用者按下鍵盤時,輸入法能接受的按鍵
#------------------------------------------------------
# 舒聲 [12357]
# 1: ;
# 2: \
# 3: _ (劃底線符號)
# 5: /
# 6: [N/A]
# 7: -
# 4: [
# 8: ]
# 輕聲及入聲 [48] = 0
# 0: .
#------------------------------------------------------
alphabet: abcdefghijklmnopqrstuvwxyzN;\_/-.[]
initials: abcdefghijklmnopqrstuvwxyz
finals: ;\_/-.[]
delimiter: "'"
use_space: true
algebra:
#--------------------------------------------------------------------------
# 調整字典台語音標字母
# 定義【台語音標】與【音標編碼】的對映關係
#--------------------------------------------------------------------------
# 去除零聲母
- derive/Ø//
# --------------------------------------------------------------------------
# 舌尖前音(齒齦音): z[c], c[ch], j[j], s[s]
- derive/^ts/c/ # 可與台語拼音相容
- derive/^c(?!h)/z/ # ㄗ(拼音字母 c 之後不是接 h 的【c】換成【z】)
- derive/^ch/c/ # ㄘ
#------------------------------------------------------------------
# 變調
#------------------------------------------------------------------
- derive/6/7/
# 舒聲變調(1 2 3 5 7)
- derive/2/1/ # 第二調 → 第一調:高降取高
- derive/5/7/ # 第五調 → 第七調:低升取升
- derive/1/7/ # 第一調 → 第七調:高變中
- derive/7/3/ # 第七調 → 第三調:中變低
- derive/3/2/ # 第三調 → 第二調:低變高降
# - derive/5/3/ # 第五調 → 第三調
# 入聲變調(4 8)
# - derive/(?<![ktp])4/2/ # -ㆷ 第四調 → 第二調
# - derive/(?<![ktp])8/3/ # -ㆷ 第八調 → 第三調
- derive/(?<![ptkh])4/8/ # -ㆷ 第四調 → 第八調
- derive/(?<![ptkh])8/4/ # -ㆷ 第八調 → 第四調
#------------------------------------------------------------------
# 定義【地方腔】與【優勢腔】相容之處理規則
#------------------------------------------------------------------
# - derive/er(ng|k)/i$1/
- derive/er(n|t)/u$1/
- derive/ere/ue/
- derive/er/e/
- xform/er(ng|k)/i$1/
# - xform/er(n|t)/u$1/
# - xform/ere/ue/
# - xform/er/e/
- derive/ei/e/ # 漳州腔
- derive/ur/u/ # 廈門腔
- derive/ou/oo/
- derive/ee/e/ # 漳州/泉州腔
# --------------------------------------------------------------------------
# 【135拼音法】 鼻音韻母
# ann ==> nna ==> Na ==> Ba ==> ㄥㄚ ==> ㆩ
#------------------------------------------------------
- derive/([iu]?(ai|au|[iuaoe]))nn/N$1/
#--------------------------------------------------------------------------
# 入聲韻尾轉換
# -ng ==> -k = ㄎ
# -n ==> -t = ㄊ
# -m ==> -p = ㄆ
- derive/k[48]/k0/ # ㄎ
- derive/t[48]/t0/ # ㄊ
- derive/p[48]/p0/ # ㄆ
- derive/h[48]/h0/ # ㄆ
#--------------------------------------------------------------------------
# 設定讀取 ‘字典’ 漢字拼音的 ‘解析格式'
#--------------------------------------------------------------------------
- derive/^([A-Za-z]+)\d$/$1/
#=======================================================================
# 台語音標之拼音字母輸入【簡化規則】
#=======================================================================
# 可以只用【聲母】音標找漢字
# - abbrev/^([pbmtnlkgzcjshiuc]g?s?h?h?).*/$1/
- abbrev/^([pbmtnlkgzcjsh]g?s?h?h?).*/$1/
#=======================================================================
# 字典編碼轉換按鍵
#=======================================================================
- xlit|12357480|;\_/-[].|
translator:
dictionary: tl_ji_khoo_peh_ue
prism: DoMiSo_Phing_Im2
spelling_hints: 20
always_show_comments: true
initial_quality: 0.75
preedit_format:
#------------------------------------------------------
# 將【台語音標】改成【台羅拼音】
#------------------------------------------------------
# - xform/z/ts/
# - xform/c/tsh/
- xform/ts(?!h)/z/
- xform/tsh/c/
#------------------------------------------------------
# 處理鼻音化韻母
# a/e/i/O/u/uai/iau/ai/au/ia/io/iu/ua/ui
# - xform/([iu]?(ai|au|[iuaoe]|oo))nn/N$1/
#------------------------------------------------------
- xform/N/ⁿ/
#------------------------------------------------------
# 鼻化符號以 ‘上標n’ 顯示
#------------------------------------------------------
- xform/nn(h?)(\d|\>)/$1ⁿ$2/
#------------------------------------------------------
# 定義 ‘調號’ 的 '對映規則'
#------------------------------------------------------
- xlit|;\_/-[].|12357480|
comment_format:
# 【千萬別做】拼音字母編碼與注音符號對映的設定
# - xlit|pbPmtTnlkgKwzcsjZCShiIuUaAeEOQo@yYxX}{][RWMNB123570|ㄅㆠㄆㄇㄉㄊㄋㄌㄍㆣㄎㄫㄗㄘㄙㆡㄐㄑㄒㄏㄧㆪㄨㆫㄚㆩㄝㆥㄛㆧㄜㄢㄞㆮㄠㆯㆱㆰㆲㄤㆨㆭㆬㄣㄪˉˋ_ˇ+˙|
#======================================================
# 拼音系統設定 (TL:台羅拼音;TLPA:台語音標)
# TLPA+ : ts(TL) ==> c(TLPA) ==> z(TLPA+)
# TLPA+ : tsh(TL) ==> ch(TLPA) ==> c(TLPA+)
#======================================================
# 連續輸入拼音分隔符號】換成空白
- xform/'/ /
#------------------------------------------------------
# 舌尖前音(齒齦音): 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/ # 聲調 6 改為 7
#======================================================
# 令候選字視窗,可顯示兩組「拼音/注音」
# 左邊:拼音(TLPA 拼音字母);右邊:注音符號。
#======================================================
# 為候選字之拼音字母,建立轉換格式
#------------------------------------------------------
- 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]|oo))nn/ⁿ$1/
#------------------------------------------------------
# 定義 ‘聲母’ 在 ‘拼音字母’ 與 ‘方音符號’ 對映規則
#------------------------------------------------------
# 消除【零聲母】
- xform/(《)Ø/$1/
#------------------------------------------------------
# 舌齒音
# 舌齒音後接韻母ㄧ
- xform/《zi/ㄐㄧ《/
- xform/《ci/ㄑㄧ《/
- xform/《si/ㄒㄧ《/
- xform/《ji/ㄖㄧ《/
# 標準舌齒音
- xform/《z/ㄗ《/
- xform/《c/ㄘ《/
- xform/《s/ㄙ《/
- xform/《j/ㄖ《/
#------------------------------------------------------
# 唇音(不送氣音/送氣音/濁音/鼻音)
# - xform/《b/ㆠ《/
# - xform/《b/ㄅㄏ《/
- xform/《ph/ㄆ《/
- xform/《p(?!h)/ㄅ《/
- xform/《m(?!\d)/ㄇ《/ # m 後,非接調號值,才能當聲母
- xform/《b/《/
#------------------------------------------------------
# 舌根音
# - xform/《g/ㆣ《/
# - xform/《g/ㄍㄏ《/
- xform/《kh/ㄎ《/
- xform/《k(?!h)/ㄍ《/
- xform/《ng(?!\d)/ㄥ《/ # ng 後,非接調號值,才能當聲母
- xform/《g/《/
#------------------------------------------------------
# 舌尖音
- xform/《th/ㄊ《/
- xform/《t(?!h)/ㄉ《/
- 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)/$1ㄝ《/
#------------------------------------------------------
# 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//
#------------------------------------------------------
# 鼻音韻尾
# 陽聲韻: 姆[m-] / 鋼[ng-] / n
#------------------------------------------------------
# - xform/《ng/ㆭ《/
# - xform/《m/ㆬ《/
- xform/《m/ㄇ《/
- xform/《ng/ㄥ《/
- xform/《n/ㄣ《/
#------------------------------------------------------
# 入聲韻 p t k h
# - xform/《p/ㄆ《/
# - xform/《t/ㄊ《/
# - xform/《k/ㄎ《/
# - xform/《h/ㄏ《/
# - xform/《p/ㆴ《/
# - xform/《t/ㆵ《/
# - xform/《k/ㆶ《/
# - xform/《h/ㆷ《/
# - xform/《k/ㆻ《/
- xform/《p/《/
- xform/《t/《/
- xform/《k/《/
- xform/《h/《/
#------------------------------------------------------
# 校調
#------------------------------------------------------
# - xform/ㄧㆭ/ㄧㄥ/
- xform/ㄗㄧ/ㄐㄧ/
- xform/ㄘㄧ/ㄑㄧ/
- xform/ㄙㄧ/ㄒㄧ/
#------------------------------------------------------
# 轉換成聲調符號
#------------------------------------------------------
# 將【聲調數值】轉換成【聲調符號】
# - xform/《0/˙/
# - xform/《1/ˉ/
# - xform/《2/ˋ/
# - xform/《3/'/
# - xform/《5/ˇ/
# - xform/《7/"/
# - xform/《8/ˊ/
# - xform/《4//
- xform/《//
- "xlit 123456780 ¹²³⁴⁵⁶⁷⁸⁰"
#======================================================
# 調整候選字視窗左半邊
#======================================================
# 左半邊 `零聲母` 不顥示處理 。
# 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))/N$1/
#------------------------------------------------------
# 顯示調號:標調務必放在 ’零聲母處理‘ 及 ’鼻音韻母顯示‘ 之後
- xform/0(?=〕)/⁰/
- xform/1(?=〕)/¹/
- xform/2(?=〕)/²/
- xform/3(?=〕)/³/
- xform/4(?=〕)/⁴/
- xform/5(?=〕)/⁵/
- xform/6(?=〕)/⁶/
- xform/7(?=〕)/⁷/
- xform/8(?=〕)/⁸/
#------------------------------------------------------
# 微調輸出
#------------------------------------------------------
- xform/Ø//
reverse_lookup:
dictionary: luna_pinyin
prefix: "`"
tips: 〔拼音〕
preedit_format:
- xform/([nljqxy])v/$1ü/
key_binder:
import_preset: default
bindings:
#---------------------------------------------------
# 使用【_】鍵,輸入【調號】:3 (低音調)
- { when: composing, accept: underscore, send: underscore }
- { when: has_menu, accept: underscore, send: underscore }
#---------------------------------------------------
# 使用【-】鍵,輸入【調號】: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: comma, send: Page_Up, when: has_menu } # 選下一個字
# - { accept: period, send: Page_Down, when: has_menu } # 選上一個字
- { accept: "Control+p", send: Page_Up, when: composing }
- { accept: "Control+n", send: Page_Down, when: composing }
#---------------------------------------------------
# 翻頁
# - { accept: comma, send: Page_Up, when: has_menu } # 選下一個字
# - { accept: period, send: Page_Down, when: has_menu } # 選上一個字
- { 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 }
#---------------------------------------------------
- {accept: "Control+1", select: .next, when: always}
- {accept: "Control+2", toggle: full_shape, when: always}
- {accept: "Control+3", toggle: simplification, when: always}
- {accept: "Control+4", toggle: extended_charset, when: always}
editor:
bindings:
space: confirm # 選擇「備選漢字」
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: [ ①, ②, ③, ④, ⑤ ] # 修改候選標籤
page_size: 5 #選單每䈎顯示個數
style:
horizontal: false
recognizer:
import_preset: default
patterns:
reverse_lookup: "`[a-z]*$"
punct: '`[^\s]$'
punctuator:
import_preset: piau_tian_hu_ho