-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwubiluna.schema.yaml
190 lines (171 loc) · 5.04 KB
/
wubiluna.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
# Rime schema settings
# encoding: utf-8
schema:
schema_id: wubiluna
name: "五笔朙月"
version: "6"
author:
- Allen Choong
description: |
五筆字型86版修正中国字,加入emoticons。2.0 改编自仓颉检字法(Cangjie6)
dependencies:
- luna_pinyin
- terra_pinyin
- wubi86
- stroke
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: ascii_punct
states: [ 。, , ., ]
- options: [ zh_simp, zh_tw, zh_trad ]
# reset: 0 # Disable so that not reset to SC
states:
- 字型 → 汉字
- 字型 → 漢字(臺)
- 字型 → 漢字
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- affix_segmentor@pinyin
- affix_segmentor@emoji
- affix_segmentor@pinyin_lookup
- affix_segmentor@stroke_lookup
- affix_segmentor@stroke_reverse_lookup
- affix_segmentor@reverse_lookup # cannot change to other name like wubi_lookup, don't know why
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- table_translator
- script_translator@pinyin
- script_translator@emoji
- script_translator@pinyin_lookup
- script_translator@stroke_lookup
- script_translator@stroke_reverse_lookup
- script_translator@reverse_lookup
filters:
- simplifier@zh_simp # So that by default, simplified pinyin is used
- simplifier@zh_tw # Traditional based on Taiwan
- uniquifier
- reverse_lookup_filter@wubi_reverse_lookup
- reverse_lookup_filter@pinyin_reverse_lookup
- reverse_lookup_filter@stroke_reverse_lookup
zh_simp: # based on luna_pinyin_simp
tag: zh_simp
option_name: zh_simp
zh_tw:
tag: zh_tw
option_name: zh_tw
opencc_config: t2tw.json
speller:
alphabet: zyxwvutsrqponmlkjihgfedcba
delimiter: " '"
translator: # Based on Cangjie6, wubi86, and wubi_pinyin
dictionary: &dict
wubiluna
enable_user_dict: true
enable_charset_filter: false # added to allows all words
enable_sentence: true
sentence_over_completion: true
enable_encoder: true
encode_commit_history: true
max_phrase_length: 4
initial_quality: 0.75
pinyin: # Based on Cangjie6 and luna_pinyin_simp
tag: pinyin
prefix: "~"
suffix: ;
tips: 【拼音】
closing_tips: 【五笔】
dictionary: luna_pinyin
preedit_format: &pinyin
- xform/([nl])v/$1ü/
- xform/([nl])ue/$1üe/
- xform/([jqxy])v/$1u/
initial_quality: 0.2
# user_dict: wubiluna # so that pinyin also share the same dictionary
emoji: # Based on emoji
tag: emoji
dictionary: emoji
spelling_hints: 1
comment_format:
- "xform/;[a-z'`]*$//"
- "xform/^/ /"
- "xform/,/ (/"
- xform/\((.*)$/\($1\)/
initial_quality: 0.1
abc_segmentor:
extra_tags: [pinyin, emoji]
reverse_lookup: # Based on Cangjie6, merge with pinyin_lookup, since there is only one reverse lookup
tag: reverse_lookup
prefix: "`"
suffix: ;
tips: 【拼音反查】
closing_tips: 【五笔】
dictionary: pinyin_simp # Based on wubi86 reverse lookup, so that will have simplified and traditional characters
preedit_format: *pinyin
initial_quality: 1
# do not use extra tags, else it will overwrite the terra_pinyin code with wubi86
pinyin_lookup:
tag: pinyin_lookup
prefix: "`W" # don't know why must start from `, cannot start from W only
suffix: ;
dictionary: wubiluna
tips: 【五笔反查】
closing_tips: 【五笔】
initial_quality: 1
wubi_reverse_lookup: # To show pinyin from wubi
tags: [ pinyin_lookup ]
dictionary: terra_pinyin
overwrite_comment: true
pinyin_reverse_lookup: # To show the wubi code, based on Cangjie6
tags: [ reverse_lookup ]
dictionary: *dict
overwrite_comment: true
stroke_lookup: # Based on Cangjie6, merge with pinyin_lookup, since there is only one reverse lookup
tag: stroke_lookup
prefix: "`S"
suffix: ;
tips: 【五笔画反查】
closing_tips: 【五笔】
dictionary: stroke # Based on wubi86 reverse lookup, so that will have simplified and traditional characters
preedit_format:
- xlit/hspnz/一丨丿丶乙/
comment_format:
- xform/~//
- xlit/hspnz/一丨丿丶乙/
initial_quality: 1
stroke_reverse_lookup: # will show the wubi when typing the stroke
tags: [ stroke_lookup ]
dictionary: *dict
overwrite_comment: true
punctuator: # based on Cangjie6
import_preset: symbols
key_binder: # based on luna_pinyin_simp
import_preset: default
bindings:
- { when: always, accept: Control+Shift+4, toggle: zh_simp }
- { when: always, accept: Control+Shift+dollar, toggle: zh_simp }
recognizer: # based on Cangjie6
import_preset: default
patterns:
reverse_lookup: "`[a-z]*;?$" # pinyin to wubi
pinyin_lookup: "`W[a-z]*;?$" # wubi to pinyin
stroke_lookup: "`S[hspnz]*;?$" # stroke to wubi
pinyin: "~[a-z']*;?$" # cannot use number to select the phrase, have to use cursor
punct: "^/[a-z]*$"