万象输入法自定义配置

wanxiang_pure输入法自定义配置

主要是在万象pure输入配置中增加常用的lua和OpenCC和简繁体转换。其中lua来自与wanxiang base,OpenCC和简繁体转换来自于moran。简化配置如下:

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
# 将以下内容拷贝到wanxiang_pure.custom.yaml文件中。
# 1. 需要从moran输入法中拷贝opencc目录(只需要保留和emoji和简中转繁体相关配置即可)
# 2. 从wanxiang base配置中拷贝lua文件夹
patch:
#候选数量
menu/page_size: 5

schema/dependencies/=:
- wanxiang_mixedcode #混合编码
- wanxiang_reverse #反查
- wanxiang_english #英文

switches/=:
- name: ascii_mode
states: [中文, 英文]
- name: ascii_punc
states: [中标, 英标]
- name: full_shape
states: [半角, 全角]
- name: emoji
states: [ 表情关, 表情开]
reset: 1
- options: [ std_s, std_s2t ]
states: [ , ]

# 输入引擎,增加常用功能
engine/processors/=:
- lua_processor@*wanxiang.super_processor
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
engine/segmentors/=:
- ascii_segmentor
- matcher
- matcher@recognizer_secondary
- abc_segmentor
- punct_segmentor
- fallback_segmentor
engine/translators/=:
- punct_translator
- script_translator
- lua_translator@*wanxiang.shijian
- table_translator@custom_phrase
- table_translator@wanxiang_english
- table_translator@wanxiang_mixedcode
engine/filters:
- lua_filter@*wanxiang.super_lookup
- simplifier@emoji
- simplifier@std_s2t
- uniquifier #去重,必须在最后

# 主翻译器,自定义用户字典
translator/+:
user_dict: custom/cn.pure

# 中文、英文、数字、符号等混合词汇
wanxiang_english:
dictionary: wanxiang_english
user_dict: custom/en.pure
enable_completion: true
enable_sentence: false
initial_quality: 2.1
comment_format:
- xform/^~.+$//
english_spacing: smart
spacing_timeout: 5
max_candidates: 5
trigger: "\\"

wanxiang_mixedcode:
dictionary: wanxiang_mixedcode
db_class: stabledb
enable_completion: true
enable_sentence: false
initial_quality: 2
comment_format:
- xform/.*//

super_processor:
enable_backspace_limit: true
enable_seg_loop: true
enable_tone_fallback: true
enable_predict_space: false
kp_number_mode: auto
limit_repeated: "8,40" #格式:"最大重复声母数,最大候选字数"
select_character: "[,]" # 开启以词定字,自动拆解第一位上屏首字,第二位上屏尾字

# 部件拆字反查
wanxiang_reverse:
tag: wanxiang_reverse
dictionary: wanxiang_reverse
enable_completion: true
prefix: "`"
tips: "〔反查:拆分|笔画〕"

wanxiang_lookup:
tags: [abc]
key: "`"
lookup: [wanxiang_reverse]
data_source: [db]
enable_tone: true
enable_direct: false

emoji:
opencc_config: moran_emoji.json
option_name: emoji
tips: none
tags: [abc, number]

std_s2t:
opencc_config: s2t.json
option_name: std_s2t
tags: [abc, number]

recognizer_secondary:
patterns:
english: '(^[A-Za-z]{4}[A-Za-z]*)|(^[A-Z][A-Za-z]*)|(^[a-z][A-Z][a-zA-Z]*)|(^[a-z][a-z][A-Z][a-zA-Z]*)'

# 拼写设定
speller/alphabet: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA`;/\›
speller/initials: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA/›

# 处理符合特定规则的输入码,如网址、反查
recognizer/patterns/=:
punct: "^/([0-9]|10|[A-Za-z]+)$"
wanxiang_reverse: "^`[A-Za-z;]*$"
sjc: "^[/v]rc\\d+[-+=op]?$"
email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$" # email @ 之后不上屏
url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$" # URL

# 导入足够的符号,用于/查询符号
punctuator/=:
digit_separators: ",."
__include: wanxiang_symbols:/symbol_table
__patch: wanxiang_symbols:/symbols

# 从 default 继承快捷键
key_binder/shijian_keys: ["/", "v"]

