-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtaigi_tps.schema.yaml
220 lines (208 loc) · 6.65 KB
/
taigi_tps.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
# Rime schema
# encoding: utf-8
schema:
schema_id: taigi_tps
name: 台語方音
version: '0.4'
author:
- Yu-Ren Pan <YuRen.Pan.0117@gmail.com>
description: |
對 bopomofo 來修改
鍵盤對應:
ㄅ ㄉ 3 2 7 5 . ㄚ ㄞ ㄢ n
ㄆ ㄊ ㄍ ㄐ ㆣ ㄗ ㄧ ㆦ ㆤ ㄣ
ㄇ ㄋ ㄎ ㄑ ㄫ ㄘ ㄨ ㄜ ㄠ ㄤ
ㆠ ㄌ ㄏ ㄒ J ㄙ ㆬ ㆰ ㆲ ㆭ
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
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- table_translator@custom_phrase
- script_translator
filters:
- uniquifier
menu:
alternative_select_labels: [ A, B, C, D, E, F, G, H, I, J ]
alternative_select_keys: 'ABCDEFGHIJ'
speller:
alphabet: '1qaz2wsxedcrfvtgbyhnujm8ik,9ol.0p;/- 43657'
initials: '1qaz2wsxedcrfvtgbyhnujm8ik,9ol.0p;/-7'
finals: ' 43567'
delimiter: "'"
use_space: true
algebra:
# 變調
- derive/1/7/ # 第一調 → 第七調
- derive/2/1/ # 第二調 → 第一調
- derive/3/2/ # 第三調 → 第二調
- derive/7/3/ # 第七調 → 第三調
- derive/5/7/ # 第五調 → 第七調
- derive/5/3/ # 第五調 → 第三調
- derive/(?<![BDG])4/2/ # -ㆷ 第四調 → 第二調
- derive/(?<![BDG])8/3/ # -ㆷ 第八調 → 第三調
- xform/[48]/0/ # 入聲調(第四調、第八調)合併
# 音變
- derive/z/d/ # ㆡ、ㆢ → ㄌ
- derive/z(N?i)/g$1/ # ㆢ → ㆣ
- derive/iaD/ieD/ # ㄧㄢ、ㄧㄚㆵ → ㄧㄢ、ㄧㆤㆵ
- derive/ieD/eD/ # ㄧㄢ、ㄧㆤㆵ → ㆤㄣ、ㆤㆵ
# 方言差
- derive/Ne/Ni/ # ㆥ → ㆪ
- derive/Niu/Nio/ # ㄧㆫ → ㄧㆧ
# 方音符號會分 ㆢㄐㄑㄒ 和 ㆡㄗㄘㄙ
#- xform/z(N?i)/Z$1/ # 毋過咱共 ㆢ 和 ㆡ 合併矣
- xform/c(N?i)/j$1/ # ㄐㄧ
- xform/C(N?i)/J$1/ # ㄑㄧ
- xform/s(N?i)/S$1/ # ㄒㄧ
# 方音符號會分 ㄇㄋㄫ 和 ㆠㄌㆣ
- derive/bN/m/ # ㄇ
- derive/dN/n/ # ㄋ
- derive/gN/q/ # ㄫ
- derive/bG/mG/ # ㄇㆭ
- derive/dG/nG/ # ㄋㆭ
# 鼻音
- xform/N([iu]?[iuaoeIU])/$1N/ # 鼻音拍佇後壁
- derive/([iuaoeIU])N/$1$1/ # 拍兩擺韻母來拍鼻音
# 注音
- derive/øG/G/ # 用 ㄧㆭ 來拍 ㄧㄥ(併入)
- derive/(?<!i)oG/uG/ # 用 ㄨㆭ(注音的 ㄨㄥ)來拍 ㆲ
- derive/ioG/BG/ # 用 ㆬㆭ(注音的 ㄩㄥ)來拍 ㄧㆲ
# 入聲調
- derive/([iao])B0/$1p0/ # 用 ㄚㄅ. 來拍 ㄚㆴ
- derive/([iuae])D0/$1t0/ # 用 ㄚㄉ. 來拍 ㄚㆵ
- derive/([iaoø])G0/$1k0/ # 用 ㄚㄍ. 來拍 ㄚㆻ
# 方音韻母
- derive/oB/aB/ # ㆦㆬ、ㆰ(併入)
- derive/aB/M/ # ㄚㆬ、ㆰ
- xform/aD/L/ # ㄢ
- xform/aG/Q/ # ㄤ
- derive/oG/Y/ # ㆦㆭ、ㆲ
# 簡拼
- abbrev/[iu]?[iuaoeIU]N/N/ # 用 n 代表所有的鼻音母音
- abbrev/[iuaoøeIUMLQYBDG]+0/0/ # 用 . 代表所有的入聲韻母
- abbrev/^([pPbmtTdnkKgqcCzsjJSh]).+$/$1/ # 會當干焦拍聲母
- abbrev/^(\D+)([123579])$/$1/ # 除了第四調、第八調,調號會當免拍
- abbrev/^([pPbmtTdnkKgqcCzsjJSh]).+(\d)$/$1$2/ # 會當干焦拍子音+調號
- xlit|pPmbtTndkKhjJSgqzcCsiuBaoøMIeUYLDQGN123570|1qaz2wsxedcrfvtgbyhnujm8ik,9ol.0p;/- 43657|
translator:
dictionary: taigi_yu
prism: taigi_tps
spelling_hints: 3
comment_format:
- xform/^/\t→ /
- xform/'/ /
- xlit|pPbtTdkKgcCzshiuaoøeIUBDGN|ㄅㄆㆠㄉㄊㄌㄍㄎㆣㄗㄘㆡㄙㄏㄧㄨㄚㆦㄜㆤㄞㄠㆬㄣㆭn|
# 方音符號會分 ㆢㄐㄑㄒ 和 ㆡㄗㄘㄙ
- xform/ㄗ((n)?ㄧ)/ㄐ$1/
- xform/ㄘ((n)?ㄧ)/ㄑ$1/
- xform/ㆡ((n)?ㄧ)/ㆢ$1/
- xform/ㄙ((n)?ㄧ)/ㄒ$1/
# 方音符號會分 ㄇㄋㄫ 和 ㆠㄌㆣ
- xform/ㆠn/ㄇ/
- xform/ㄌn/ㄋ/
- xform/ㆣn/ㄫ/
- xform/ㆠㆭ/ㄇㆭ/
- xform/ㄌㆭ/ㄋㆭ/
# 入聲調
- xform/(?<=ㄧ|ㄚ|ㆦ)ㆬ([48])/ㆴ$1/
- xform/(?<=ㄧ|ㄨ|ㄚ)ㄣ([48])/ㆵ$1/
- xform/(?<=ㄚ|ㆦ|ㄜ)ㆭ([48])/ㆻ$1/
- xform/(?<!ㆴ|ㆵ|ㆻ)([48])/ㆷ$1/
# 鼻音
- xform/n((ㄧ|ㄨ)?(ㄧ|ㄨ|ㄚ|ㆦ|ㆤ|ㄞ|ㄠ))/$1n/
- xform/ㄧn/ㆪ/
- xform/ㄨn/ㆫ/
- xform/ㄚn/ㆩ/
- xform/ㆦn/ㆧ/
- xform/ㆤn/ㆥ/
- xform/ㄞn/ㆮ/
- xform/ㄠn/ㆯ/
# 韻母
- xform/ㄚㆬ/ㆰ/
- xform/ㆦㆬ/ㆱ/
- xform/ㄚㄣ/ㄢ/
- xform/ㄚㆭ/ㄤ/
- xform/ㆦㆭ/ㆲ/
- xform/ㄜㆭ/ㄥ/
# 聲調
- xlit|12357|ˉˋ˪ˊ˫|
- xform/4//
- xform/8/˙/
preedit_format:
- xform/ /ˉ/
- xform/'/ /
- xlit|1qaz2wsxedcrfvtgbyhnujm8ik,9ol.0p;/-43657|ㄅㄆㄇㆠㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㆣㄫㆡㄗㄘㄙㄧㄨㆬㄚㆦㄜㆰㄞㆤㄠㆲㄢㄣㄤㆭnˋ˪ˊ˫.|
# 拆韻母
- xform/ㆰ/ㄚㆬ/
- xform/ㄢ/ㄚㄣ/
- xform/ㄤ/ㄚㆭ/
- xform/ㆲ/ㆦㆭ/
- xform/ㄨㆭ/ㆦㆭ/
- xform/ㆬㆭ/ㄧㆦㆭ/
- xform/ㄧㆭ/ㄧㄜㆭ/
# 咱共 ㆢ 和 ㆡ 合併
- xform/ㆡㄧ/ㆢㄧ/
# 鼻音
- xform/ㄧ(ㄧ|n)/ㆪ/
- xform/ㄨ(ㄨ|n)/ㆫ/
- xform/ㄚ(ㄚ|n)/ㆩ/
- xform/ㆦ(ㆦ|n)/ㆧ/
- xform/ㆤ(ㆤ|n)/ㆥ/
- xform/ㄞ(ㄞ|n)/ㆮ/
- xform/ㄠ(ㄠ|n)/ㆯ/
# 入聲調
- xform/(ㄧ|ㄚ|ㆦ)(ㄅ|ㆬ)./$1ㆴ/
- xform/(ㄧ|ㄨ|ㄚ|ㆤ)(ㄉ|ㄣ)./$1ㆵ/
- xform/(ㄚ|ㆦ|ㄜ)(ㄍ|ㆭ)./$1ㆻ/
- xform/(ㄧ|ㄨ|ㄚ|ㆦ|ㄜ|ㆤ|ㄞ|ㄠ|ㆬ|ㆭ)./$1ㆷ/
# 合韻母
- xform/ㄚㆬ/ㆰ/
- xform/ㆦㆬ/ㆱ/
- xform/ㄚㄣ/ㄢ/
- xform/ㄚㆭ/ㄤ/
- xform/ㆦㆭ/ㆲ/
- xform/ㄜㆭ/ㄥ/
custom_phrase:
dictionary: ''
user_dict: custom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 1
punctuator:
import_preset: symbols_yu_alpha
key_binder:
import_preset: default
bindings:
- { when: has_menu, accept: comma, send: comma } # ㆤ
- { when: has_menu, accept: period, send: period } # ㆲ
- { when: has_menu, accept: minus, send: minus } # n
- { when: paging, accept: minus, send: Page_Up }
- { when: has_menu, accept: equal, send: Page_Down }
recognizer:
patterns:
email: ^[a-z][-_.0-9a-z]*@.*$
uppercase: ^[A-Z][-_+.'0-9A-Za-z]*$
url: ^(www[.]|https?:|ftp:|mailto:).*$
punct: '`[^\s]$'