-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
moran_sentence.schema.yaml
269 lines (242 loc) · 6.32 KB
/
moran_sentence.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
schema:
schema_id: moran_sentence
name: 魔然·整句
version: "20241027"
author:
- 自然碼發明人:周志農
- 方案製作:ksqsf
description: |
無簡快碼的輸入純粹整句輸入模式。
dependencies:
- tiger
- moran_charset
- moran_english
#- moran_japanese
- stroke
- tiger
- cangjie5
- bopomofo
- zrlf
switches:
- name: ascii_mode
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: simplification
states: [ 漢字, 汉字 ]
- name: ascii_punct
states: [ 。,, ., ]
- name: extended_charset
states: [ 通用, 增廣 ]
- name: emoji
states: [ 🈚, 🈶 ]
- name: chaifen
states: [ 不拆, 扌斥 ]
- name: unicode_comment
states: [ U開, U關 ]
- options: [ std_opencc, std_tw, std_hk, std_dzing ]
states: [ 通, 臺, 港, 寍 ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- matcher@recognizer_secondary
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- reverse_lookup_translator@reverse_tick
- reverse_lookup_translator@reverse_universal
- reverse_lookup_translator@reverse_tiger
- reverse_lookup_translator@reverse_stroke
- reverse_lookup_translator@reverse_cangjie5
- reverse_lookup_translator@reverse_zrlf
- reverse_lookup_translator@reverse_bopomofo
- table_translator@custom_phrase # 自定義短語
#- table_translator@english # 英語混輸
#- table_translator@japanese # 日語混輸
- script_translator
filters:
#- lua_filter@*moran_aux_hint # 輔助碼提示需要去掉本行開頭的 # 符號
- lua_filter@*moran_charset_filter # 字集過濾需要去掉本行開頭的 # 符號
- simplifier@chaifen
- simplifier@emoji
- simplifier
- simplifier@std_tw
- simplifier@std_hk
- simplifier@std_dzing
- uniquifier
speller:
alphabet: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/
delimiter: " '"
algebra:
__patch:
- moran:/algebra/user_force_top?
- moran:/algebra/user_sentence_top?
- moran:/algebra/generate_code
- moran:/algebra/user_sentence_bottom?
- moran:/algebra/user_force_bottom?
translator:
dictionary: moran.extended
prism: moran_sentence
initial_quality: 5
preedit_format:
- xform/([a-z][a-z][a-z][a-z])o/$1°/
custom_phrase: # 自定義短語
dictionary: ""
user_dict: moran_custom_phrases
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 10
english:
# tag: english # librime>=0.12 方可取消註釋
dictionary: moran_english
enable_completion: true
enable_sentence: false
enable_user_dict: true
initial_quality: 1
enable_encoder: false
encode_commit_history: false
comment_format:
- xform/.*//
japanese:
dictionary: moran_japanese
enable_completion: false
enable_sentence: true
enable_user_dict: true
initial_quality: 0
enable_encoder: false
encode_commit_history: false
comment_format:
- xform/.*//
simplifier:
option_name: simplification
opencc_config: moran_t2s.json
chaifen:
option_name: chaifen
opencc_config: moran_chaifen.json
tips: char
show_in_comment: true
comment_form:
- "xform/-/ /"
emoji:
opencc_config: moran_emoji.json
option_name: emoji
tips: all
std_hk:
opencc_config: t2hk.json
option_name: std_hk
std_tw:
opencc_config: t2tw.json
option_name: std_tw
std_dzing:
opencc_config: moran_dzing.json
option_name: std_dzing
tips: all
reverse_format:
comment_format:
- xform/(\w\w);(\w\w)/$1[$2]/
preedit_format:
- xform/^o(lf|bh|cj|vy|hm)//
reverse_tiger:
tag: reverse_tiger
dictionary: tiger
enable_completion: true
prefix: "ohm"
tips: 〔虎碼〕
__include: reverse_format
reverse_universal:
tag: reverse_universal
dictionary: moran.chars
tips: 〔通配〕
__include: reverse_format
reverse_stroke:
tag: reverse_stroke
dictionary: stroke
prefix: "obh"
enable_completion: true
tips: 〔橫h豎s撇p捺n折z〕
__include: reverse_format
reverse_cangjie5:
tag: reverse_cangjie5
dictionary: cangjie5
prefix: "ocj"
enable_completion: true
tips: 〔倉頡五代〕
__include: reverse_format
reverse_zrlf:
tag: reverse_zrlf
dictionary: zrlf
prefix: "olf"
enable_completion: true
tips: 〔兩分〕
__include: reverse_format
reverse_bopomofo:
tag: reverse_bopomofo
dictionary: terra_pinyin
prism: bopomofo
prefix: "ovy"
enable_completion: true
tips: 〔注音符號〕
comment_format:
- xform/(\w\w);(\w\w)/$1[$2]/
preedit_format:
- xform/^o(lf|bh|cj|vy)//
- "xlit|1qaz2wsxedcrfv5tgbyhnujm8ik,9ol.0p;/- 6347'|ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦˉˊˇˋ˙ |"
reverse_tick:
__include: reverse_tiger
tag: reverse_tick
prefix: "`"
reverse_lookup:
extra_tags:
- reverse_tick
- reverse_universal
- reverse_tiger
- reverse_stroke
- reverse_cangjie5
- reverse_zrlf
- reverse_bopomofo
punctuator:
import_preset: symbols
key_binder:
import_preset: default
custom_bindings:
__append:
# 在這裏添加只在本方案中生效的按鍵綁定
bindings:
__patch:
- :/key_binder/custom_bindings?
- moran:/key_bindings/moran_tab
- moran:/key_bindings/moran_semicolon_for_2
- moran:/key_bindings/moran_switches
- moran:/key_bindings/moran_keypad
# 大寫字母追加輔助碼到上一音節
# 該功能可使用 Shift-tab 替代
# - moran:/key_bindings/moran_capital_for_last_syllable
recognizer:
import_preset: default
patterns:
punct: '^/([0-9]0?|[A-Za-z]+)$'
reverse_universal: "(^(`[a-z`]+))|(^([a-z]{2}(`[a-z`]?|[a-z`]`)))"
reverse_tiger: "(^`$)|(^`[a-zA-Z]+$)"
reverse_stroke: "^obh[A-Za-z]*$"
reverse_cangjie5: "^ocj[A-Za-z]*$"
reverse_zrlf: "^olf[A-Za-z]*$"
reverse_bopomofo: '^ovy[A-Za-z0-9,.;/\-]*$'
recognizer_secondary:
patterns:
# {4} 表示輸入長度達到 4 後開始輸出英語
english: '^[A-Za-z]{4}[A-Za-z]*'
# 默認啓用語言模型
__include: moran:/octagram/enable_for_sentence