-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpinyin_to_mps.schema.yaml
188 lines (168 loc) · 4.51 KB
/
pinyin_to_mps.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
# Rime schema
# encoding: utf-8
schema:
schema_id: pinyin_to_mps
name: 拼音-注音
version: "0.1"
author:
- Baopaau <baopaau@gmail.com>
description: |
漢語拼音轉譯國語注音符號第一式
空格鍵輸出上屏碼
聲調輸入方法與地球拼音相同(`- / < \`,或以` ; `代一聲,以` , `代三聲,以` > `代四聲)
另設單擊` v `鍵(按一次輸入第一聲,按兩次輸入第二聲,如此類推)
dependencies:
- terra_pinyin
- cangjie5
switches:
- name: ascii_mode
reset: 0
states: [ 中文, ASCII ]
- name: full_shape
states: [ 半寬, 全寬 ]
- options: [ noop, simplification, trad_tw ]
states: [ 原形, 陆简, 臺正 ]
# 修改下行註釋,改變預設用字 [0, 1, 2 --> 對應上表]
reset: 0
- name: ascii_punct
states: [ 。,, ., ]
- name: emoji_suggestion
states: [ 無繪文字 , 帶繪文字 ]
# 取消下行註釋,預設啓動 emoji
reset: 1
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- reverse_lookup_translator
- table_translator@custom_phrase
- script_translator
filters:
- simplifier@trad_tw
- simplifier
- simplifier@emoji_suggestion
#- reverse_lookup_filter
- uniquifier
speller:
alphabet: 'zyxwvutsrqponmlkjihgfedcba-;/<,>\'
initials: zyxwvutsrqponmlkjihgfedcba
delimiter: " '"
algebra:
- erase/^xx$/
- xform/^r5$/er5/ # 〜兒
- xform/^wong4$/weng4/ # 𥥈/𥦷
- derive/^([bpmf])o/$1uo/ # 現代音ㄛ->ㄨㄛ
- derive/^([bpmfw])eng/$1ong/ # 讀書音ㄥ->ㄨㄥ(ueng)
- abbrev/^([a-z]).+$/$1/
- abbrev/^([zcs]h).+$/$1/
- derive/^([nl])ve/$1ue/
- derive/^([jqxy])u/$1v/
- derive/un([1-5])$/uen$1/
- derive/ong/ung/
- derive/ui/uei/
- derive/iu/iou/
- derive/ao/oa/
- derive/ao/au/
- derive/([aeiou])ng/$1gn/
- derive/([iu])a(o|ng?)/a$1$2/
- derive/^([a-z]+)[0-5]$/$1/
- derive/([dtngkhrzcs])o(u|ng)$/$1o/
- derive/ong$/on/
- derive/5$/vvvvv/
- derive/4$/vvvv/
- derive/3$/vvv/
- derive/2$/vv/
- derive/1$/v/
- 'erase/^.*5$/'
- 'xlit 1234 -/<\'
- 'derive/^(.*)-$/$1;/'
- 'derive/^(.*)<$/$1,/'
- 'derive/^(.*)\\$/$1>/'
translator:
dictionary: terra_pinyin
prism: pinyin_to_mps
strict_spelling: true # fuzz項只在連詞拼寫中有效
spelling_hints: 7
comment_format: &format
- 'xlit -/<\;,> 1234134'
- xform/([iuvaoe](|ng?))vvvvv\>/${1}5/
- xform/([iuvaoe](|ng?))vvvv\>/${1}4/
- xform/([iuvaoe](|ng?))vvv\>/${1}3/
- xform/([iuvaoe](|ng?))vv\>/${1}2/
- xform/([iuvaoe](|ng?))v\>/${1}1/
- xform/([iuvaoe](|ng?))\>/${1}1/ # 補全聲調
# 開始轉譯
- xform/e?r5$/er5/
- xform/\<wong4\>/weng4/
- xform/iu/iou/
- xform/ui/uei/
- xform/ong/ung/
- xform/\<yi?/i/
- xform/\<wu?/u/
- xform/iu/v/
- xform/\<([jqx])u/$1v/
- xform/([iuv])n/$1en/
- xform/zh/Z/
- xform/ch/C/
- xform/sh/S/
- xform/ai/A/
- xform/ei/I/
- xform/ao/O/
- xform/ou/U/
- xform/ang/K/
- xform/eng/G/
- xform/an/M/
- xform/en/N/
- xform/er/R/
- xform/eh/E/
- xform/([iv])e/$1E/
- xform/1//
- 'xlit|bpmfdtnlgkhjqxZCSrzcsiuvaoeEAIOUMNKGR2345|ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦˊˇˋ˙|'
preedit_format: *format
custom_phrase:
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 1
reverse_lookup:
overwrite_comment: true
dictionary: cangjie5
prism: cangjie5
prefix: "`"
suffix: "'"
tips: 〔倉頡〕
comment_format: *format
trad_tw:
option_name: trad_tw
opencc_config: t2tw.json
emoji_suggestion:
opencc_config: emoji.json
option_name: emoji_suggestion
tips: all
punctuator:
import_preset: symbols
key_binder:
import_preset: default
bindings:
- { when: has_menu, accept: space, send: Shift+Return }
recognizer:
import_preset: default
patterns:
punct: "^/.*$"
reverse_lookup: "^`.*$"