Skip to content

Commit 31895ce

Browse files
committed
fix: 解决适配 rimetool 的部分问题
- 部分方案的 switch reset 没有默认值; - 修复适配过程中误关闭部分方案的用户词典,现在方案的用户词典默认状态由 default.yaml 和 default.custom.yaml 定义全局,方案内部根据方案需要,重写默认状态
1 parent 52daba2 commit 31895ce

6 files changed

+86
-38
lines changed

double_pinyin_flypy.schema.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ translator:
218218
- xform/([nl])v/$1ü/
219219
- xform/ü/v/ # ü 显示为 v
220220
initial_quality: 1.2
221-
enable_user_dict: false
221+
enable_user_dict: true # 开启用户词典,根据用户输入调频(默认开启,此处再次声明)
222222

223223
melt_eng:
224224
dictionary: melt_eng # 英文词典

rime_mint.schema.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ translator:
151151
- xform/([nl])ue/$1üe/
152152
- xform/([jqxy])v/$1u/
153153
initial_quality: 1.2
154-
enable_user_dict: false
154+
enable_user_dict: true # 开启用户词典,根据用户输入调频(默认开启,此处再次声明)
155155

156156
melt_eng:
157157
dictionary: melt_eng # 英文词典

rime_mint_flypy.schema.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ translator:
156156
- xform/([nl])ue/$1üe/
157157
- xform/([jqxy])v/$1u/
158158
initial_quality: 1.2
159+
enable_user_dict: true # 开启用户词典,根据用户输入调频(默认开启,此处再次声明)
159160

160161
melt_eng:
161162
dictionary: melt_eng # 英文词典

terra_pinyin.schema.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ speller:
160160
translator:
161161
dictionary: terra_pinyin
162162
initial_quality: 1.2
163-
enable_user_dict: false
164163
spelling_hints: 3 # ~字以內候選標註完整帶調拼音
165164
preedit_format:
166165
- xform/([nl])v/$1ü/
@@ -224,6 +223,7 @@ translator:
224223
- xform/([nljqxy])v/$1ü/
225224
- xform/eh[0-5]?/ê/
226225
- xform/([a-z]+)[0-5]/$1/
226+
enable_user_dict: true # 开启用户词典,根据用户输入调频(默认开启,此处再次声明)
227227

228228
custom_phrase:
229229
dictionary: ""

wubi86_jidian.schema.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ schema:
2020
switches:
2121
- name: ascii_mode
2222
states: [ 中文, 英文 ]
23+
reset: 0
2324
- name: emoji_suggestion
24-
reset: 1
2525
states: [ "😣️","😁️"]
26+
reset: 1
2627
- name: full_shape
2728
states: [ 半角, 全角 ]
29+
reset: 0
2830
- name: transcription
2931
states: [ 简体 , 繁体 ]
32+
reset: 0
3033
- name: ascii_punct
3134
states: [ "。,", ".," ]
3235
reset: 0
@@ -130,6 +133,7 @@ translator:
130133
encode_commit_history: false # 是否对已上屏词自动成词(仅 table_translator 有效)
131134
disable_user_dict_for_patterns: # 对于以下模式禁用用户词典
132135
- "^z.*$" # 以字母"z"开头的任意字符串
136+
enable_user_dict: false # 关闭用户词典,根据用户输入调频(默认开启,形码本身字重低或没有,理论上不需要调频)
133137

134138
# 英文输入
135139
melt_eng:

wubi98_mint.schema.yaml

