Skip to content

Commit 44374e5

Browse files
YummyCocoaMintimate
authored andcommitted
feat: 自然码/智能ABC/微软/搜狗/紫光双拼
- 适配自然码/智能ABC/微软/搜狗/紫光双拼 - 默认没有激活,可以修改 default.yaml 全局配置,或者使用 defalut.custom.yaml 去覆写。(建议使用 default.custom.yaml 去覆写)
1 parent 12fafaf commit 44374e5

6 files changed

+1544
-0
lines changed

default.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ schema_list:
1414
- schema: wubi98_mint # 五笔98-五笔小筑
1515
- schema: wubi86_jidian # 五笔86-极点86
1616
- schema: t9 # 仓九宫格-全拼输入
17+
# 以下方案薄荷进行了适配,但是没有激活
18+
# - schema: double_pinyin_abc # 智能ABC双拼
19+
# - schema: double_pinyin_mspy # 微软双拼
20+
# - schema: double_pinyin_sogou # 搜狗双拼
21+
# - schema: double_pinyin_ziguang # 紫光双拼
22+
# - schema: double_pinyin # 自然码双拼
1723

1824
switcher:
1925
# 切换方案时显示的标题

double_pinyin.schema.yaml

+305
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
# Rime schema
2+
# encoding: utf-8
3+
4+
# 适配了双拼
5+
# 双拼键位映射复制自 https://github.com/rime/rime-double-pinyin
6+
# 双拼之间主要就是 speller/algebra 和 translator/preedit_format 这里有区别。
7+
8+
# 方案说明
9+
schema:
10+
schema_id: double_pinyin
11+
name: "自然码双拼-薄荷定制"
12+
version: "24.05.07"
13+
author:
14+
- Dvel
15+
- Mintimate
16+
description: |
17+
薄荷拼音 - 自然码双拼
18+
词库基于[雾凇拼音](https://github.com/iDvel/rime-ice)
19+
dependencies:
20+
- melt_eng # 英文输入,作为次翻译器挂载到拼音方案
21+
- radical_pinyin # 部件拆字,反查及辅码(如果需要把按键映射
22+
23+
key_binder:
24+
import_preset: default
25+
bindings:
26+
- {accept: "Control+Shift+E", toggle: emoji_suggestion, when: always}
27+
- {accept: "Control+Shift+exclam", toggle: transcription, when: has_menu}
28+
- {accept: "Control+Shift+1", toggle: transcription, when: has_menu}
29+
- {accept: minus, send: Page_Up, when: paging} # 使用`-`进行向上翻页(第一页时候无效)
30+
- {accept: equal, send: Page_Down, when: has_menu} # 使用`=`进行向下翻页
31+
32+
switches:
33+
- name: ascii_mode
34+
reset: 0
35+
states: [ 中文, 英文 ]
36+
- name: emoji_suggestion
37+
reset: 1
38+
states: [ "😣️","😁️"]
39+
- name: full_shape
40+
states: [ 半角, 全角 ]
41+
- name: transcription
42+
reset: 0
43+
states: [ 简体 , 繁体 ]
44+
- name: ascii_punct
45+
states: [ "。,", ".," ]
46+
reset: 0
47+
48+
49+
engine:
50+
processors:
51+
- lua_processor@*select_character # 以词定字
52+
- lua_processor@*codeLengthLimit_processor # 使用Lua限制输入内容的最大长度(防止过长而卡顿)
53+
- ascii_composer # ※ 處理西文模式及中西文切換
54+
- recognizer # ※ 與 matcher 搭配,處理符合特定規則的輸入碼,如網址、反查等
55+
- key_binder # ※ 在特定條件下將按鍵綁定到其他按鍵,如重定義逗號、句號爲候選翻頁鍵
56+
- speller
57+
- punctuator
58+
- selector
59+
- navigator
60+
- express_editor
61+
segmentors:
62+
- ascii_segmentor # 標識西文段落
63+
- matcher # 標識符合特定規則的段落,如網址、反查等
64+
- affix_segmentor@wubi98_mint
65+
- affix_segmentor@radical_reverse_lookup
66+
- abc_segmentor # 標識常規的文字段落
67+
- punct_segmentor # 標識句讀段落
68+
- fallback_segmentor # 標識其他未標識段落
69+
translators:
70+
- punct_translator # ※ 轉換標點符號
71+
- script_translator
72+
- lua_translator@*mint_date_time_translator # 时间、日期、星期、月份
73+
- lua_translator@*number_translator # 金额大小写
74+
- lua_translator@*chineseLunarCalendar_translator # 农历
75+
- table_translator@melt_eng # 英文输入(作为子翻译器,优先级需要比原生的低)
76+
- reverse_lookup_translator@radical_reverse_lookup
77+
- reverse_lookup_translator@wubi98_mint
78+
filters:
79+
- lua_filter@*corrector_filter # 错音错字提示
80+
- lua_filter@*autocap_filter # 英文自动大写
81+
- simplifier@emoji_suggestion
82+
- simplifier@transcription_cc
83+
- lua_filter@*reduce_english_filter # 降低部分英语单词在候选项的位置
84+
- uniquifier # 去重
85+
86+
87+
# 简繁切换
88+
transcription_cc:
89+
option_name: transcription
90+
opencc_config: s2t.json # s2t.json | s2hk.json | s2tw.json | s2twp.json
91+
tips: none # 转换提示: all 都显示 | char 仅单字显示 | none 不显示。
92+
excluded_types: [ reverse_lookup ] # 不转换反查(两分拼字)的内容
93+
94+
# Emoji模块
95+
emoji_suggestion:
96+
opencc_config: emoji.json
97+
option_name: emoji_suggestion
98+
tips: all
99+
inherit_comment: false
100+
101+
# 最大输入长度
102+
codeLengthLimit_processor: 25
103+
104+
# Lua 配置:为 corrector 格式化 comment,占位符为 {comment}
105+
# 默认 "{comment}" 输入 hun dun 时会在「馄饨」旁边生成 hún tun 的 comment
106+
# 例如左右加个括号 "({comment})" 就会变成 (hún tun)
107+
corrector: "{comment}"
108+
109+
110+
# Lua 配置: 降低部分英语单词在候选项的位置。
111+
# 详细介绍 https://dvel.me/posts/make-rime-en-better/#短单词置顶的问题
112+
# 正常情况: 输入 rug 得到 「1.rug 2.如果 …… 」
113+
# 降低之后: 输入 rug 得到 「1.如果 2.rug …… 」
114+
# 几种模式:
115+
# all 使用 reduce_english_filter 自带的降频词库(降低所有 3~4 位长度、前 2~3 位是完整拼音、最后一位是声母的单词)
116+
# none 不降低任何单词,相当于没有启用这个 Lua
117+
# custom 自定义,只降低 words 里的
118+
# 『留白』 不设置该选项,使用 reduce_english_filter 内全局设置内容
119+
# (匹配的是编码,不是单词)
120+
reduce_english_filter:
121+
mode: custom # all | custom | none
122+
idx: 2 # 降低到第 idx 个位置
123+
# 自定义的单词列表,示例列表没有降低部分常用单词,如 and cat mail Mac but bad shit ……
124+
words: [
125+
aid, ann,
126+
bail, bait, bam, band, bans, bat, bay, bend, bent, benz, bib, bid, bien, biz, boc, bop, bos, bud, buf, bach, bench, bush,
127+
cab, cad, cain, cam, cans, cap, cas, cef, chad, chan, chap, chef, cher, chew, chic, chin, chip, chit, coup, cum, cunt, cur, couch,
128+
dab, dag, dal, dam, dent, dew, dial, diet, dim, din, dip, dis, dit, doug, dub, dug, dunn,
129+
fab, fax, fob, fog, foul, fur,
130+
gag, gail, gain, gal, gam, gaol, ged, gel, ger, guam, gus, gut,
131+
hail, ham, hank, hans, hat, hay, heil, heir, hem, hep, hud, hum, hung, hunk, hut, hush,
132+
jim, jug,
133+
kat,
134+
lab, lad, lag, laid, lam, laos, lap, lat, lax, lay, led, leg, lex, liam, lib, lid, lied, lien, lies, linn, lip, lit, liz, lob, lug, lund, lung, lux, lash, loch, lush,
135+
mag, maid, mann, mar, mat, med, mel, mend, mens, ment, mil, mins, mint, mob, moc, mop, mos, mot, mud, mug, mum, mesh,
136+
nap, nat, nay, neil, nib, nip, noun, nous, nun, nut, nail, nash,
137+
pac, paid, pail, pain, pair, pak, pal, pam, pans, pant, pap, par, pat, paw, pax, pens, pic, pier, pies, pins, pint, pit, pix, pod, pop, pos, pot, pour, pow, pub, pinch, pouch,
138+
rand, rant, rent, rep, res, ret, rex, rib, rid, rig, rim, rub, rug, rum, runc, runs, ranch,
139+
sac, sail, sal, sam, sans, sap, saw, sax, sew, sham, shaw, shin, sig, sin, sip, sis, suit, sung, suns, sup, sur, sus,
140+
tad, tail, taj, tar, tax, tec, ted, tel, ter, tex, tic, tied, tier, ties, tim, tin, tit, tour, tout, tum,
141+
wag, wand, womens, wap, wax, weir, won,
142+
yan, yen,
143+
zach
144+
]
145+
146+
# 中国农历配置
147+
chineseLunarCalendar_translator: lunar
148+
149+
# Lua 配置:为 corrector 格式化 comment,占位符为 {comment}
150+
# 默认 "{comment}" 输入 hun dun 时会在「馄饨」旁边生成 hún tun 的 comment
151+
# 例如左右加个括号 "({comment})" 就会变成 (hún tun)
152+
corrector: "{comment}"
153+
154+
# 主翻译器,拼音
155+
translator:
156+
dictionary: rime_mint # 使用的字典文件
157+
prism: double_pinyin # 多方案共用一个词库时,为避免冲突,需要用 prism 指定一个名字。
158+
spelling_hints: 8 # corrector.lua :为了让错音错字提示的 Lua 同时适配全拼双拼,将拼音显示在 comment 中
159+
always_show_comments: true # corrector.lua :Rime 默认在 preedit 等于 comment 时取消显示 comment,这里强制一直显示,供 corrector.lua 做判断用。
160+
initial_quality: 1.2 # 拼音的权重应该比英文大
161+
comment_format: # 标记拼音注释,供 corrector.lua 做判断用
162+
- xform/^/[/
163+
- xform/$/]/
164+
preedit_format: # preedit_format 影响到输入框的显示和“Shift+回车”上屏的字符
165+
- xform/([bpmnljqxy])n/$1in/
166+
- xform/(\w)g/$1eng/
167+
- xform/(\w)q/$1iu/
168+
- xform/([gkhvuirzcs])w/$1ua/
169+
- xform/(\w)w/$1ia/
170+
- xform/([dtnlgkhjqxyvuirzcs])r/$1uan/
171+
- xform/(\w)t/$1ve/
172+
- xform/([gkhvuirzcs])y/$1uai/
173+
- xform/(\w)y/$1ing/
174+
- xform/([dtnlgkhvuirzcs])o/$1uo/
175+
- xform/(\w)p/$1un/
176+
- xform/([jqx])s/$1iong/
177+
- xform/(\w)s/$1ong/
178+
- xform/([jqxnlb])d/$1iang/
179+
- xform/(\w)d/$1uang/
180+
- xform/(\w)f/$1en/
181+
- xform/(\w)h/$1ang/
182+
- xform/(\w)j/$1an/
183+
- xform/(\w)k/$1ao/
184+
- xform/(\w)l/$1ai/
185+
- xform/(\w)z/$1ei/
186+
- xform/(\w)x/$1ie/
187+
- xform/(\w)c/$1iao/
188+
- xform/([dtgkhvuirzcs])v/$1ui/
189+
- xform/(\w)b/$1ou/
190+
- xform/(\w)m/$1ian/
191+
- xform/([aoe])\1(\w)/$1$2/
192+
- "xform/(^|[ '])v/$1zh/"
193+
- "xform/(^|[ '])i/$1ch/"
194+
- "xform/(^|[ '])u/$1sh/"
195+
- xform/([jqxy])v/$1u/
196+
- xform/([nl])v/$1ü/
197+
- xform/ü/v/ # ü 显示为 v
198+
199+
# 次翻译器,英文
200+
melt_eng:
201+
dictionary: melt_eng # 挂载词库 melt_eng.dict.yaml
202+
enable_sentence: false # 禁止造句
203+
enable_user_dict: false # 禁用用户词典
204+
initial_quality: 0.8 # 初始权重
205+
comment_format: # 自定义提示码
206+
- xform/.*// # 清空提示码
207+
208+
# 拼写设定
209+
speller:
210+
# 如果不想让什么标点直接上屏,可以加在 alphabet,或者编辑标点符号为两个及以上的映射
211+
alphabet: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA`
212+
# initials 定义仅作为始码的按键,排除 ` 让单个的 ` 可以直接上屏
213+
initials: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
214+
delimiter: " '" # 第一位<空格>是拼音之间的分隔符;第二位<'>表示可以手动输入单引号来分割拼音。
215+
algebra:
216+
- erase/^xx$/
217+
- derive/^([jqxy])u$/$1v/
218+
- derive/^([aoe])([ioun])$/$1$1$2/
219+
- xform/^([aoe])(ng)?$/$1$1$2/
220+
- xform/iu$/Ⓠ/
221+
- xform/[iu]a$/Ⓦ/
222+
- xform/[uv]an$/Ⓡ/
223+
- xform/[uv]e$/Ⓣ/
224+
- xform/ing$|uai$/Ⓨ/
225+
- xform/^sh/Ⓤ/
226+
- xform/^ch/Ⓘ/
227+
- xform/^zh/Ⓥ/
228+
- xform/uo$/Ⓞ/
229+
- xform/[uv]n$/Ⓟ/
230+
- xform/(.)i?ong$/$1Ⓢ/
231+
- xform/[iu]ang$/Ⓓ/
232+
- xform/(.)en$/$1Ⓕ/
233+
- xform/(.)eng$/$1Ⓖ/
234+
- xform/(.)ang$/$1Ⓗ/
235+
- xform/ian$/Ⓜ/
236+
- xform/(.)an$/$1Ⓙ/
237+
- xform/iao$/Ⓒ/
238+
- xform/(.)ao$/$1Ⓚ/
239+
- xform/(.)ai$/$1Ⓛ/
240+
- xform/(.)ei$/$1Ⓩ/
241+
- xform/ie$/Ⓧ/
242+
- xform/ui$/Ⓥ/
243+
- xform/(.)ou$/$1Ⓑ/
244+
- xform/in$/Ⓝ/
245+
- xlit/ⓆⓌⓇⓉⓎⓊⒾⓄⓅⓈⒹⒻⒼⒽⓂⒿⒸⓀⓁⓏⓍⓋⒷⓃ/qwrtyuiopsdfghmjcklzxvbn/
246+
# - abbrev/^(.).+$/$1/ # 首字母简拼,开启后会导致 3 个字母时 kj'x 变成 k'jx 的问题
247+
248+
wubi98_mint:
249+
tag: wubi98_mint
250+
dictionary: wubi98_mint
251+
enable_user_dict: false
252+
enable_completion: true
253+
prefix: "Uw"
254+
tips: 〔五笔〕
255+
256+
# 部件拆字反查
257+
radical_lookup:
258+
tag: radical_lookup
259+
dictionary: radical_pinyin
260+
enable_user_dict: false
261+
prefix: "Uu" # 反查前缀(反查时前缀会消失影响打英文所以设定为两个字母,或可改成一个非字母符号),与 recognizer/patterns/radical_lookup 匹配
262+
tips: "〔拆字〕"
263+
264+
265+
reverse_lookup:
266+
tags: [wubi98_mint,radical_lookup]
267+
overwrite_comment: true
268+
dictionary: dicts/rime_ice.8105
269+
270+
271+
punctuator:
272+
import_preset: symbols
273+
# 定义部分半角字符
274+
half_shape:
275+
"#": "#"
276+
"*": "*"
277+
'.' : { commit: 。 }
278+
"`": "`"
279+
"~": "~"
280+
"@": "@"
281+
"=": "="
282+
"/": ["/", "÷",]
283+
'\': ""
284+
"_" : "──"
285+
"'": {pair: ["「", "」"]}
286+
"[": ["【", "["]
287+
"]": ["】", "]"]
288+
"$": ["¥", "$", "€", "£", "¢", "¤"]
289+
"<": ["《", "〈", "«", "<"]
290+
">": ["》", "〉", "»", ">"]
291+
292+
293+
# 反查映射
294+
recognizer:
295+
import_preset: default
296+
patterns:
297+
url: "^[a-z]+[.].+$"
298+
punct: "^/([0-9]0?|[a-z]+)$"
299+
wubi98_mint: "Uw[a-z]*'?$"
300+
radical_lookup: "Uu[a-z]*'?$"
301+
rmb: "^R[0-9]+[.]?[0-9]*" # 响应 lua_translator@number_translator 脚本将自动获取第 2 个字符作为触发前缀
302+
gregorian_to_lunar: "^N[0-9]{1,8}" # 响应 lua_translator@Chinese_lunar_calendar 公历转农历,输入 N20240115 得到「二〇二四年腊月初五」,脚本将自动获取第 2 个字符作为触发前缀
303+
uppercase: "" # 覆写默认的 uppercase 使其可以在输入大写后,输入数字
304+
305+

0 commit comments

Comments
 (0)