# 设置时间格式
date_formats:
- "Y年m月d日"
- "Y-m-d"
- "Y/m/d"
- "Y.m.d"
- "Ymd"
time_formats:
- "H:M"
- "H点M分"
- "H:M:S"
datetime_formats:
- "Y-m-d H:M:S"
- "YmdHMS"
- "Y年m月d日 H点M分"

wanxiang_base输入法自定义配置

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
# 将以下内容拷贝到wanxiang.custom.yaml文件中。
patch:
#下面是候选数量
menu/page_size: 5

switches/=:
- name: ascii_mode
states: [中文, 英文]
- name: ascii_punct
states: [中标, 英标]
- name: full_shape
states: [半角, 全角]
- name: emoji
states: [表情关, 表情开]
reset: 1
- options: [s2s, s2t]
states: [简体, 通繁]
- options: [comment_off, tone_hint, toneless_hint]
states: [注释关, 有声调, 无声调]


# 自定义输入引擎,裁剪掉不需要功能
engine/processors/=:
- lua_processor@*wanxiang.super_processor
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
engine/segmentors/=:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
engine/translators/=:
- punct_translator
- script_translator
- lua_translator@*wanxiang.shijian
- table_translator@custom_phrase
- lua_translator@*wanxiang.super_english*T
- table_translator@wanxiang_mixedcode
- reverse_lookup_translator@wanxiang_reverse
engine/filters/=:
- lua_filter@*wanxiang.super_lookup
- lua_filter@*wanxiang.super_comment_preedit
- lua_filter@*wanxiang.super_replacer
- lua_filter@*wanxiang.super_english*F
- uniquifier #去重,必须在最后

# 自定义数据库名称,保存在custom目录(必须手工创建一个custom目录)
translator/+:
user_dict: custom/cn.base
wanxiang_english/user_dict: custom/en.base
super_tips/db_name: custom/tips
super_replacer/db_name: custom/replacer
user_predict/db_name: custom/predict
input_stats/db_name: custom/stats


# 只保留emoji、简繁转换、特殊符号替换
super_replacer/rules/=:
- option: emoji
mode: append
comment_mode: none
tags: [abc]
prefix: "_em_"
files:
- lua/data/emoji.txt
- option: true
mode: append
comment_mode: none
tags: [abc]
prefix: "_ot_"
files:
- lua/data/others.txt
- option: [s2t]
mode: replace
comment_mode: append
sentence: true # 句子级别替换
tags: [abc]
prefix: "_s2t_"
files:
- lua/data/STCharacters.txt
- lua/data/STPhrases.txt

recognizer/patterns/=: # 再增加方案专有的:
punct: "^/([0-9]|10|[A-Za-z]+)$" # 响应 symbols.yaml 的 symbols
wanxiang_reverse: "^`[A-Za-z;]*$"
sjc: "^[/v]rc\\d+[-+=op]?$"
email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$" # email @ 之后不上屏
url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$" # URL

key_binder/shijian_keys: ["/", "v"]
super_comment/cand_type/sentence: "∝"
super_comment/cand_type/user_table: "∽"

# 拼写设定
# speller/alphabet: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA`;/\›
# speller/initials: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA/›

# 设置时间格式
date_formats:
- "Y年m月d日"
- "Y-m-d"
- "Y/m/d"
- "Y.m.d"
- "Ymd"
time_formats:
- "H:M"
- "H点M分"
- "H:M:S"
datetime_formats:
- "Y-m-d H:M:S"
- "YmdHMS"
- "Y年m月d日 H点M分"

自定义default文件

1
2
3
4
5
6
7
8
9
10
# 将以下内容拷贝到 default.custom.yaml文件中。
patch:
#候选数量以及候选词编号
menu/page_size: 5
menu/alternative_select_labels: [1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]

schema_list:
- {schema: wanxiang_pure}
- {schema: wanxiang}

更新libime

如果系统中无法正常执行lua脚本,可以尝试重新安装librime-lua ,具体执行如下命令:

1
2
3
sudo dnf install librime-lua
sudo dnf update fcitx5-rime

万象输入法自定义配置

http://mixiang.tech/2026/08/14/2026-08-14-10/

作者

Mixion

发布于

2026-08-14

更新于

2026-08-14

许可协议