+77-34
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ schema:
1111
- 加入了五笔小筑的部分词库
1212
- 部分码表源自 yanhuacuo
1313
dependencies:
14-
- melt_eng
15-
- rime_mint
14+
- melt_eng # 英文方案
15+
- rime_mint # 薄荷拼音
16+
1617
switches:
1718
- name: ascii_mode
1819
reset: 0
1920
states: [ 中文, 英文 ]
2021
- name: emoji_suggestion
2122
states: [ "😣️","😁️"]
22-
reset: 0
23+
reset: 1
2324
- name: full_shape
2425
states: [ 半角, 全角 ]
2526
reset: 0
@@ -29,6 +30,7 @@ switches:
2930
- name: ascii_punct
3031
states: [ 。,, ., ]
3132
reset: 0
33+
3234
engine:
3335
processors:
3436
- ascii_composer
@@ -42,36 +44,52 @@ engine:
4244
segmentors:
4345
- ascii_segmentor
4446
- matcher
45-
- affix_segmentor@rime_mint
47+
- affix_segmentor@rime_mint # 拼音
4648
- abc_segmentor
4749
- punct_segmentor
4850
- fallback_segmentor
4951
translators:
5052
- punct_translator
5153
- script_translator
52-
- lua_translator@*mint_date_time_translator
53-
- lua_translator@*number_translator
54-
- lua_translator@*chineseLunarCalendar_translator
55-
- table_translator@melt_eng
56-
- reverse_lookup_translator@rime_mint
57-
- lua_translator@*force_gc
54+
- lua_translator@*mint_date_time_translator # 时间、日期、星期、月份
55+
- lua_translator@*number_translator # 金额大小写
56+
- lua_translator@*chineseLunarCalendar_translator # 农历
57+
- table_translator@melt_eng # 英文输入(作为子翻译器,优先级需要比原生的低)
58+
- reverse_lookup_translator@rime_mint # 反查薄荷拼音
59+
- lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿
5860
filters:
59-
- lua_filter@*autocap_filter
60-
- simplifier@emoji_suggestion
61-
- lua_filter@*autocap_filter
62-
- simplifier@transcription_cc
63-
- lua_filter@*reduce_english_filter
64-
- uniquifier
61+
- lua_filter@*autocap_filter # 英文自动大写
62+
- simplifier@emoji_suggestion # Emoji
63+
- lua_filter@*autocap_filter # 英文自动大写
64+
- simplifier@transcription_cc # 简繁切换
65+
- lua_filter@*reduce_english_filter # 降低部分英语单词在候选项的位置
66+
- uniquifier # 去重
67+
68+
# 简繁切换
6569
transcription_cc:
6670
option_name: transcription
67-
opencc_config: s2t.json
68-
tips: none
69-
excluded_types: [ reverse_lookup ]
71+
opencc_config: s2t.json # s2t.json | s2hk.json | s2tw.json | s2twp.json
72+
tips: none # 转换提示: all 都显示 | char 仅单字显示 | none 不显示。
73+
excluded_types: [ reverse_lookup ] # 不转换反查(两分拼字)的内容
74+
75+
# Emoji模块
7076
emoji_suggestion:
7177
opencc_config: emoji.json
7278
option_name: emoji_suggestion
7379
tips: all
7480
inherit_comment: false
81+
82+
83+
# Lua 配置: 降低部分英语单词在候选项的位置。
84+
# 详细介绍 https://dvel.me/posts/make-rime-en-better/#短单词置顶的问题
85+
# 正常情况: 输入 rug 得到 「1.rug 2.如果 …… 」
86+
# 降低之后: 输入 rug 得到 「1.如果 2.rug …… 」
87+
# 几种模式:
88+
# all 使用 reduce_english_filter 自带的降频词库(降低所有 3~4 位长度、前 2~3 位是完整拼音、最后一位是声母的单词)
89+
# none 不降低任何单词,相当于没有启用这个 Lua
90+
# custom 自定义,只降低 words 里的
91+
# 『留白』 不设置该选项,使用 reduce_english_filter 内全局设置内容
92+
# (匹配的是编码,不是单词)
7593
reduce_english_filter:
7694
mode: all
7795
idx: 2
@@ -93,40 +111,60 @@ reduce_english_filter:
93111
tad, tail, taj, tar, tax, tec, ted, tel, ter, tex, tic, tied, tier, ties, tim, tin, tit, tour, tout, tum,
94112
wag, wand, womens, wap, wax, weir, won,
95113
yan, yen]
114+
115+
# 中国农历配置
96116
chineseLunarCalendar_translator: lunar
117+
97118
translator:
98119
dictionary: wubi98_mint
99120
db_class: tabledb
100-
initial_quality: 1.2
101-
enable_charset_filter: false
102-
enable_sentence: false
121+
initial_quality: 1.2 # 初始质量为1.2
122+
enable_charset_filter: false # 开启字符集过滤
123+
enable_sentence: false # 句子输入模式
103124
enable_encoder: false
104125
encode_commit_history: false
105-
max_phrase_length: 4
106-
enable_completion: false
107-
enable_user_dict: false
126+
enable_completion: false # 是否显示编码未输入完整的词条
108127
disable_user_dict_for_patterns:
109128
- "^z.*$"
129+
enable_user_dict: false # 关闭用户词典,根据用户输入调频(默认开启,形码本身字重低或没有,理论上不需要调频)
130+
131+
# 英文输入
110132
melt_eng:
111-
dictionary: melt_eng
112-
enable_sentence: false
113-
enable_completion: false
133+
dictionary: melt_eng # 英文词典
134+
enable_sentence: false # 关闭自动造句
135+
enable_completion: false # 关闭自动提示
114136
initial_quality: 0.8
137+
115138
speller:
139+
# 为了兼容 英文混输,取消自动上屏
140+
# max_code_length: 4 # 四码上屏
141+
# auto_select: true # 四码唯一时,自动上屏
142+
# auto_clear: max_length # 空码时自动清空
143+
# 如果不想让什么标点直接上屏,可以加在 alphabet,或者编辑标点符号为两个及以上的映射
116144
alphabet: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
117-
delimiter: " `"
145+
delimiter: " `" # 第一位<空格>是拼音之间的分隔符;第二位<'>表示可以手动输入单引号来分割拼音。
146+
118147
rime_mint:
119148
tag: rime_mint
120149
dictionary: rime_mint
121150
enable_user_dict: false
122151
enable_completion: true
123152
prefix: "Up"
124153
tips: 〔拼音〕
154+
155+
# 反查设置
125156
reverse_lookup:
126157
tags: [rime_mint]
127158
overwrite_comment: true
159+
160+
# 输入的编码同时进行拼音反查,实现五笔与拼音的混输
161+
# abc_segmentor:
162+
# extra_tags:
163+
# - rime_mint
164+
128165
punctuator:
129-
import_preset: symbols
166+
import_preset: default
167+
# 定义部分半角字符
130168
half_shape:
131169
"#": "#"
132170
"*": "*"
@@ -144,16 +182,20 @@ punctuator:
144182
"$": ["¥", "$", "€", "£", "¢", "¤"]
145183
"<": ["《", "〈", "«", "<"]
146184
">": ["》", "〉", "»", ">"]
185+
186+
# 反查映射
147187
recognizer:
148188
import_preset: default
149189
patterns:
150190
url: "^[a-z]+[.].+$"
151191
punct: "^/([0-9]0?|[a-z]+)$"
152192
email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"
153193
rime_mint: "^Up[a-z]*'?$"
154-
rmb: "^R[0-9]+[.]?[0-9]*"
155-
gregorian_to_lunar: "^N[0-9]{1,8}"
156-
uppercase: ""
194+
rmb: "^R[0-9]+[.]?[0-9]*" # 响应 lua_translator@number_translator 脚本将自动获取第 2 个字符作为触发前缀
195+
gregorian_to_lunar: "^N[0-9]{1,8}" # 响应 lua_translator@Chinese_lunar_calendar 公历转农历,输入 N20240115 得到「二〇二四年腊月初五」,脚本将自动获取第 2 个字符作为触发前缀
196+
uppercase: "" # 覆写默认的 uppercase 使其可以在输入大写后,输入数字
197+
198+
157199
key_binder:
158200
import_preset: default
159201
bindings:
@@ -192,4 +234,5 @@ key_binder:
192234
- { when: always, accept: Shift+space, toggle: full_shape }
193235
- { when: always, accept: Control+period, toggle: ascii_punct }
194236
menu:
195-
page_size: 6
237+
# 候选词个数
238+
page_size: 6

0 commit comments

Comments
 (0)