forked from hokkien-writing/rime-teochew
-
Notifications
You must be signed in to change notification settings - Fork 0
/
teochew.schema.yaml
223 lines (208 loc) · 4.8 KB
/
teochew.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
# teochew.schema.yaml
# vim: set sw=2 sts=2 et:
# encoding: utf-8
schema:
schema_id: teochew
name: 潮州話
version: "2024.06.07"
author:
- Hokkien-writing
- Lim <[email protected]>
description: |
潮州話輸入方案
支持白話字及漢字
支持潮州音查詢及地道用詞查詢
詳細內容見:https://github.com/hokkien-writing/rime-teochew
dependencies:
- teochew_mandarin
- luna_pinyin
switches:
- name: ascii_mode
reset: 0
states: [ 中文, ABC ]
- name: ascii_punct
states: [ 。,, ., ]
- name: simplification
states: [ 漢字, 汉字 ]
- name: full_shape
states: [ 半角, 全角 ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- affix_segmentor@mandarin_reverse_lookup
- affix_segmentor@pinyin_reverse_lookup
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- script_translator
- reverse_lookup_translator@mandarin_reverse_lookup
- reverse_lookup_translator@pinyin_reverse_lookup
# - reverse_lookup_translator
filters:
- simplifier
- uniquifier
speller:
alphabet: "pbmtnlkghzcsjPBMTNLKGHZCSJaoeiurAOEIURdfvwxyFVDWXY"
initials: "pbmtnlkghzcsjPBMTNLKGHZCSJaoeiurAOEIURdfvwxyFVDWXY"
# finals: "235678"
delimiter: " -"
use_space: false
auto_select: false
algebra:
# - "erase/^xx$/"
- "xform/[1-8]//" # 去掉聲調
- "derive/^ch(i|e)/ts$1/"
- "derive/^chh(i|e)/tsh$1/"
- "derive/^j(i|e)/z$1/"
- "derive/au/ao"
- "derive/ua/oa"
- "derive/ue/oe"
- "derive/iam$/iem"
- "derive/^l(iem|iam|am)$/n$1/" # n,l
- "derive/iap$/iep"
- "derive/iau$/iou"
- "derive/ua(n|t)$/ue$1"
- "derive/ie(nn|h)$/io$1"
- "derive/ie(n|t)$/ia$1"
- "derive/ie$/io"
- "derive/oi(nn)$/ai$1"
- "abbrev/^([a-z]).+$/$1/" # 簡拼
- "abbrev/^(tsh|chh|ts|ch).+$/$1/" # 簡拼
translator:
dictionary: teochew
# spelling_hints: 3 # 3字內標註完整帶調音碼
prism: teochew_han
enable_sentence: false
enable_completion: false
enable_user_dict: true
# initial_quality: 0.5
recognizer:
# import_preset: default
patterns:
punct: "^/([0-9]0?|[a-z]+)$"
pinyin_lookup: "^f[a-z]*'?$"
mandarin_lookup: "^v[a-z]*'?$"
mandarin_reverse_lookup:
tag: mandarin_lookup
dictionary: teochew_mandarin
prefix: "v"
suffix: "'"
tips: "〔地道用詞查詢〕"
enable_completion: false
enable_sentence: false
preedit_format:
- xform/([nljqxy])v/$1ü/
pinyin_reverse_lookup:
tag: pinyin_lookup
dictionary: luna_pinyin
prefix: "f"
suffix: "'"
tips: "〔潮州音查詢〕"
enable_completion: false
enable_sentence: false
preedit_format:
- xform/([nljqxy])v/$1ü/
# reverse_lookup:
# tags: [ mandarin_lookup, pinyin_lookup ]
# enable_completion: false
# enable_sentence: false
# dictionary: luna_pinyin
# prefix: "f"
# suffix: "'"
# tips: "〔拼音反查〕"
# preedit_format:
# - xform/([nljqxy])v/$1ü/
punctuator:
full_shape:
' ': { commit: ' ' }
',': { commit: , }
'.': { commit: 。 }
'<': [ 《, 〈, «, ‹ ]
'>': [ 》, 〉, », › ]
'/': [ /, ÷ ]
'?': { commit: ? }
';': { commit: ; }
':': { commit: : }
'''': { pair: [ '‘', '’' ] }
'"': { pair: [ '“', '”' ] }
'\': [ 、, \ ]
'|': [ ·, |, '§', '¦' ]
'`': `
'~': ~
'!': { commit: ! }
'@': [ @, ☯ ]
'#': [ #, ⌘ ]
'%': [ %, '°', '℃' ]
'$': [ ¥, '$', '€', '£', '¥', '¢', '¤' ]
'^': { commit: …… }
'&': &
'*': [ *, ·, ・, ×, ※, ❂ ]
'(': (
')': )
'-': -
'_': ——
'+': +
'=': =
'[': [ 「, 【, 〔, [ ]
']': [ 」, 】, 〕, ] ]
'{': [ 『, 〖, { ]
'}': [ 』, 〗, } ]
half_shape:
',': ','
'.': '。'
'<': '《'
'>': '》'
'/': '/'
'?': '?'
';': ';'
':': ':'
'''': { pair: [ '‘', '’' ] }
'"': { pair: [ '“', '”' ] }
'\': '、'
'|': '|'
'`': '`'
'~': '~'
'!': '!'
'@': '@'
'#': '#'
'%': '%'
'$': '¥'
'^': '……'
'&': '&'
'*': '*'
'(': '('
')': ')'
'-': '-'
'_': ——
'+': '+'
'=': '='
'[': '【'
']': '】'
'{': '「'
'}': '」'
key_binder:
bindings:
- when: paging # 僅當已發生向後換頁時,
accept: bracketleft
send: Page_Up
- when: has_menu # 只要有候選字即滿足條件
accept: bracketright
send: Page_Down
menu:
page_size: 8
alternative_select_keys: "12345678"
style:
horizontal: true
candidate_list_layout: linear