├── .gitignore
├── README.md
├── colors
├── aqua.yaml
├── azure.yaml
├── ink.yaml
├── lost_temple.yaml
├── luna.yaml
├── poetry_plum.yaml
├── poetry_spring.yaml
├── potry_ocean.yaml
└── wechat.yaml
├── default.yaml
├── font
└── 黑体字根.ttf
├── hot_keys.yaml
├── icons
├── CN.ico
├── EN.ico
├── full.ico
└── half.ico
├── images
├── QQ.jpg
├── mac展示.png
├── windows展示.png
├── 中书君.png
├── 候选说明.png
├── 捐赠.jpg
└── 楔子.png
├── key_bindings.yaml
├── lua
├── Submit_text.lua
├── calculator.lua
├── helper.lua
├── lib
│ └── basic.lua
├── lunarDate.lua
├── lunarGz.lua
├── lunarJq.lua
├── new_spelling.lua
├── number.lua
└── switcher.lua
├── opencc
└── es.json
├── pinyin.dict.yaml
├── pinyin.schema.yaml
├── punctuation.yaml
├── quick_symbols.dict.yaml
├── rime.lua
├── squirrel.yaml
├── symbols.yaml
├── tables
├── 86
│ ├── squirrel.yaml
│ ├── wb_spelling.dict.yaml
│ ├── weasel.custom.yaml
│ ├── weasel.yaml
│ └── wubi.dict.yaml
├── 98
│ ├── squirrel.yaml
│ ├── wb_spelling.dict.yaml
│ ├── weasel.custom.yaml
│ ├── weasel.yaml
│ └── wubi.dict.yaml
└── 06
│ ├── squirrel.yaml
│ ├── wb_spelling.dict.yaml
│ ├── weasel.custom.yaml
│ ├── weasel.yaml
│ └── wubi.dict.yaml
├── wb_spelling.dict.yaml
├── wb_spelling.schema.yaml
├── weasel.yaml
├── wubi.dict.yaml
├── wubi.extended.dict.yaml
├── wubi.schema.yaml
└── wubi_pinyin.schema.yaml
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 |
28 | # Uncomment if you have tasks that create the
29 | build/
30 | sync/
31 | trash/
32 | installation.yaml
33 | user.yaml
34 | settings.json
35 | *.userdb/
36 | *.txt
37 | /*.custom.yaml
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | ## 写给热爱打字的你
4 |
5 | > 我们曾是诗的国度,你我的魂早已浸透了仓颉的恩泽。
6 | > 相信你也曾像太白一样诗意盎然,忽复乘舟梦日边。
7 | > 也曾执管挥毫,畅想兰亭轶闻,放浪形骸于山水之间。
8 | > 你有你的故事,我有我的酒。
9 | > 用最初的文字,记录每一处痕迹,直到盛满整个星汉。
10 | > 当你用它打字时,你就成了最浪漫的诗人!
11 |
12 | ## 打字表现
13 |
14 | ### Windows 端表现
15 |
16 | 
17 |
18 | ### MacOS 端表现
19 |
20 | 
21 |
22 | ## 配置说明
23 |
24 | ### 初次安装
25 |
26 | 1. 下载官方 [Rime 小狼毫版本安装包](https://rime.im/download/),并安装到目标机器
27 | 2. 下载本方案,将所有文件覆盖到 **Rime** 的用户目录下(最好是先删除原有配置,再全部复制进去)
28 | 3. 打开 **font** 文件夹,安装其中的 **黑体字根.ttf** 字体
29 | 4. 重新部署 **Rime**,就可以打字了(默认是 86 版五笔方案)
30 |
31 | ### 切换五笔版本
32 |
33 | 在本方案的根目录,找到 `tables` 文件夹,该文件夹下的子文件夹 `86/98/06` 分别内置了不同版本的码表,以新世纪版本为例,打开 `tables/06` 文件夹后,将里面所有的内容覆盖到 Rime 用户目录下,重新部署,即可切换为新世纪五笔。
34 |
35 | ## 基本功能
36 |
37 | ### 快捷键
38 |
39 | |快捷键|功能|
40 | | ---- | ---- |
41 | |ctrl + `|菜单项|
42 | |ctrl + shift + h|拆分显示与隐藏|
43 | |ctrl + shift + j|编码提示与隐藏|
44 | |ctrl + shift + f|繁简转换|
45 | |ctrl + shift + u|生僻字显示与隐藏|
46 | |shift|中英文切换|
47 | |shift + space|全角半角切换|
48 | |ctrl + .|中英文标点切换|
49 |
50 | ### 功能键
51 |
52 | |功能键|功能|
53 | | ----- | ---- |
54 | |help|帮助菜单|
55 | |mode|模式切换菜单|
56 | |date|显示当前日期|
57 | |time|显示当前时间|
58 | |week|显示当前星期|
59 | |nl|显示当前农历|
60 | |jq|显示当前二十四节气|
61 | |z|反查,重复上次上屏内容|
62 | |`|临时自造词|
63 | |~|以形查音|
64 | |=|激活计算器功能和大小写金额转换功能|
65 | |==|激活农历反查功能|
66 |
67 | ### 系统日期显示
68 |
69 | 以下功能默认处于开启状态。
70 |
71 | |编码|说明|
72 | | ----- | ---- |
73 | |date|输出当天日期|
74 | |time|输出当前时间|
75 | |week|输出当前星期|
76 |
77 | 除了以上三个编码可以输出系统时间外,另添加以下关键词,用以输出对应的日期与日间。
78 | 这些关键词包括:【今天、昨天、前天、明天、后天、时间、本周、上周、下周、本月、上月和下月】。
79 | 其中【上月】和【下月】输出的结果如果月末天数不同时按最小月末数计算。
80 |
81 | ## 常用自定义配置
82 |
83 | *以下配置说明按 `wubi.shema.yaml` 方案作为参考,其同样适用于 `wubi_dz.shema.yaml` 等其他方案的配置。*
84 | **以下所有的配置,都推荐在 `方案.custom.yaml` 中以补丁的方式配置(如果没有对应的 `.custom.yaml` 文件,请自行创建),以避免在更新项目的时候导致个人配置信息丢失!**
85 | *`方案.custom.yaml` 中的补丁写法,请参照 [定制指南(初阶)](https://github.com/rime/home/wiki/CustomizationGuide)。*
86 |
87 |
88 | **注意:在 `custom` 文件首行一定要添加一行注释,避免 `Rime` 解析出错。**
89 |
90 | ### 自定义候选项个数
91 |
92 | 默认的候选个数是 `5` 个。文件位置 `wubi.custom.yaml`。
93 |
94 | ```yaml
95 | # wubi shema setting
96 |
97 | patch:
98 | "menu/page_size": 9
99 | ```
100 |
101 | ### 自定义候选序号样式
102 |
103 | 默认的序号格式是带圆圈的中文数字符号。文件位置 `wubi.custom.yaml`。
104 |
105 | ```yaml
106 | # wubi shema setting
107 |
108 | patch:
109 | "menu/alternative_select_labels": [ 〡, 〢, 〣, 〤, 〥, 〦, 〧, 〨, 〩, 〸, 〹, 〺 ]
110 | ```
111 |
112 | ### 四码唯一自动上屏
113 |
114 | 文件位置 `wubi.custom.yaml`
115 |
116 | ```yaml
117 | # wubi shema setting
118 |
119 | patch:
120 | "speller/auto_select": true
121 | ```
122 |
123 | ### 回车清空编码
124 |
125 | 默认情况下,回车会将编码上屏。如果需要设置为回车清空编码,可以按下方法进行修改。
126 |
127 | 文件位置 `wubi.custom.yaml`
128 |
129 | ```yaml
130 | # wubi shema setting
131 |
132 | patch:
133 | key_binder/bindings/+:
134 | - {accept: Return, send: Escape, when: composing}
135 | - {accept: Return, send: Escape, when: has_menu}
136 | ```
137 |
138 | ### 空码时自动清除编码
139 |
140 | 文件位置 `wubi.custom.yaml`,本例中,节点有引号和无引号的写法都是可以被正确解析的。
141 |
142 | ```yaml
143 | # wubi shema setting
144 |
145 | patch:
146 | speller/max_code_length: 4
147 | "speller/auto_clear": max_length
148 | ```
149 |
150 | ### 开启自动调频
151 |
152 | 自动调频功能默认是关闭状态,如需要开启自动调频功能,可参考以下方法。
153 |
154 | 文件位置 `wubi.custom.yaml`
155 |
156 | ```yaml
157 | # wubi shema setting
158 |
159 | patch:
160 | translator/enable_user_dict: true
161 | ```
162 |
163 | ### 开启自动造词
164 |
165 | 自动造词需要满足以下条件:
166 | 1. 禁用四码唯一自动上屏功能;
167 | 2. 句子输入模式开启;
168 | 3. 开启用户词典功能;
169 |
170 | 文件位置 `wubi.custom.yaml`,此时,将同时开启自动调频、自动造词功能。
171 |
172 | ```yaml
173 | # wubi shema setting
174 |
175 | patch:
176 | speller/max_code_length: 0 # 最长编码长度,0表示不设置长度
177 | speller/auto_select: false # 关闭自动上屏
178 | translator/enable_sentence: true # 开启句子输入模式(连打模式)
179 | translator/enable_user_dict: true # 启用用户词典
180 | translator/enable_encoder: true # 启用编码器
181 | ```
182 |
183 | ### 顶字上屏功能
184 |
185 | 顶字上屏功能简称「顶功」,这种模式需要固定最长编码为 `4`,并且禁用**四码唯一时自动上屏功能**,配置如下。
186 |
187 | 文件位置 `wubi.custom.yaml`。
188 |
189 | ```yaml
190 | # wubi shema setting
191 |
192 | patch:
193 | speller/max_code_length: 4 # 最长编码长度,0表示不设置长度
194 | speller/auto_select: false # 关闭自动上屏
195 | ```
196 |
197 | ### 外观文字横向排列
198 |
199 | 以 windows 端为例,默认外观的文字是竖向排列的,如果想将其修改为横向排列,可以 `weasel.custom.yaml` 中进行修改,这个文件一般是在部署时自动生成的,如果没有该文件,请手动创建一个。
200 |
201 | ```yaml
202 | # weasel.custom setting
203 |
204 | patch:
205 | "style/vertical_text": false # 是否启用文本纵向显示
206 | ```
207 |
208 | ### More
209 |
210 | 更多配置详情,可前往 [Wiki 页](https://gitee.com/hi-coder/rime-wubi/wikis/Home) 进行了解。
211 |
212 | ## 空山词库
213 |
214 | 本方案的三版词库在单字数量和词组数量上保持了一致。
215 | 在设计码表的时候,采用了三码以内出单字,四码出字词的模式。
216 |
217 | 因为很多人都头疼单字的识别码,因此在本方案的词库中对所有包含识别码的单字进行了单独编码,称其为**次全码单字**。例如「吾」的全码是`gkf`,但在输入`gk`时即可被检索到,而且不会影响`gkf`全码。候选栏中的重码变多了,但首选位置固定的简码是不变的,喜欢打全码可以忽略其他候选项,使用识别码来精准定位到最终结果。而对于一时想不起识别码的单字,只要拆出完整字根,它就一定会出现在候选栏里,这种确信的结果对于某些结构不明确的字来说,大大减轻了大脑从字根拆解到结构识别的能量消耗。
218 |
219 | 在简码单字候选中,如果某个单字在前一级简码的首选位出现过,则会让位到最后一位。同理,在全码字词中,如果任意简码首选项中出现过该字,则其会让位到字词的最后一位。(例外:所有的生僻字默认处于最后一位)
220 |
221 | 
222 |
223 | #### 排序说明
224 |
225 | 一简:首选项为一简单字,次级选项为键名汉字。
226 | 二简:首选项为二简单字,次级选项为二级次全码单字。
227 | 三简:首选项为三简单字,次级选项为三级次全码单字。候选的单字按常用字字频做了排序,并且,如果三简中的单字在一简二简首选位置出现过,则退让到最后一位。
228 | 四全:单字与词组按先用词频数据进行了排序,如果与词组一同出现的单字在一简二简三简首选位出现过,则不参与排序,直接安置于最后位置。
229 | *生僻字不参与以上排序逻辑,生僻字需要打全编码显示,并且永远排在最后一位。*
230 |
231 | ## 中书君
232 |
233 | 中书君是针对本方案的一个管理器,旨在帮助广大用户简化 Rime 方案的配置难度。(目前中书君项目还处于 alpha 的内研阶段,beta 正式版还未正式上线。)以下是图示:
234 |
235 | 
236 |
237 | 项目体验地址:
238 | - Gitee 地址:https://gitee.com/hi-coder/WubiMaster
239 | - Github 地址:https://github.com/mrshiqiqi/WubiMaster
240 |
241 | ## 捐赠 🌻
242 |
243 | > 感谢您选择并使用这款开源软件!您的信任与支持是我持续前进的动力。
244 | > 开源软件的研发与维护离不开开发者的辛勤付出与无私奉献。为了保持软件的持续更新与优化,恳请您在能力范围内考虑对本项目进行捐赠。
245 | > 您的每一份捐赠,都将直接用于软件的开发、测试、维护以及优化,帮助更多用户享受到更好的使用体验。
246 | > 您可以选择通过支付宝、微信等在线支付平台进行捐赠,捐赠金额不限,您的每一份心意我都将倍加珍惜。
247 | > 再次感谢您的支持与厚爱!祝您生活愉快,工作顺利!
248 | > 空山明月 敬上
249 |
250 | 
251 |
252 | ### 捐赠记录
253 |
254 | |日期|捐赠者|金额|留言|
255 | | ----- | ----- | ----- | ----- |
256 | |2024-5-6|**飞|30.00|请保持维护和更新,我一直在用新世纪的码表|
257 | |2024-5-7|天青色|10.00|空山佬的方案让我再次爱上了五笔|
258 | |2024-5-8|An|5.00|无|
259 | |2024-5-8|*|50.00|无|
260 | |2024-05-15|YG777|66.00|无|
261 | |2024-05-16|悟空|30.00|无|
262 | |2024-05-18|WIIMOO|120.00|怎能辜负了这群为爱发电的战士,记得我的五笔拼音长语句输入哦|
263 | |2024-5-20|曵景成文|33.00|共攀书山,致敬前行者|
264 |
265 | ## QQ群
266 |
267 | 欢迎加入!
268 |
269 | 
270 |
271 | ## 有问有答
272 |
273 | *问:我部署了 `98` 版码表文件,但想用 `86` 的外观主题,请问怎么配置?*
274 |
275 | > 答:在 `tables` 目录的子文件下,含有不同版本的码表文件及一个外观主题文件 `weasel.yaml`,可以将 `tables/86/weasel.yaml` 替换到用户目录下,重新部署,即可使用 `诗意之春` 主题。
276 |
277 | *问:更换外观主题后重新部署,但主题还是 `86` 方案默认的绿色主题,这个问题怎么解决?*
278 |
279 | > 答:本项目默认不提供任何 `.custom.yaml` 配置文件,因此,在部署完成后,用户目录下会生成一个空的 `weasel.custom.yaml` 文件。解决方法有两种,一种是在这个文件首行添加一行注释,即以 `#` 开头的文字描述,另一种是将这个文件删除。之后再重新部署,新更新的主题即可显现。
280 |
281 | ## 相关链接
282 |
283 | ### 项目镜像地址
284 | - Gitee 地址:https://gitee.com/hi-coder/rime-wubi
285 | - Github 地址:https://github.com/mrshiqiqi/rime-wubi
286 |
287 | ### Rime 输入法引擎
288 | - Rime 官网:https://rime.im
289 | - Rime 下载地址:https://rime.im/download
290 | - Rime 帮助文档:https://rime.im/docs
291 | - 小狼毫项目地址:https://github.com/rime/weasel
292 | - 鼠须管项目地址: https://github.com/rime/squirrel
293 | - 中州韵项目地址:https://github.com/rime/ibus-rime
294 | - 小狼毫外观配置说明文档:https://github.com/rime/weasel/wiki
295 | - 小狼毫配色工具:https://bennyyip.github.io/Rime-See-Me
296 | - 鼠须管配色工具:https://gjrobert.github.io/Rime-See-Me-squirrel
297 |
298 | ### 中书君项目
299 | - Gitee 地址:https://gitee.com/hi-coder/WubiMaster
300 | - Github 地址:https://github.com/mrshiqiqi/WubiMaster
301 |
302 | ---
303 |
304 | 赠人玫瑰,手有余香!🌹
305 | 帮忙👇点个⭐,星标数量越多,越能让更多人发现这个项目!
--------------------------------------------------------------------------------
/colors/aqua.yaml:
--------------------------------------------------------------------------------
1 | description:
2 | color_name: aqua
3 | display_name: 碧水/Aqua
4 | create_time: 2024-04-26 14:15:16
5 | update_time: 2024-04-26 14:15:16
6 | is_template: true
7 | style:
8 | color_scheme: aqua
9 | font_face: Microsoft YaHei
10 | label_font_face: Microsoft YaHei
11 | comment_font_face: 黑体字根
12 | font_point: 14
13 | label_font_point: 14
14 | comment_font_point: 13
15 | horizontal: false
16 | fullscreen: false
17 | inline_preedit: false
18 | preedit_type: composition
19 | display_tray_icon: false
20 | label_format: "%s."
21 | mark_text: ""
22 | vertical_auto_reverse: false
23 | vertical_text: false
24 | vertical_text_left_to_right: false
25 | vertical_text_with_wrap: false
26 | layout:
27 | align_type: center
28 | max_width: 0
29 | min_width: 160
30 | min_height: 0
31 | max_height: 0
32 | border_width: 3
33 | margin_x: 12
34 | margin_y: 12
35 | spacing: 10
36 | candidate_spacing: 5
37 | hilite_spacing: 4
38 | hilite_padding: 2
39 | round_corner: 4
40 | corner_radius: 4
41 | shadow_radius: 0
42 | shadow_offset_x: 4
43 | shadow_offset_y: 4
44 |
45 | preset_color_schemes:
46 | aqua:
47 | name: 碧水/Aqua
48 | author: 佛振
49 | text_color: 0x000000 #默认文字颜色
50 | back_color: 0xeceeee #候选窗背景色
51 | shadow_color: 0x00000000 #候选窗阴影色,默认全透明(无阴影)
52 | border_color: 0xe0e0e0 #候选窗边框颜色
53 | hilited_text_color: 0x000000 #编码文字颜色
54 | hilited_back_color: 0xd4d4d4 #编码背景颜色
55 | hilited_shadow_color: 0x00000000 #编码背景块阴影颜色
56 | hilited_candidate_text_color: 0xffffff #高亮候选文字颜色
57 | hilited_candidate_back_color: 0xfa3a0a #高亮候选背景颜色
58 | hilited_candidate_shadow_color: 0x00000000 #高亮候选背景块阴影颜色
59 | candidate_text_color: 0x000000 #非高亮候选文字颜色
60 | candidate_back_color: 0xeceeee #非高亮候选背景颜色
61 | candidate_shadow_color: 0x00000000 #非高亮候选背景块阴影颜色
--------------------------------------------------------------------------------
/colors/azure.yaml:
--------------------------------------------------------------------------------
1 | description:
2 | color_name: azure
3 | display_name: 青天/Azure
4 | create_time: 2024-04-26 14:15:16
5 | update_time: 2024-04-26 14:15:16
6 | is_template: true
7 | style:
8 | color_scheme: azure
9 | font_face: Microsoft YaHei
10 | label_font_face: Microsoft YaHei
11 | comment_font_face: 黑体字根
12 | font_point: 14
13 | label_font_point: 14
14 | comment_font_point: 13
15 | horizontal: false
16 | fullscreen: false
17 | inline_preedit: false
18 | preedit_type: composition
19 | display_tray_icon: false
20 | label_format: "%s."
21 | mark_text: ""
22 | vertical_auto_reverse: false
23 | vertical_text: false
24 | vertical_text_left_to_right: false
25 | vertical_text_with_wrap: false
26 | layout:
27 | align_type: center
28 | max_width: 0
29 | min_width: 160
30 | min_height: 0
31 | max_height: 0
32 | border_width: 3
33 | margin_x: 12
34 | margin_y: 12
35 | spacing: 10
36 | candidate_spacing: 5
37 | hilite_spacing: 4
38 | hilite_padding: 2
39 | round_corner: 4
40 | corner_radius: 4
41 | shadow_radius: 0
42 | shadow_offset_x: 4
43 | shadow_offset_y: 4
44 |
45 | preset_color_schemes:
46 | azure:
47 | name: 青天/Azure
48 | author: 佛振
49 | text_color: 0xffe8ca
50 | candidate_text_color: 0xfff8ee
51 | back_color: 0x8b4e01
52 | border_color: 0x8b4e01
53 | hilited_text_color: 0xfff8ee
54 | hilited_back_color: 0x8b4e01
55 | hilited_candidate_text_color: 0x7ffeff
56 | hilited_candidate_back_color: 0xa95e01
57 | comment_text_color: 0xc69664
--------------------------------------------------------------------------------
/colors/ink.yaml:
--------------------------------------------------------------------------------
1 | description:
2 | color_name: ink
3 | display_name: 墨池/Ink
4 | create_time: 2024-04-26 14:15:16
5 | update_time: 2024-04-26 14:15:16
6 | is_template: true
7 | style:
8 | color_scheme: ink
9 | font_face: Microsoft YaHei
10 | label_font_face: Microsoft YaHei
11 | comment_font_face: 黑体字根
12 | font_point: 14
13 | label_font_point: 14
14 | comment_font_point: 13
15 | horizontal: false
16 | fullscreen: false
17 | inline_preedit: false
18 | preedit_type: composition
19 | display_tray_icon: false
20 | label_format: "%s."
21 | mark_text: ""
22 | vertical_auto_reverse: false
23 | vertical_text: false
24 | vertical_text_left_to_right: false
25 | vertical_text_with_wrap: false
26 | layout:
27 | align_type: center
28 | max_width: 0
29 | min_width: 160
30 | min_height: 0
31 | max_height: 0
32 | border_width: 3
33 | margin_x: 12
34 | margin_y: 12
35 | spacing: 10
36 | candidate_spacing: 5
37 | hilite_spacing: 4
38 | hilite_padding: 2
39 | round_corner: 4
40 | corner_radius: 4
41 | shadow_radius: 0
42 | shadow_offset_x: 4
43 | shadow_offset_y: 4
44 |
45 | preset_color_schemes:
46 | ink:
47 | name: 墨池/Ink
48 | author: 佛振
49 | text_color: 0x000000
50 | back_color: 0xffffff
51 | border_color: 0x000000
52 | hilited_text_color: 0x000000
53 | hilited_back_color: 0xdddddd
54 | hilited_candidate_text_color: 0xffffff
55 | hilited_candidate_back_color: 0x000000
--------------------------------------------------------------------------------
/colors/lost_temple.yaml:
--------------------------------------------------------------------------------
1 | description:
2 | color_name: lost_temple
3 | display_name: 孤寺/Lost Temple
4 | create_time: 2024-04-26 14:15:16
5 | update_time: 2024-04-26 14:15:16
6 | is_template: true
7 | style:
8 | color_scheme: lost_temple
9 | font_face: Microsoft YaHei
10 | label_font_face: Microsoft YaHei
11 | comment_font_face: 黑体字根
12 | font_point: 14
13 | label_font_point: 14
14 | comment_font_point: 13
15 | horizontal: false
16 | fullscreen: false
17 | inline_preedit: false
18 | preedit_type: composition
19 | display_tray_icon: false
20 | label_format: "%s."
21 | mark_text: ""
22 | vertical_auto_reverse: false
23 | vertical_text: false
24 | vertical_text_left_to_right: false
25 | vertical_text_with_wrap: false
26 | layout:
27 | align_type: center
28 | max_width: 0
29 | min_width: 160
30 | min_height: 0
31 | max_height: 0
32 | border_width: 3
33 | margin_x: 12
34 | margin_y: 12
35 | spacing: 10
36 | candidate_spacing: 5
37 | hilite_spacing: 4
38 | hilite_padding: 2
39 | round_corner: 4
40 | corner_radius: 4
41 | shadow_radius: 0
42 | shadow_offset_x: 4
43 | shadow_offset_y: 4
44 |
45 | preset_color_schemes:
46 | lost_temple:
47 | name: 孤寺/Lost Temple
48 | author: 佛振 , based on ir_black
49 | text_color: 0xe8f3f6
50 | back_color: 0x444444
51 | border_color: 0x444444
52 | hilited_text_color: 0x82e6ca
53 | hilited_back_color: 0x222222
54 | hilited_candidate_text_color: 0x000000
55 | hilited_candidate_back_color: 0x82e6ca
--------------------------------------------------------------------------------
/colors/luna.yaml:
--------------------------------------------------------------------------------
1 | description:
2 | color_name: luna
3 | display_name: 明月/Luna
4 | create_time: 2024-04-26 14:15:16
5 | update_time: 2024-04-26 14:15:16
6 | is_template: true
7 | style:
8 | color_scheme: luna
9 | font_face: Microsoft YaHei
10 | label_font_face: Microsoft YaHei
11 | comment_font_face: 黑体字根
12 | font_point: 14
13 | label_font_point: 14
14 | comment_font_point: 13
15 | horizontal: false
16 | fullscreen: false
17 | inline_preedit: false
18 | preedit_type: composition
19 | display_tray_icon: false
20 | label_format: "%s."
21 | mark_text: ""
22 | vertical_auto_reverse: false
23 | vertical_text: false
24 | vertical_text_left_to_right: false
25 | vertical_text_with_wrap: false
26 | layout:
27 | align_type: center
28 | max_width: 0
29 | min_width: 160
30 | min_height: 0
31 | max_height: 0
32 | border_width: 3
33 | margin_x: 12
34 | margin_y: 12
35 | spacing: 10
36 | candidate_spacing: 5
37 | hilite_spacing: 4
38 | hilite_padding: 2
39 | round_corner: 4
40 | corner_radius: 4
41 | shadow_radius: 0
42 | shadow_offset_x: 4
43 | shadow_offset_y: 4
44 |
45 | preset_color_schemes:
46 | luna:
47 | name: 明月/Luna
48 | author: 佛振
49 | text_color: 0x000000
50 | back_color: 0xffffff
51 | border_color: 0xcccccc
52 | hilited_text_color: 0x000000
53 | hilited_back_color: 0x7fffff
54 | hilited_candidate_text_color: 0xffffff
55 | hilited_candidate_back_color: 0x000000
--------------------------------------------------------------------------------
/colors/poetry_plum.yaml:
--------------------------------------------------------------------------------
1 | description:
2 | color_name: poetry_plum
3 | display_name: 诗意之梅/Poetry Plum
4 | create_time: 2024-04-26 14:15:16
5 | update_time: 2024-04-26 14:15:16
6 | is_template: true
7 | ### 样式
8 | style:
9 | # ...外观...
10 | color_scheme: poetry_plum # 配色方案
11 | # ...字体...
12 | font_face: 微软雅黑 # 全局字体
13 | label_font_face: 微软雅黑 # 标签字体
14 | comment_font_face: 黑体字根 # 注释字体
15 | font_point: 15 # 全局字号
16 | label_font_point: 12 # 标签字号
17 | comment_font_point: 12 # 注释字号
18 | # ... 窗口...
19 | fullscreen: false # 是否全屏模式
20 | horizontal: false # 是否横向布局
21 | vertical_text: true # 是否启用竖排文本
22 | vertical_text_left_to_right: true # 竖排方向是否从左到右
23 | vertical_text_with_wrap: false # 文本竖排模式下是否自动换行
24 | vertical_auto_reverse: false # 文本竖排模式下,候选窗口位于光标上方时倒序排序
25 | # ...预编辑区...
26 | inline_preedit: true # 是否在行内显示预编辑区
27 | preedit_type: composition # 预编辑区显示内容 composition(编码);preview(高亮候选);preview_all(全部候选)
28 | # ...其他选项...
29 | label_format: "%s" # 标签字符号
30 | mark_text: "❀" # 候选项前的标记符号
31 | ascii_tip_follow_cursor: false # 切换 ASCII 模式时,提示跟随鼠标,而非输入光标
32 | enhanced_position: false # 无法定位候选框时,在窗口左上角显示候选框
33 | display_tray_icon: false # 托盘显示独立于语言栏的额外图标
34 | antialias_mode: default # antialias_mode (default;force_dword;cleartype;grayscale;aliased)
35 | candidate_abbreviate_length: 20 # 候选项略写,超过此数字则用省略号代替。设置为 0 则不启用此功能
36 | paging_on_scroll: false # 在候选窗口上滑动滚轮的行为:true(翻页);false(选中下一个候选)
37 | click_to_capture: true # 鼠标点击候选项,创建截图
38 | ### 布局
39 | layout:
40 | align_type: center # 标签、候选文字、注解文字之间的相对对齐方式 (top ; center ; bottom)
41 | max_height: 0 # 候选框最大高度,0 不启用此功能
42 | max_width: 0 # 候选框最大宽度,0 不启用此功能
43 | min_height: 0 # 候选框最小高度
44 | min_width: 0 # 候选框最小宽度
45 | border_width: 0 # 边框宽度
46 | margin_x: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
47 | margin_y: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
48 | spacing: 5 # inline_preedit 为 false 时,编码区域和候选区域的间距
49 | candidate_spacing: 8 # 候选项之间的间距
50 | hilite_spacing: 8 # 候选项和相应标签的间距,候选项与注解文字之间的距离
51 | hilite_padding: 8 # 高亮区域和内部文字的间距,影响高亮区域大小
52 | shadow_radius: 2 # 阴影区域半径,为 0 不显示阴影;需要同时在配色方案中指定非透明的阴影颜色
53 | shadow_offset_x: 2 # 阴影绘制的偏离距离
54 | shadow_offset_y: 2 # 阴影绘制的偏离距离
55 | corner_radius: 13 # 候选窗口圆角半径
56 | round_corner: 13 # 候选背景色块圆角半径,别名 hilited_corner_radius
57 |
58 | preset_color_schemes:
59 | poetry_plum:
60 | name: 诗意之梅/Poetry Plum
61 | author: 空山明月
62 | text_color: 0x333333 # 默认文字颜色
63 | comment_text_color: 0x5c5c5c # 注释文字颜色
64 | label_color: 0x5c5c5c # 标签文字颜色
65 | back_color: 0xeceeee # 候选窗背景色
66 | shadow_color: 0xAAe0e0e0 # 候选窗阴影色
67 | border_color: 0xb1c8b4 # 候选窗边框颜色
68 | hilited_text_color: 0x000000 # 编码文字颜色
69 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
70 | hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
71 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
72 | hilited_candidate_back_color: 0x2904d9 # 高亮候选背景颜色
73 | hilited_label_color: 0xe3fbe6 # 高亮候选的标签颜色
74 | hilited_mark_color: 0x000000 # 高亮候选前的标记颜色
75 | hilited_comment_text_color: 0xd9f1dc # 高亮候选的注释颜色
76 | candidate_text_color: 0x000000 # 非高亮候选文字颜色
77 | candidate_back_color: 0xeceeee # 非高亮候选背景颜色
78 | candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
--------------------------------------------------------------------------------
/colors/poetry_spring.yaml:
--------------------------------------------------------------------------------
1 | description:
2 | color_name: poetry_spring
3 | display_name: 诗意之春/Poetry Spring
4 | create_time: 2024-04-26 14:15:16
5 | update_time: 2024-04-26 14:15:16
6 | is_template: true
7 | ### 样式
8 | style:
9 | # ...外观...
10 | color_scheme: poetry_spring # 配色方案
11 | # ...字体...
12 | font_face: 微软雅黑 # 全局字体
13 | label_font_face: 微软雅黑 # 标签字体
14 | comment_font_face: 黑体字根 # 注释字体
15 | font_point: 15 # 全局字号
16 | label_font_point: 12 # 标签字号
17 | comment_font_point: 12 # 注释字号
18 | # ... 窗口...
19 | fullscreen: false # 是否全屏模式
20 | horizontal: false # 是否横向布局
21 | vertical_text: true # 是否启用竖排文本
22 | vertical_text_left_to_right: true # 竖排方向是否从左到右
23 | vertical_text_with_wrap: false # 文本竖排模式下是否自动换行
24 | vertical_auto_reverse: false # 文本竖排模式下,候选窗口位于光标上方时倒序排序
25 | # ...预编辑区...
26 | inline_preedit: true # 是否在行内显示预编辑区
27 | preedit_type: composition # 预编辑区显示内容 composition(编码);preview(高亮候选);preview_all(全部候选)
28 | # ...其他选项...
29 | label_format: "%s" # 标签字符号
30 | mark_text: "❀" # 候选项前的标记符号
31 | ascii_tip_follow_cursor: false # 切换 ASCII 模式时,提示跟随鼠标,而非输入光标
32 | enhanced_position: false # 无法定位候选框时,在窗口左上角显示候选框
33 | display_tray_icon: false # 托盘显示独立于语言栏的额外图标
34 | antialias_mode: default # antialias_mode (default;force_dword;cleartype;grayscale;aliased)
35 | candidate_abbreviate_length: 20 # 候选项略写,超过此数字则用省略号代替。设置为 0 则不启用此功能
36 | paging_on_scroll: false # 在候选窗口上滑动滚轮的行为:true(翻页);false(选中下一个候选)
37 | click_to_capture: true # 鼠标点击候选项,创建截图
38 | ### 布局
39 | layout:
40 | align_type: center # 标签、候选文字、注解文字之间的相对对齐方式 (top ; center ; bottom)
41 | max_height: 0 # 候选框最大高度,0 不启用此功能
42 | max_width: 0 # 候选框最大宽度,0 不启用此功能
43 | min_height: 0 # 候选框最小高度
44 | min_width: 0 # 候选框最小宽度
45 | border_width: 0 # 边框宽度
46 | margin_x: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
47 | margin_y: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
48 | spacing: 5 # inline_preedit 为 false 时,编码区域和候选区域的间距
49 | candidate_spacing: 8 # 候选项之间的间距
50 | hilite_spacing: 8 # 候选项和相应标签的间距,候选项与注解文字之间的距离
51 | hilite_padding: 8 # 高亮区域和内部文字的间距,影响高亮区域大小
52 | shadow_radius: 2 # 阴影区域半径,为 0 不显示阴影;需要同时在配色方案中指定非透明的阴影颜色
53 | shadow_offset_x: 2 # 阴影绘制的偏离距离
54 | shadow_offset_y: 2 # 阴影绘制的偏离距离
55 | corner_radius: 13 # 候选窗口圆角半径
56 | round_corner: 13 # 候选背景色块圆角半径,别名 hilited_corner_radius
57 |
58 | preset_color_schemes:
59 | poetry_spring:
60 | name: 诗意之春/Poetry Spring
61 | author: 空山明月
62 | text_color: 0x333333 # 默认文字颜色
63 | comment_text_color: 0x5c5c5c # 注释文字颜色
64 | label_color: 0x5c5c5c # 标签文字颜色
65 | back_color: 0xeceeee # 候选窗背景色
66 | shadow_color: 0xAAe0e0e0 # 候选窗阴影色
67 | border_color: 0xb1c8b4 # 候选窗边框颜色
68 | hilited_text_color: 0x000000 # 编码文字颜色
69 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
70 | hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
71 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
72 | hilited_candidate_back_color: 0x50AF4C # 高亮候选背景颜色
73 | hilited_label_color: 0xe3fbe6 # 高亮候选的标签颜色
74 | hilited_mark_color: 0x4040FF # 高亮候选前的标记颜色
75 | hilited_comment_text_color: 0xd9f1dc # 高亮候选的注释颜色
76 | candidate_text_color: 0x000000 # 非高亮候选文字颜色
77 | candidate_back_color: 0xeceeee # 非高亮候选背景颜色
78 | candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
--------------------------------------------------------------------------------
/colors/potry_ocean.yaml:
--------------------------------------------------------------------------------
1 | description:
2 | color_name: poetry_ocean
3 | display_name: 诗意之海/Poetry Ocean
4 | create_time: 2024-04-26 14:15:16
5 | update_time: 2024-04-26 14:15:16
6 | is_template: true
7 | ### 样式
8 | style:
9 | # ...外观...
10 | color_scheme: poetry_ocean # 配色方案
11 | # ...字体...
12 | font_face: 微软雅黑 # 全局字体
13 | label_font_face: 微软雅黑 # 标签字体
14 | comment_font_face: 黑体字根 # 注释字体
15 | font_point: 15 # 全局字号
16 | label_font_point: 12 # 标签字号
17 | comment_font_point: 12 # 注释字号
18 | # ... 窗口...
19 | fullscreen: false # 是否全屏模式
20 | horizontal: false # 是否横向布局
21 | vertical_text: true # 是否启用竖排文本
22 | vertical_text_left_to_right: true # 竖排方向是否从左到右
23 | vertical_text_with_wrap: false # 文本竖排模式下是否自动换行
24 | vertical_auto_reverse: false # 文本竖排模式下,候选窗口位于光标上方时倒序排序
25 | # ...预编辑区...
26 | inline_preedit: true # 是否在行内显示预编辑区
27 | preedit_type: composition # 预编辑区显示内容 composition(编码);preview(高亮候选);preview_all(全部候选)
28 | # ...其他选项...
29 | label_format: "%s" # 标签字符号
30 | mark_text: "❀" # 候选项前的标记符号
31 | ascii_tip_follow_cursor: false # 切换 ASCII 模式时,提示跟随鼠标,而非输入光标
32 | enhanced_position: false # 无法定位候选框时,在窗口左上角显示候选框
33 | display_tray_icon: false # 托盘显示独立于语言栏的额外图标
34 | antialias_mode: default # antialias_mode (default;force_dword;cleartype;grayscale;aliased)
35 | candidate_abbreviate_length: 20 # 候选项略写,超过此数字则用省略号代替。设置为 0 则不启用此功能
36 | paging_on_scroll: false # 在候选窗口上滑动滚轮的行为:true(翻页);false(选中下一个候选)
37 | click_to_capture: true # 鼠标点击候选项,创建截图
38 | ### 布局
39 | layout:
40 | align_type: center # 标签、候选文字、注解文字之间的相对对齐方式 (top ; center ; bottom)
41 | max_height: 0 # 候选框最大高度,0 不启用此功能
42 | max_width: 0 # 候选框最大宽度,0 不启用此功能
43 | min_height: 0 # 候选框最小高度
44 | min_width: 0 # 候选框最小宽度
45 | border_width: 0 # 边框宽度
46 | margin_x: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
47 | margin_y: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
48 | spacing: 5 # inline_preedit 为 false 时,编码区域和候选区域的间距
49 | candidate_spacing: 8 # 候选项之间的间距
50 | hilite_spacing: 8 # 候选项和相应标签的间距,候选项与注解文字之间的距离
51 | hilite_padding: 8 # 高亮区域和内部文字的间距,影响高亮区域大小
52 | shadow_radius: 2 # 阴影区域半径,为 0 不显示阴影;需要同时在配色方案中指定非透明的阴影颜色
53 | shadow_offset_x: 2 # 阴影绘制的偏离距离
54 | shadow_offset_y: 2 # 阴影绘制的偏离距离
55 | corner_radius: 13 # 候选窗口圆角半径
56 | round_corner: 13 # 候选背景色块圆角半径,别名 hilited_corner_radius
57 |
58 | preset_color_schemes:
59 | poetry_ocean:
60 | name: 诗意之海/Poetry Ocean
61 | author: 空山明月
62 | text_color: 0x333333 # 默认文字颜色
63 | comment_text_color: 0x5c5c5c # 注释文字颜色
64 | label_color: 0x5c5c5c # 标签文字颜色
65 | back_color: 0xeceeee # 候选窗背景色
66 | shadow_color: 0xAAe0e0e0 # 候选窗阴影色
67 | border_color: 0xb1c8b4 # 候选窗边框颜色
68 | hilited_text_color: 0x000000 # 编码文字颜色
69 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
70 | hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
71 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
72 | hilited_candidate_back_color: 0x9D4B17 # 高亮候选背景颜色
73 | hilited_label_color: 0xe3fbe6 # 高亮候选的标签颜色
74 | hilited_mark_color: 0x33D5F8 # 高亮候选前的标记颜色
75 | hilited_comment_text_color: 0xd9f1dc # 高亮候选的注释颜色
76 | candidate_text_color: 0x000000 # 非高亮候选文字颜色
77 | candidate_back_color: 0xeceeee # 非高亮候选背景颜色
78 | candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
--------------------------------------------------------------------------------
/colors/wechat.yaml:
--------------------------------------------------------------------------------
1 | description:
2 | color_name: wechat
3 | display_name: "微信/Wechat"
4 | create_time: 2024-04-26 14:15:16
5 | update_time: 2024-04-26 14:15:16
6 | is_template: true
7 | style:
8 | antialias_mode: default
9 | ascii_tip_follow_cursor: false
10 | candidate_abbreviate_length: 20
11 | click_to_capture: true
12 | color_scheme: wechat
13 | color_theme_dark: wechat
14 | comment_font_face: 黑体字根
15 | comment_font_point: 13
16 | display_tray_icon: false
17 | enable_mouse:
18 | enhanced_position: false
19 | font_face: 微软雅黑
20 | font_point: 15
21 | fullscreen: false
22 | horizontal: true
23 | inline_preedit: true
24 | label_font_face: 微软雅黑
25 | label_font_point: 15
26 | label_format: '%s'
27 | layout:
28 | align_type: center
29 | border_width: 2
30 | candidate_spacing: 24
31 | corner_radius: 8
32 | hilite_padding: 5
33 | hilite_spacing: 6
34 | margin_x: 10
35 | margin_y: 8
36 | max_height: 0
37 | max_width: 1200
38 | min_height: 0
39 | min_width: 10
40 | round_corner: 8
41 | shadow_offset_x: 5
42 | shadow_offset_y: 5
43 | shadow_radius: 4
44 | spacing: 16
45 | mark_text:
46 | paging_on_scroll: false
47 | preedit_type: composition
48 | vertical_auto_reverse: false
49 | vertical_text: false
50 | vertical_text_left_to_right: true
51 | vertical_text_with_wrap: false
52 | preset_color_schemes:
53 | wechat:
54 | name: "微信/Wechat"
55 | text_color: 0x424242
56 | label_color: 0x999999
57 | back_color: 0xFFFFFF
58 | border_color: 0xFFFFFF
59 | comment_text_color: 0x999999
60 | candidate_text_color: 0x3c3c3c
61 | hilited_comment_text_color: 0xFFFFFF
62 | hilited_back_color: 0x79af22
63 | hilited_text_color: 0xFFFFFF
64 | hilited_label_color: 0xFFFFFF
65 | hilited_candidate_back_color: 0x79af22
66 | shadow_color: 0x20000000
67 |
--------------------------------------------------------------------------------
/default.yaml:
--------------------------------------------------------------------------------
1 | # Rime settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | config_version: '2.1'
7 |
8 | schema_list:
9 | - {schema: wubi}
10 | - {schema: wubi_pinyin}
11 | - {schema: pinyin}
12 |
13 | switcher:
14 | caption: 〈菜单项〉
15 | hotkeys:
16 | - Control+grave
17 | - Control+Shift+grave
18 | save_options:
19 | - full_shape
20 | - ascii_punct
21 | - simplification
22 | - extended_charset
23 | - zh_hant
24 | - zh_hans
25 | - zh_hant_tw
26 | fold_options: true
27 | abbreviate_options: true
28 | option_list_separator: '/'
29 |
30 | punctuator:
31 | full_shape:
32 | __include: punctuation:/full_shape
33 | half_shape:
34 | __include: punctuation:/half_shape
35 |
36 | key_binder:
37 | bindings:
38 | __patch:
39 | - key_bindings:/emacs_editing
40 | - key_bindings:/move_by_word_with_tab
41 | - key_bindings:/paging_with_minus_equal
42 | - key_bindings:/paging_with_comma_period
43 | - key_bindings:/numbered_mode_switch
44 |
45 | recognizer:
46 | patterns:
47 | email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"
48 | uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
49 | url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$"
50 |
51 | ascii_composer:
52 | good_old_caps_lock: true
53 | switch_key:
54 | Shift_L: commit_code
55 | Shift_R: commit_code
56 | Control_L: noop
57 | Control_R: noop
58 | Caps_Lock: clear
59 | Eisu_toggle: clear
60 |
61 | menu:
62 | page_size: 5
63 | alternative_select_labels: [ ㊀, ㊁, ㊂, ㊃, ㊄, ㊅, ㊆, ㊇, ㊈, ㊉ ]
64 |
--------------------------------------------------------------------------------
/font/黑体字根.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/font/黑体字根.ttf
--------------------------------------------------------------------------------
/hot_keys.yaml:
--------------------------------------------------------------------------------
1 | # Rime settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | patch:
7 | app_options/chrome.exe: {ascii_mode: false}
8 | app_options/cmd.exe: {ascii_mode: false}
9 | app_options/conhost.exe: {ascii_mode: false}
10 | app_options/test1.exe: {ascii_mode: true}
11 | app_options/test2.exe: {ascii_mode: true}
12 | app_options/test3.exe: {ascii_mode: true}
13 | app_options/QQ.exe: {ascii_mode: true}
14 |
15 | # style/font_face: "黑体字根, Microsoft Yahei, 全宋体-1, 全宋体-2, 全宋体-3, 全宋体-F, 全宋体-X, 全宋体(调和), 全宋体(等宽)"
16 | # style/label_font_face: "黑体字根, Microsoft Yahei, 全宋体-1, 全宋体-2, 全宋体-3, 全宋体-F, 全宋体-X, 全宋体(调和), 全宋体(等宽)"
17 | # style/comment_font_face: "黑体字根, Microsoft Yahei, 全宋体-1, 全宋体-2, 全宋体-3, 全宋体-F, 全宋体-X, 全宋体(调和), 全宋体(等宽)"
18 |
--------------------------------------------------------------------------------
/icons/CN.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/icons/CN.ico
--------------------------------------------------------------------------------
/icons/EN.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/icons/EN.ico
--------------------------------------------------------------------------------
/icons/full.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/icons/full.ico
--------------------------------------------------------------------------------
/icons/half.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/icons/half.ico
--------------------------------------------------------------------------------
/images/QQ.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/images/QQ.jpg
--------------------------------------------------------------------------------
/images/mac展示.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/images/mac展示.png
--------------------------------------------------------------------------------
/images/windows展示.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/images/windows展示.png
--------------------------------------------------------------------------------
/images/中书君.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/images/中书君.png
--------------------------------------------------------------------------------
/images/候选说明.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/images/候选说明.png
--------------------------------------------------------------------------------
/images/捐赠.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/images/捐赠.jpg
--------------------------------------------------------------------------------
/images/楔子.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrshiqiqi/rime-wubi/bbb27bf22463035edca313e61ed83b88f5fdd789/images/楔子.png
--------------------------------------------------------------------------------
/key_bindings.yaml:
--------------------------------------------------------------------------------
1 | # Rime key bindings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | emacs_editing:
7 | __append:
8 | - { when: composing, accept: Control+p, send: Up }
9 | - { when: composing, accept: Control+n, send: Down }
10 | - { when: composing, accept: Control+b, send: Left }
11 | - { when: composing, accept: Control+f, send: Right }
12 | - { when: composing, accept: Control+a, send: Home }
13 | - { when: composing, accept: Control+e, send: End }
14 | - { when: composing, accept: Control+d, send: Delete }
15 | - { when: composing, accept: Control+k, send: Shift+Delete }
16 | - { when: composing, accept: Control+h, send: BackSpace }
17 | - { when: composing, accept: Control+g, send: Escape }
18 | - { when: composing, accept: Control+bracketleft, send: Escape }
19 | - { when: composing, accept: Alt+v, send: Page_Up }
20 | - { when: composing, accept: Control+v, send: Page_Down }
21 |
22 | move_by_word_with_tab:
23 | __append:
24 | - { when: composing, accept: ISO_Left_Tab, send: Shift+Left }
25 | - { when: composing, accept: Shift+Tab, send: Shift+Left }
26 | - { when: composing, accept: Tab, send: Shift+Right }
27 |
28 | paging_with_minus_equal:
29 | __append:
30 | - { when: has_menu, accept: minus, send: Page_Up }
31 | - { when: has_menu, accept: equal, send: Page_Down }
32 |
33 | paging_with_comma_period:
34 | __append:
35 | - { when: paging, accept: comma, send: Page_Up }
36 | - { when: has_menu, accept: period, send: Page_Down }
37 |
38 | paging_with_brackets:
39 | __append:
40 | - { when: paging, accept: bracketleft, send: Page_Up }
41 | - { when: has_menu, accept: bracketright, send: Page_Down }
42 |
43 | numbered_mode_switch:
44 | __append:
45 | - { when: always, accept: Control+Shift+1, select: .next }
46 | - { when: always, accept: Control+Shift+2, toggle: ascii_mode }
47 | - { when: always, accept: Control+Shift+3, toggle: full_shape }
48 | - { when: always, accept: Control+Shift+4, toggle: simplification }
49 | - { when: always, accept: Control+Shift+5, toggle: extended_charset }
50 | - { when: always, accept: Control+Shift+exclam, select: .next }
51 | - { when: always, accept: Control+Shift+at, toggle: ascii_mode }
52 | - { when: always, accept: Control+Shift+numbersign, toggle: full_shape }
53 | - { when: always, accept: Control+Shift+dollar, toggle: simplification }
54 | - { when: always, accept: Control+Shift+percent, toggle: extended_charset }
55 |
56 | windows_compatible_mode_switch:
57 | __append:
58 | - { when: always, accept: Shift+space, toggle: full_shape }
59 | - { when: always, accept: Control+period, toggle: ascii_punct }
60 |
61 | optimized_mode_switch:
62 | __append:
63 | - { when: always, accept: Control+Shift+space, select: .next }
64 | - { when: always, accept: Shift+space, toggle: ascii_mode }
65 | - { when: always, accept: Control+comma, toggle: full_shape }
66 | - { when: always, accept: Control+period, toggle: ascii_punct }
67 | - { when: always, accept: Control+slash, toggle: simplification }
68 | - { when: always, accept: Control+backslash, toggle: extended_charset }
69 |
--------------------------------------------------------------------------------
/lua/Submit_text.lua:
--------------------------------------------------------------------------------
1 | local basic = require('lib/basic')
2 | local map = basic.map
3 | local index = basic.index
4 | local utf8chars = basic.utf8chars
5 | local matchstr = basic.matchstr
6 |
7 | local function commit_text_processor(key, env)
8 | local engine = env.engine
9 | local context = engine.context
10 | local composition = context.composition
11 | local segment = composition:back()
12 | local input_text = context.input
13 | local schema_name=env.engine.schema.schema_name or ""
14 | local page_size = env.engine.schema.page_size
15 | local schema_id=env.engine.schema.schema_id or ""
16 | local candidate_count =0
17 |
18 | if input_text:find("^%p*(%a+%d*)$") then
19 | if context:has_menu() then
20 | candidate_count = segment.menu:candidate_count()
21 | end
22 | env.last_1th_text=context:get_commit_text() or ""
23 | env.last_2th_text={text="",type=""}
24 | env.last_3th_text={text="",type=""}
25 | if candidate_count>1 then
26 | env.last_2th_text=segment:get_candidate_at(1)
27 | if candidate_count>2 then
28 | env.last_3th_text=segment:get_candidate_at(2)
29 | end
30 | end
31 | end
32 |
33 | -- `引导自造词记录保存
34 | -- 0x20空格,0x31大键盘数字1
35 | if input_text:find("^%`*(%l+%`%l+)") then
36 | local commit_text=context:get_commit_text() or ""
37 | if commit_text~="" and not commit_text:find("(%a)") and utf8.len(commit_text)>1 then
38 | env.userphrase=commit_text
39 | if segment.prompt:find('(%a+)') then
40 | env.inputtext=segment.prompt:gsub('[^%a]','')
41 | else
42 | env.inputtext=input_text
43 | end
44 | end
45 | else
46 | if key.keycode==0x20 or key.keycode>0x30 and key.keycode<0x39 then
47 | if env.userphrase~="" and env.userphrase~=nil and userphrasepath~="" then
48 | -- engine:commit_text(env.userphrase..env.inputtext.."\r")
49 | fileappendtext(userphrasepath,env.userphrase,env.inputtext,schema_name)
50 | env.userphrase=""
51 | env.inputtext=""
52 | end
53 | end
54 | end
55 |
56 | if key.keycode==0x27 and context:is_composing() and env.last_3th_text.text~="" then
57 | if env.last_3th_text.type=="reverse_lookup" or env.last_3th_text.type=="table" then
58 | context:clear()
59 | engine:commit_text(env.last_3th_text.text)
60 | return 1
61 | end
62 | end
63 |
64 | local m,n=input_text:find("^(%a+%d*)([%[%/%]\\])")
65 | if n~=nil and m~=nil then
66 | if (context:is_composing()) then
67 | -- local focus_text = context:get_commit_text()
68 | -- engine:commit_text(focus_text)
69 | context:clear()
70 | if input_text:find("^%u+%l*%d*") then -- 大写字母引导的日期反查与转换功能,[ 和 ] 分别对应二选三选
71 | if input_text:find("%[") then
72 | engine:commit_text(env.last_2th_text.text)
73 | elseif input_text:find("%]") then
74 | engine:commit_text(env.last_3th_text.text)
75 | end
76 | else
77 | engine:commit_text(env.last_1th_text..CandidateText[1]) -- 第1个候选标点符号
78 | end
79 | return 1
80 | end
81 | end
82 | return 2
83 | end
84 |
85 | -- 记录自造词、文件路径userphrasepath在rime.lua中定义
86 | function fileappendtext(filepath,context,input,schemaname)
87 | if not context:find('%a') then
88 | input=splitinput(input,utf8.len(context))
89 | context=context.."\t"..input.."\t〈"..schemaname.."〉"
90 | local f=io.open(filepath,"a+")
91 | local usertext=f:read("*a")
92 | if not usertext:find("[\r\n]*"..context) then
93 | f:write(context.."\r")
94 | end
95 | f:close()
96 | end
97 | end
98 |
99 | -- 格式化五笔组合编码
100 | function splitinput(input,len)
101 | input="`"..input:gsub("%`*$","")
102 | if len==2 and input:find("(%`%l%l+%`%l%l+)") then
103 | input=input:gsub('(%`%l%l)%l*(%`%l%l)%l*', '%1%2')
104 | return input:gsub('%`', '')
105 | elseif len==3 and input:find("(%`%l%l+%`%l%l+%`%l%l+)") then
106 | input=input:gsub('(%`%l)%l+(%`%l)%l+(%`%l%l)%l*', '%1%2%3')
107 | return input:gsub('%`', '')
108 | elseif len>3 and input:find("(%`%l%l+%`%l%l+%`%l%l+.*%`%l%l+)$") then
109 | input=input:gsub('(%`%l)%l+(%`%l)%l+(%`%l).*(%`%l)%l+$', '%1%2%3%4')
110 | return input:gsub('`', '')
111 | else
112 | return input:gsub('^%`*', '')
113 | end
114 | end
115 |
116 | return commit_text_processor
--------------------------------------------------------------------------------
/lua/calculator.lua:
--------------------------------------------------------------------------------
1 | -- Rime Script >https://github.com/baopaau/rime-lua-collection/blob/master/calculator.lua
2 | -- 簡易計算器(執行任何Lua表達式)
3 | -- modify: 空山明月
4 | -- date: 2024-05-10
5 | -- 格式:=
6 | -- Lambda語法糖:\.|
7 | --
8 | -- 例子:
9 | -- =1+1 輸出 2
10 | -- =floor(9^(8/7)*cos(deg(6))) 輸出 -3
11 | -- =e^pi>pi^e 輸出 true
12 | -- =max({1,7,2}) 輸出 7
13 | -- =map({1,2,3},\x.x^2|) 輸出 {1, 4, 9}
14 | -- =map(range(-5,5),\x.x*pi/4|,deriv(sin)) 輸出 {-0.7071, -1, -0.7071, 0, 0.7071, 1, 0.7071, 0, -0.7071, -1}
15 | -- =$(range(-5,5,0.01))(map,\x.-60*x^2-16*x+20|)(max)() 輸出 21.066
16 | -- =test(\x.trunc(sin(x),1e-3)==trunc(deriv(cos)(x),1e-3)|,range(-2,2,0.1)) 輸出 true
17 | --
18 | -- 函数名 描述 格式 结果
19 | -- pi 圆周率 =pi 3.1415926535898
20 | -- abs 取绝对值 =abs(-2012) 2012
21 | -- ceil 向上取整 =ceil(9.1) 10
22 | -- floor 向下取整 =floor(9.9) 9
23 | -- max 取参数最大值 =max(2,4,6,8) 8
24 | -- min 取参数最小值 =min(2,4,6,8) 2
25 | -- pow 计算x的y次幂 =pow(2,16) 65536
26 | -- sqrt 开平方 =sqrt(65536) 256
27 | -- mod 取模 =mod(65535,2) 1
28 | -- modf 取整数和小数部分 =modf(20.12) 20 0.12
29 | -- randomseed 设随机数种子 =randomseed(os.time())
30 | -- random 取随机数 =random(5,90) 5~90
31 | -- rad 角度转弧度 =rad(180) 3.1415926535898
32 | -- deg 弧度转角度 =deg(=pi) 180
33 | -- exp e的x次方 =exp(4) 54.598150033144
34 | -- log 计算x的自然对数 =log(54.598150033144) 4
35 | -- log10 计算10为底,x的对数 =log10(1000) 3
36 | -- frexp 将参数拆成x * (2 ^ y)的形式 =frexp(160) 0.625 8
37 | -- ldexp 计算x * (2 ^ y) =ldexp(0.625,8) 160
38 | -- sin 正弦 =sin(rad(30)) 0.5
39 | -- cos 余弦 =cos(rad(60)) 0.5
40 | -- tan 正切 =tan(rad(45)) 1
41 | -- asin 反正弦 =deg(asin(0.5)) 30
42 | -- acos 反余弦 =deg(acos(0.5)) 60
43 | -- atan 反正切 =deg(atan(1)) 45
44 | -- ————————————————
45 |
46 |
47 |
48 | -- 安装:
49 | -- - 將本文件保存至 /lua/
50 | -- - 在 /rime.lua 新增一行:
51 | -- `calculator = require("calculator")`
52 | -- - 在 /.schema.yaml 新增:
53 | -- `engine/translators/@next: lua_translator@calculator`
54 | -- `recognizer/patterns/expression: "^=.*$"`
55 | -- 註:
56 | -- - 替換爲RIME的共享目錄
57 | -- - 替換爲自己的方案ID
58 | -- - 如目錄/文件不存在,請自行創建
59 |
60 | -- 定義全局函數、常數(注意命名空間污染)
61 | cos = math.cos
62 | sin = math.sin
63 | tan = math.tan
64 | acos = math.acos
65 | asin = math.asin
66 | atan = math.atan
67 | rad = math.rad
68 | deg = math.deg
69 |
70 | abs = math.abs
71 | floor = math.floor
72 | ceil = math.ceil
73 | mod = math.fmod
74 |
75 | trunc = function (x, dc)
76 | if dc == nil then
77 | return math.modf(x)
78 | end
79 | return x - mod(x, dc)
80 | end
81 |
82 | round = function (x, dc)
83 | dc = dc or 1
84 | local dif = mod(x, dc)
85 | if abs(dif) > dc / 2 then
86 | return x < 0 and x - dif - dc or x - dif + dc
87 | end
88 | return x - dif
89 | end
90 |
91 | random = math.random
92 | randomseed = math.randomseed
93 |
94 | inf = math.huge
95 | MAX_INT = math.maxinteger
96 | MIN_INT = math.mininteger
97 | pi = math.pi
98 | sqrt = math.sqrt
99 | exp = math.exp
100 | e = exp(1)
101 | ln = math.log
102 | log = function (x, base)
103 | base = base or 10
104 | return ln(x)/ln(base)
105 | end
106 |
107 | min = function (arr)
108 | local m = inf
109 | for k, x in ipairs(arr) do
110 | m = x < m and x or m
111 | end
112 | return m
113 | end
114 |
115 | max = function (arr)
116 | local m = -inf
117 | for k, x in ipairs(arr) do
118 | m = x > m and x or m
119 | end
120 | return m
121 | end
122 |
123 | sum = function (t)
124 | local acc = 0
125 | for k,v in ipairs(t) do
126 | acc = acc + v
127 | end
128 | return acc
129 | end
130 |
131 | avg = function (t)
132 | return sum(t) / #t
133 | end
134 |
135 | isinteger = function (x)
136 | return math.fmod(x, 1) == 0
137 | end
138 |
139 | -- iterator . array
140 | array = function (...)
141 | local arr = {}
142 | for v in ... do
143 | arr[#arr + 1] = v
144 | end
145 | return arr
146 | end
147 |
148 | -- iterator <- [form, to)
149 | irange = function (from, to, step)
150 | if to == nil then
151 | to = from
152 | from = 0
153 | end
154 | step = step or 1
155 | local i = from - step
156 | to = to - step
157 | return function()
158 | if i < to then
159 | i = i + step
160 | return i
161 | end
162 | end
163 | end
164 |
165 | -- array <- [form, to)
166 | range = function (from, to, step)
167 | return array(irange(from, to, step))
168 | end
169 |
170 | -- array . reversed iterator
171 | irev = function (arr)
172 | local i = #arr + 1
173 | return function()
174 | if i > 1 then
175 | i = i - 1
176 | return arr[i]
177 | end
178 | end
179 | end
180 |
181 | -- array . reversed array
182 | arev = function (arr)
183 | return array(irev(arr))
184 | end
185 |
186 | test = function (f, t)
187 | for k,v in ipairs(t) do
188 | if not f(v) then
189 | return false
190 | end
191 | end
192 | return true
193 | end
194 |
195 | -- # Functional
196 | map = function (t, ...)
197 | local ta = {}
198 | for k,v in pairs(t) do
199 | local tmp = v
200 | for _,f in pairs({...}) do tmp = f(tmp) end
201 | ta[k] = tmp
202 | end
203 | return ta
204 | end
205 |
206 | filter = function (t, ...)
207 | local ta = {}
208 | local i = 1
209 | for k,v in pairs(t) do
210 | local erase = false
211 | for _,f in pairs({...}) do
212 | if not f(v) then
213 | erase = true
214 | break
215 | end
216 | end
217 | if not erase then
218 | ta[i] = v
219 | i = i + 1
220 | end
221 | end
222 | return ta
223 | end
224 |
225 | -- e.g: foldr({2,3},\n,x.x^n|,2) = 81
226 | foldr = function (t, f, acc)
227 | for k,v in pairs(t) do
228 | acc = f(acc, v)
229 | end
230 | return acc
231 | end
232 |
233 | -- e.g: foldl({2,3},\n,x.x^n|,2) = 512
234 | foldl = function (t, f, acc)
235 | for v in irev(t) do
236 | acc = f(acc, v)
237 | end
238 | return acc
239 | end
240 |
241 | -- 調用鏈生成函數(HOF for method chaining)
242 | -- e.g: chain(range(-5,5))(map,\x.x/5|)(map,sin)(map,\x.e^x*10|)(map,floor)()
243 | -- = floor(map(map(map(range(-5,5),\x.x/5|),sin),\x.e^x*10|))
244 | -- = {4, 4, 5, 6, 8, 10, 12, 14, 17, 20}
245 | -- 可以用 $ 代替 chain
246 | chain = function (t)
247 | local ta = t
248 | local function cf(f, ...)
249 | if f ~= nil then
250 | ta = f(ta, ...)
251 | return cf
252 | else
253 | return ta
254 | end
255 | end
256 | return cf
257 | end
258 |
259 | -- # Statistics
260 | fac = function (n)
261 | local acc = 1
262 | for i = 2,n do
263 | acc = acc * i
264 | end
265 | return acc
266 | end
267 |
268 | nPr = function (n, r)
269 | return fac(n) / fac(n - r)
270 | end
271 |
272 | nCr = function (n, r)
273 | return nPr(n,r) / fac(r)
274 | end
275 |
276 | MSE = function (t)
277 | local ss = 0
278 | local s = 0
279 | local n = #t
280 | for k,v in ipairs(t) do
281 | ss = ss + v*v
282 | s = s + v
283 | end
284 | return sqrt((n*ss - s*s) / (n*n))
285 | end
286 |
287 | -- # Linear Algebra
288 |
289 |
290 | -- # Calculus
291 | -- Linear approximation
292 | lapproxd = function (f, delta)
293 | local delta = delta or 1e-8
294 | return function (x)
295 | return (f(x+delta) - f(x)) / delta
296 | end
297 | end
298 |
299 | -- Symmetric approximation
300 | sapproxd = function (f, delta)
301 | local delta = delta or 1e-8
302 | return function (x)
303 | return (f(x+delta) - f(x-delta)) / delta / 2
304 | end
305 | end
306 |
307 | -- 近似導數
308 | deriv = function (f, delta, dc)
309 | dc = dc or 1e-4
310 | local fd = sapproxd(f, delta)
311 | return function (x)
312 | return round(fd(x), dc)
313 | end
314 | end
315 |
316 | -- Trapezoidal rule
317 | trapzo = function (f, a, b, n)
318 | local dif = b - a
319 | local acc = 0
320 | for i = 1, n-1 do
321 | acc = acc + f(a + dif * (i/n))
322 | end
323 | acc = acc * 2 + f(a) + f(b)
324 | acc = acc * dif / n / 2
325 | return acc
326 | end
327 |
328 | -- 近似積分
329 | integ = function (f, delta, dc)
330 | delta = delta or 1e-4
331 | dc = dc or 1e-4
332 | return function (a, b)
333 | if b == nil then
334 | b = a
335 | a = 0
336 | end
337 | local n = round(abs(b - a) / delta)
338 | return round(trapzo(f, a, b, n), dc)
339 | end
340 | end
341 |
342 | -- Runge-Kutta
343 | rk4 = function (f, timestep)
344 | local timestep = timestep or 0.01
345 | return function (start_x, start_y, time)
346 | local x = start_x
347 | local y = start_y
348 | local t = time
349 | -- loop until i >= t
350 | for i = 0, t, timestep do
351 | local k1 = f(x, y)
352 | local k2 = f(x + (timestep/2), y + (timestep/2)*k1)
353 | local k3 = f(x + (timestep/2), y + (timestep/2)*k2)
354 | local k4 = f(x + timestep, y + timestep*k3)
355 | y = y + (timestep/6)*(k1 + 2*k2 + 2*k3 + k4)
356 | x = x + timestep
357 | end
358 | return y
359 | end
360 | end
361 |
362 |
363 | -- # System
364 | date = os.date
365 | time = os.time
366 | path = function ()
367 | return debug.getinfo(1).source:match("@?(.*/)")
368 | end
369 |
370 |
371 | local function serialize(obj)
372 | local type = type(obj)
373 | if type == "number" then
374 | return isinteger(obj) and floor(obj) or obj
375 | elseif type == "boolean" then
376 | return tostring(obj)
377 | elseif type == "string" then
378 | return '"'..obj..'"'
379 | elseif type == "table" then
380 | local str = "{"
381 | local i = 1
382 | for k, v in pairs(obj) do
383 | if i ~= k then
384 | str = str.."["..serialize(k).."]="
385 | end
386 | str = str..serialize(v)..", "
387 | i = i + 1
388 | end
389 | str = str:len() > 3 and str:sub(0,-3) or str
390 | return str.."}"
391 | elseif pcall(obj) then -- function類型
392 | return "callable"
393 | end
394 | return obj
395 | end
396 |
397 |
398 |
399 |
400 | local function speakLiterally(str, valMap)
401 | valMap = valMap or {
402 | [0]="零"; "一"; "二"; "三"; "四"; "五"; "六"; "七"; "八"; "九"; "十";
403 | ["+"]="正"; ["-"]="负"; ["."]="点"; [""]=""
404 | }
405 |
406 | local tbOut = {}
407 | for k = 1, #str do
408 | local v = string.sub(str, k, k)
409 | v = tonumber(v) or v
410 | tbOut[k] = valMap[v]
411 | end
412 | return table.concat(tbOut)
413 | end
414 |
415 | local function speakMillitary(str)
416 | return speakLiterally(str, {[0]="洞"; "幺"; "两"; "三"; "四"; "五"; "六"; "拐"; "八"; "勾"; "十";["+"]="正"; ["-"]="负"; ["."]="点"; [""]=""})
417 | end
418 |
419 | local function splitNumStr(str)
420 | --[[
421 | split a number (or a string describing a number) into 4 parts:
422 | .sym: "+", "-" or ""
423 | .int: "0", "000", "123456", "", etc
424 | .dig: "." or ""
425 | .dec: "0", "10000", "00001", "", etc
426 | --]]
427 | local part = {}
428 | part.sym, part.int, part.dig, part.dec = string.match(str, "^([%+%-]?)(%d*)(%.?)(%d*)")
429 | return part
430 | end
431 |
432 | local function speakBar(str, posMap, valMap)
433 | posMap = posMap or {[1]="仟"; [2]="佰"; [3]="拾"; [4]=""}
434 | valMap = valMap or {[0]="零"; "一"; "二"; "三" ;"四"; "五"; "六"; "七"; "八"; "九"} -- the length of valMap[0] should not excess 1
435 |
436 | local out = ""
437 | local bar = string.sub("****" .. str, -4, -1) -- the integer part of a number string can be divided into bars; each bar has 4 bits
438 | for pos = 1, 4 do
439 | local val = tonumber(string.sub(bar, pos, pos))
440 | -- case1: place holder
441 | if val == nil then
442 | goto continue
443 | end
444 | -- case2: number 1~9
445 | if val > 0 then
446 | out = out .. valMap[val] .. posMap[pos]
447 | goto continue
448 | end
449 | -- case3: number 0
450 | local valNext = tonumber(string.sub(bar, pos+1, pos+1))
451 | if ( valNext==nil or valNext==0 )then
452 | goto continue
453 | else
454 | out = out .. valMap[0]
455 | goto continue
456 | end
457 | ::continue::
458 | end
459 | if out == "" then out = valMap[0] end
460 | return out
461 | end
462 |
463 | local function speakIntOfficially(str, posMap, valMap)
464 | posMap = posMap or {[1]="千"; [2]="百"; [3]="十"; [4]=""}
465 | valMap = valMap or {[0]="零"; "一"; "二"; "三" ;"四"; "五"; "六"; "七"; "八"; "九"} -- the length of valMap[0] should not excess 1
466 |
467 | -- split the number string into bars, for example, in:str=123456789 → out:tbBar={1|2345|6789}
468 | local int = string.match(str, "^0*(%d+)$")
469 | if int=="" then int = "0" end
470 | local remain = #int % 4
471 | if remain==0 then remain = 4 end
472 | local tbBar = {[1] = string.sub(int, 1, remain)}
473 | for pos = remain+1, #int, 4 do
474 | local bar = string.sub(int, pos, pos+3)
475 | table.insert(tbBar, bar)
476 | end
477 | -- generate the suffixes of each bar, for example, tbSpeakBarSuffix={亿|万|""}
478 | local tbSpeakBarSuffix = {[1]=""}
479 | for iBar = 2, #tbBar do
480 | local suffix = (iBar % 2 == 0) and ("万"..tbSpeakBarSuffix[1]) or ("亿"..tbSpeakBarSuffix[2])
481 | table.insert(tbSpeakBarSuffix, 1, suffix)
482 | end
483 | -- speak each bar
484 | local tbSpeakBar = {}
485 | for k = 1, #tbBar do
486 | tbSpeakBar[k] = speakBar(tbBar[k], posMap, valMap)
487 | end
488 | -- combine the results
489 | local out = ""
490 | for k = 1, #tbBar do
491 | local speakBar = tbSpeakBar[k]
492 | if speakBar ~= valMap[0] then
493 | out = out .. speakBar .. tbSpeakBarSuffix[k]
494 | end
495 | end
496 | if out == "" then out = valMap[0] end
497 | return out
498 | end
499 |
500 | local function speakDecMoney(str, posMap, valMap)
501 | posMap = posMap or {[1]="角"; [2]="分"; [3]="厘"; [4]="毫"}
502 | valMap = valMap or {[0]="零"; "壹"; "贰"; "叁" ;"肆"; "伍"; "陆"; "柒"; "捌"; "玖"} -- the length of valMap[0] should not excess 1
503 |
504 | local dec = string.sub(str, 1, 4)
505 | dec = string.gsub(dec, "0*$", "")
506 | if dec == "" then
507 | return "整"
508 | end
509 |
510 | local out = ""
511 | for pos = 1, #dec do
512 | local val = tonumber(string.sub(dec, pos, pos))
513 | out = out .. valMap[val] .. posMap[pos]
514 | end
515 | return out
516 | end
517 |
518 | local function speakOfficiallyLower(str)
519 | local part = splitNumStr(str)
520 | local speakSym = speakLiterally(part.sym)
521 | local speakInt = speakIntOfficially(part.int)
522 | local speakDig = speakLiterally(part.dig)
523 | local speakDec = speakLiterally(part.dec)
524 | local out = speakSym .. speakInt .. speakDig .. speakDec
525 | return out
526 | end
527 |
528 | local function speakOfficiallyUpper(str)
529 | local part = splitNumStr(str)
530 | local speakSym = speakLiterally(part.sym)
531 | local speakInt = speakIntOfficially(part.int, {[1]="仟"; [2]="佰"; [3]="拾"; [4]=""}, {[0]="零"; "壹"; "贰"; "叁" ;"肆"; "伍"; "陆"; "柒"; "捌"; "玖"})
532 | local speakDig = speakLiterally(part.dig)
533 | local speakDec = speakLiterally(part.dec)
534 | local out = speakSym .. speakInt .. speakDig .. speakDec
535 | return out
536 | end
537 |
538 | local function speakMoneyUpper(str)
539 | local part = splitNumStr(str)
540 | local speakSym = speakLiterally(part.sym)
541 | local speakInt = speakIntOfficially(part.int, {[1]="仟"; [2]="佰"; [3]="拾"; [4]=""}, {[0]="零"; "壹"; "贰"; "叁" ;"肆"; "伍"; "陆"; "柒"; "捌"; "玖"}) .. "元"
542 | local speakDec = speakDecMoney(part.dec)
543 | local out = speakSym .. speakInt .. speakDec
544 | return out
545 | end
546 |
547 | local function speakMoneyLower(str)
548 | local part = splitNumStr(str)
549 | local speakSym = speakLiterally(part.sym)
550 | local speakInt = speakIntOfficially(part.int, {[1]="千"; [2]="百"; [3]="十"; [4]=""}, {[0]="〇"; "一"; "二"; "三" ;"四"; "五"; "六"; "七"; "八"; "九"}) .. "元"
551 | local speakDec = speakDecMoney(part.dec)
552 | local out = speakSym .. speakInt .. speakDec
553 | return out
554 | end
555 |
556 | local function baseConverse(str, from, to)
557 | local str10 = str
558 | if from == 16 then
559 | str10 = string.format("%d", str)
560 | end
561 | local strout = str10
562 | if to == 16 then
563 | strout = string.format("%#x", str10)
564 | end
565 | return strout
566 | end
567 |
568 |
569 |
570 | -- greedy:隨時求值(每次變化都會求值,否則結尾爲特定字符時求值)
571 | local greedy = true
572 |
573 | local function calculator(input, seg)
574 | if string.sub(input, 1, 1) ~= "=" then return end
575 |
576 | local expfin = greedy or string.sub(input, -1, -1) == ";"
577 | local exp = (greedy or not expfin) and string.sub(input, 2, -1) or string.sub(input, 2, -2)
578 |
579 | -- 空格輸入可能
580 | exp = exp:gsub("#", " ")
581 |
582 | -- yield(Candidate("number", seg.start, seg._end, exp, "表達式"))
583 |
584 | if not expfin then return end
585 |
586 | local expe = exp
587 | -- 鏈式調用語法糖
588 | expe = expe:gsub("%$", " chain ")
589 | -- lambda語法糖
590 | do
591 | local count
592 | repeat
593 | expe, count = expe:gsub("\\%s*([%a%d%s,_]-)%s*%.(.-)|", " (function (%1) return %2 end) ")
594 | until count == 0
595 | end
596 | --yield(Candidate("number", seg.start, seg._end, expe, "展開"))
597 |
598 | -- 防止危險操作,禁用os和io命名空間
599 | if expe:find("i?os?%.") then return end
600 | -- return語句保證了只有合法的Lua表達式才可執行
601 | local result = load("return "..expe)()
602 | if result == nil then return end
603 |
604 | result = serialize(result)
605 | yield(Candidate("number", seg.start, seg._end, result, "〈计算结果〉"))
606 | -- yield(Candidate("number", seg.start, seg._end, exp.." = "..result, "等式"))
607 |
608 |
609 | if string.match(result, "^[%+%-]?%d*%.?%d*$") then -- sadly, lua does not support regex like {0,4}
610 | -- comment or reorder following lines to adjust the effects
611 | yield(Candidate("number", seg.start, seg._end, exp.."="..result, "〈计算等式〉","123"))
612 | -- yield(Candidate("number", seg.start, seg._end, result, "〈计算结果〉"))
613 | yield(Candidate("number", seg.start, seg._end, speakMoneyUpper(result), "〈大写金额〉"))
614 | yield(Candidate("number", seg.start, seg._end, speakMoneyLower(result), "〈小写金额〉"))
615 | yield(Candidate("number", seg.start, seg._end, speakOfficiallyUpper(result), "〈大写数字〉"))
616 | yield(Candidate("number", seg.start, seg._end, speakOfficiallyLower(result), "〈小写数字〉"))
617 | end
618 | end
619 |
620 | return calculator
621 |
--------------------------------------------------------------------------------
/lua/helper.lua:
--------------------------------------------------------------------------------
1 | -- helper.lua
2 | -- List features and usage of the schema.
3 |
4 | local function translator(input, seg,env)
5 | local composition = env.engine.context.composition
6 | local segment = composition:back()
7 | if input==rv_var.help then
8 | local table = {
9 | { '时间输出','→ '..rv_var.date_var .. '|' .. rv_var.time_var.. '|' .. rv_var.week_var}
10 | , { '历法节气','→ '..rv_var.nl_var .. '|' .. rv_var.jq_var}
11 | , { '农历反查', '→ 两个等于号+数字日期' }
12 | , { '功能切换','→ '..rv_var.switch_keyword }
13 | , { '方案切换','→ '..rv_var.switch_schema }
14 | , { '注解上屏', '→ Ctrl + Shift + Return' }
15 | , { '折分显隐', '→ Ctrl+Shift+H' }
16 | , { '注解切换', '→ Ctrl+Shift +J' }
17 | , { '单字模式', '→ Ctrl+Shift+D' }
18 | , { '繁简切换', '→ Ctrl+Shift+F' }
19 | , { 'GB2312过滤', '→ Ctrl+Shift+U' }
20 | , { '计算器&金额大写', '→ 一个等于号+数字' }
21 | , { '临时拼音', '→ z键引导临时拼音' }
22 | , { '重复历史', '→ z键兼有重复历史' }
23 | , { '以形查音', '→ ~键引导以形查音' }
24 | , { '自造词', '→ `键引导自造词' }
25 | , { '选单', '→ Ctrl+` 或 F4' }
26 | -- , { 'lua字符串', '→ 以大写字母开头触发' }
27 | , { '帮助', '→ '..rv_var.help }
28 | , { '作者', '空山明月' }
29 | , { '五笔方案地址', 'https://gitee.com/hi-coder/rime-wubi' }
30 | , { '中书君地址', 'https://gitee.com/hi-coder/WubiMaster' }
31 | }
32 | segment.prompt ='简要说明'
33 | for k, v in ipairs(table) do
34 | local cand = Candidate('help', seg.start, seg._end, v[1], ' ' .. v[2])
35 | -- cand.preedit = input .. '\t简要说明'
36 | -- cand.quality=100000000
37 | yield(cand)
38 | end
39 | end
40 | end
41 |
42 | return translator
43 |
--------------------------------------------------------------------------------
/lua/lib/basic.lua:
--------------------------------------------------------------------------------
1 | -- basic.lua
2 |
3 | local basic = {}
4 | package.loaded[...] = basic
5 |
6 | function basic.index(table, item)
7 | for k, v in pairs(table) do
8 | if v == item then return k end
9 | end
10 | end
11 |
12 | function basic.map(table, func)
13 | local t = {}
14 | for k, v in pairs(table) do
15 | t[k] = func(v)
16 | end
17 | return t
18 | end
19 |
20 | function basic.matchstr(str, pat)
21 | local t = {}
22 | for i in str:gmatch(pat) do
23 | t[#t + 1] = i
24 | end
25 | return t
26 | end
27 |
28 | function basic.utf8chars(str, ...)
29 | local chars = {}
30 | for pos, code in utf8.codes(str) do
31 | chars[#chars + 1] = utf8.char(code)
32 | end
33 | return chars
34 | end
35 |
36 | function basic.utf8sub(str, first, ...)
37 | local last = ...
38 | if last == nil or last > utf8.len(str) then
39 | last = utf8.len(str)
40 | elseif last < 0 then
41 | last = utf8.len(str) + 1 + last
42 | end
43 | local fstoff = utf8.offset(str, first)
44 | local lstoff = utf8.offset(str, last + 1)
45 | if fstoff == nil then fstoff = 1 end
46 | if lstoff ~= nil then lstoff = lstoff - 1 end
47 | return string.sub(str, fstoff, lstoff)
48 | end
49 |
50 |
--------------------------------------------------------------------------------
/lua/lunarDate.lua:
--------------------------------------------------------------------------------
1 | ------------------------------------
2 | ----------modify: 空山明月-----------
3 | ------------------------------------
4 |
5 | --十进制转二进制
6 | function Dec2bin(n)
7 | local t,t1,t2
8 | local tables={""}
9 | t=tonumber(n)
10 | while math.floor(t/2)>=1 do
11 | t1= math.fmod(t,2)
12 | if t1>0 then if #tables>0 then table.insert(tables,1,1) else tables[1]=1 end else if #tables>0 then table.insert(tables,1,0) else tables[1]=0 end end
13 | t=math.floor(t/2)
14 | if t==1 then if #tables>0 then table.insert(tables,1,1) else tables[1]=1 end end
15 | end
16 | return string.gsub(table.concat(tables),"^[0]+","")
17 | end
18 |
19 | --2/10/16进制互转
20 | local function system(x,inPuttype,outputtype)
21 | local r
22 | if (tonumber(inPuttype)==2) then
23 | if (tonumber(outputtype) == 10) then --2进制-->10进制
24 | r= tonumber(tostring(x), 2)
25 | elseif (tonumber(outputtype)==16) then --2进制-->16进制
26 | r= bin2hex(tostring(x))
27 | end
28 | elseif (tonumber(inPuttype)==10) then
29 | if (tonumber(outputtype)==2) then --10进制-->2进制
30 | r= Dec2bin(tonumber(x))
31 | elseif (tonumber(outputtype)==16) then --10进制-->16进制
32 | r= string.format("%x",x)
33 | end
34 | elseif (tonumber(inPuttype)==16) then
35 | if (tonumber(outputtype)==2) then --16进制-->2进制
36 | r= Dec2bin(tonumber(tostring(x), 16))
37 | elseif (tonumber(outputtype)==10) then --16进制-->10进制
38 | r= tonumber(tostring(x), 16)
39 | end
40 | end
41 | return r
42 | end
43 |
44 | --农历16进制数据分解
45 | local function Analyze(Data)
46 | local rtn1,rtn2,rtn3,rtn4
47 | rtn1=system(string.sub(Data,1,3),16,2)
48 | if string.len(rtn1)<12 then rtn1="0" .. rtn1 end
49 | rtn2=string.sub(Data,4,4)
50 | rtn3=system(string.sub(Data,5,5),16,10)
51 | rtn4=system(string.sub(Data,-2,-1),16,10)
52 | if string.len(rtn4)==3 then rtn4="0" .. system(string.sub(Data,-2,-1),16,10) end
53 | --string.gsub(rtn1, "^[0]*", "")
54 | return {rtn1,rtn2,rtn3,rtn4}
55 | end
56 |
57 | --年天数判断
58 | local function IsLeap(y)
59 | local year=tonumber(y)
60 | if math.fmod(year,400)~=0 and math.fmod(year,4)==0 or math.fmod(year,400)==0 then return 366
61 | else return 365 end
62 | end
63 |
64 | --计算日期差,两个8位数日期之间相隔的天数,date2>date1
65 | function diffDate(date1,date2)
66 | local t1,t2,n,total
67 | total=0 date1=tostring(date1) date2=tostring(date2)
68 | if tonumber(date2)>tonumber(date1) then
69 | n=tonumber(string.sub(date2,1,4))-tonumber(string.sub(date1,1,4))
70 | if n>1 then
71 | for i=1,n-1 do
72 | total=total+IsLeap(tonumber(string.sub(date1,1,4))+i)
73 | end
74 | total=total+leaveDate(tonumber(string.sub(date2,1,8)))+IsLeap(tonumber(string.sub(date1,1,4)))-leaveDate(tonumber(string.sub(date1,1,8)))
75 | elseif n==1 then
76 | total=IsLeap(tonumber(string.sub(date1,1,4)))-leaveDate(tonumber(string.sub(date1,1,8)))+leaveDate(tonumber(string.sub(date2,1,8)))
77 | else
78 | total=leaveDate(tonumber(string.sub(date2,1,8)))-leaveDate(tonumber(string.sub(date1,1,8)))
79 | --print(date1 .. "-" .. date2)
80 | end
81 | elseif tonumber(date2)==tonumber(date1) then
82 | return 0
83 | else
84 | return -1
85 | end
86 | return total
87 | end
88 |
89 | --返回当年过了多少天
90 | function leaveDate(y)
91 | local day,total
92 | total=0
93 | if IsLeap(tonumber(string.sub(y,1,4)))>365 then day={31,29,31,30,31,30,31,31,30,31,30,31}
94 | else day={31,28,31,30,31,30,31,31,30,31,30,31} end
95 | if tonumber(string.sub(y,5,6))>1 then
96 | for i=1,tonumber(string.sub(y,5,6))-1 do total=total+day[i] end
97 | total=total+tonumber(string.sub(y,7,8))
98 | else
99 | return tonumber(string.sub(y,7,8))
100 | end
101 | return tonumber(total)
102 | end
103 |
104 | --公历转农历,支持转化范围公元1900-2100年
105 | --公历日期 Gregorian:格式 YYYYMMDD
106 | --<返回值>农历日期 中文 天干地支属相
107 | function Date2LunarDate(Gregorian)
108 | --天干名称
109 | local cTianGan = {"甲","乙","丙","丁","戊","己","庚","辛","壬","癸"}
110 | --地支名称
111 | local cDiZhi = {"子","丑","寅","卯","辰","巳","午", "未","申","酉","戌","亥"}
112 | --属相名称
113 | local cShuXiang = {"鼠","牛","虎","兔","龙","蛇", "马","羊","猴","鸡","狗","猪"}
114 | --农历日期名
115 | local cDayName ={"初一","初二","初三","初四","初五","初六","初七","初八","初九","初十",
116 | "十一","十二","十三","十四","十五","十六","十七","十八","十九","二十",
117 | "廿一","廿二","廿三","廿四","廿五","廿六","廿七","廿八","廿九","三十"}
118 | --农历月份名
119 | local cMonName = {"正月","二月","三月","四月","五月","六月", "七月","八月","九月","十月","冬月","腊月"}
120 |
121 | -- 农历数据
122 | local wNongliData = {"AB500D2","4BD0883","4AE00DB","A5700D0","54D0581","D2600D8","D9500CC","655147D","56A00D5","9AD00CA","55D027A","4AE00D2"
123 | ,"A5B0682","A4D00DA","D2500CE","D25157E","B5500D6","56A00CC","ADA027B","95B00D3","49717C9","49B00DC","A4B00D0","B4B0580"
124 | ,"6A500D8","6D400CD","AB5147C","2B600D5","95700CA","52F027B","49700D2","6560682","D4A00D9","EA500CE","6A9157E","5AD00D6"
125 | ,"2B600CC","86E137C","92E00D3","C8D1783","C9500DB","D4A00D0","D8A167F","B5500D7","56A00CD","A5B147D","25D00D5","92D00CA"
126 | ,"D2B027A","A9500D2","B550781","6CA00D9","B5500CE","535157F","4DA00D6","A5B00CB","457037C","52B00D4","A9A0883","E9500DA"
127 | ,"6AA00D0","AEA0680","AB500D7","4B600CD","AAE047D","A5700D5","52600CA","F260379","D9500D1","5B50782","56A00D9","96D00CE"
128 | ,"4DD057F","4AD00D7","A4D00CB","D4D047B","D2500D3","D550883","B5400DA","B6A00CF","95A1680","95B00D8","49B00CD","A97047D"
129 | ,"A4B00D5","B270ACA","6A500DC","6D400D1","AF40681","AB600D9","93700CE","4AF057F","49700D7","64B00CC","74A037B","EA500D2"
130 | ,"6B50883","5AC00DB","AB600CF","96D0580","92E00D8","C9600CD","D95047C","D4A00D4","DA500C9","755027A","56A00D1","ABB0781"
131 | ,"25D00DA","92D00CF","CAB057E","A9500D6","B4A00CB","BAA047B","AD500D2","55D0983","4BA00DB","A5B00D0","5171680","52B00D8"
132 | ,"A9300CD","795047D","6AA00D4","AD500C9","5B5027A","4B600D2","96E0681","A4E00D9","D2600CE","EA6057E","D5300D5","5AA00CB"
133 | ,"76A037B","96D00D3","4AB0B83","4AD00DB","A4D00D0","D0B1680","D2500D7","D5200CC","DD4057C","B5A00D4","56D00C9","55B027A"
134 | ,"49B00D2","A570782","A4B00D9","AA500CE","B25157E","6D200D6","ADA00CA","4B6137B","93700D3","49F08C9","49700DB","64B00D0"
135 | ,"68A1680","EA500D7","6AA00CC","A6C147C","AAE00D4","92E00CA","D2E0379","C9600D1","D550781","D4A00D9","DA400CD","5D5057E"
136 | ,"56A00D6","A6C00CB","55D047B","52D00D3","A9B0883","A9500DB","B4A00CF","B6A067F","AD500D7","55A00CD","ABA047C","A5A00D4"
137 | ,"52B00CA","B27037A","69300D1","7330781","6AA00D9","AD500CE","4B5157E","4B600D6","A5700CB","54E047C","D1600D2","E960882"
138 | ,"D5200DA","DAA00CF","6AA167F","56D00D7","4AE00CD","A9D047D","A2D00D4","D1500C9","F250279","D5200D1"
139 | }
140 | Gregorian=tostring(Gregorian)
141 | local Year,Month,Day,Pos,Data0,Data1,MonthInfo,LeapInfo,Leap,Newyear,Data2,Data3,LYear,thisMonthInfo
142 | Year =tonumber(Gregorian.sub(Gregorian,1,4)) Month =tonumber(Gregorian.sub(Gregorian,5,6))
143 | Day =tonumber(Gregorian.sub(Gregorian,7,8))
144 | if (Year>2100 or Year<1899 or Month>12 or Month<1 or Day<1 or Day>31 or string.len(Gregorian)<8) then
145 | return "无效日期"
146 | end
147 | --print(Year .. "-" .. Month .. "-" .. Day)
148 | --获取两百年内的农历数据
149 | Pos=Year-1900+2 Data0 =wNongliData[Pos-1] Data1 =wNongliData[Pos]
150 | --判断农历年份
151 | local tb1=Analyze(Data1)
152 | MonthInfo=tb1[1] LeapInfo=tb1[2] Leap=tb1[3] Newyear=tb1[4]
153 | Date1 =Year .. Newyear Date2 =Gregorian
154 | Date3 =diffDate(Date1,Date2) --和当年农历新年相差的天数
155 | --print(Date3 .. "-11")
156 | if (Date3<0) then
157 | --print(Data0 .. "-2")
158 | tb1=Analyze(Data0) Year=Year-1
159 | MonthInfo=tb1[1] LeapInfo=tb1[2] Leap=tb1[3] Newyear=tb1[4]
160 | Date1 =Year .. Newyear Date2=Gregorian
161 | Date3=diffDate(Date1,Date2)
162 | --print(Date2 .. "--" .. Date1 .. "--" .. Date3)
163 | end
164 | --print(MonthInfo .. "-" .. LeapInfo .. "-" .. Leap .. "-" .. Newyear .. "-" .. Year)
165 | Date3=Date3+1
166 | LYear=Year --农历年份,就是上面计算后的值
167 | if Leap>0 then --有闰月
168 | thisMonthInfo=string.sub(MonthInfo,1,Leap) .. LeapInfo .. string.sub(MonthInfo,Leap+1)
169 | else
170 | thisMonthInfo=MonthInfo
171 | end
172 | local thisMonth,thisDays,LDay,Isleap,LunarYear,LunarMonth
173 | for i=1,13 do
174 | thisMonth=string.sub(thisMonthInfo,i,i) thisDays=29+thisMonth
175 | if (Date3>thisDays) then
176 | Date3=Date3-thisDays
177 | else
178 | if (Leap>0) then
179 | if (Leap>=i) then
180 | LMonth=i Isleap=0
181 | else
182 | LMonth=i-1
183 | if i-Leap==1 then Isleap=1 else Isleap=0 end
184 | end
185 | else
186 | LMonth=i Isleap=0
187 | end
188 | LDay=math.floor(Date3)
189 | break
190 | end
191 | end
192 | --print(LYear .. "-" .. LMonth .. "-" .. LDay)
193 | if Isleap>0 then LunarMonth="闰" .. cMonName[LMonth] else LunarMonth=cMonName[LMonth] end
194 | --print(LDay)
195 | LunarYear=cTianGan[math.fmod(LYear-4,10)+1] .. cDiZhi[math.fmod(LYear-4,12)+1] .. "年(" .. cShuXiang[math.fmod(LYear-4,12)+1] .. ")" .. LunarMonth .. cDayName[LDay]
196 | --print(LunarYear)
197 | return LunarYear
198 | end
199 |
200 | --Date日期参数格式YYMMDD,dayCount累加的天数
201 | --返回值:公历日期
202 | local function GettotalDay(Date,dayCount)
203 | local Year,Month,Day,days,total,t
204 | Date=tostring(Date)
205 | Year=tonumber(Date.sub(Date,1,4))
206 | Month=tonumber(Date.sub(Date,5,6))
207 | Day=tonumber(Date.sub(Date,7,8))
208 | if IsLeap(Year)>365 then days={31,29,31,30,31,30,31,31,30,31,30,31}
209 | else days={31,28,31,30,31,30,31,31,30,31,30,31} end
210 | if dayCount>days[Month]-Day then
211 | total=dayCount-days[Month]+Day Month=Month+1
212 | if Month>12 then Month=Month-12 Year=Year+1 end
213 | for i=Month,12+Month do
214 | if IsLeap(Year)>365 then days={31,29,31,30,31,30,31,31,30,31,30,31}
215 | else days={31,28,31,30,31,30,31,31,30,31,30,31} end
216 | if i>11 then t=i-12 else t=i end
217 | --print("<" ..i ..">" ..days[t+1] .. "-".. t+1)
218 | if (total>days[t+1]) then
219 | total=total-days[Month]
220 | Month=Month+1
221 | if Month>12 then Month=Month-12 Year=Year+1 end
222 | --print(Month .. "-" ..days[Month])
223 | --print(Year .. Month .. total)
224 | else
225 | break
226 | end
227 | end
228 | else
229 | total=Day+dayCount
230 | end
231 | --if string.len(Month)==1 then Month="0"..Month end
232 | --if string.len(total)==1 then total="0"..total end
233 | return Year .. "年" .. Month .. "月" .. total .. "日"
234 | end
235 |
236 | --农历转公历
237 | --农历 Gregorian:数字格式 YYYYMMDD
238 | --<返回值>公历日期 格式YYYY年MM月DD日
239 | --农历日期月份为闰月需指定参数IsLeap为1,非闰月需指定参数IsLeap为0
240 | function LunarDate2Date(Gregorian,IsLeap)
241 | LunarData={"AB500D2","4BD0883",
242 | "4AE00DB","A5700D0","54D0581","D2600D8","D9500CC","655147D","56A00D5","9AD00CA","55D027A","4AE00D2",
243 | "A5B0682","A4D00DA","D2500CE","D25157E","B5500D6","56A00CC","ADA027B","95B00D3","49717C9","49B00DC",
244 | "A4B00D0","B4B0580","6A500D8","6D400CD","AB5147C","2B600D5","95700CA","52F027B","49700D2","6560682",
245 | "D4A00D9","EA500CE","6A9157E","5AD00D6","2B600CC","86E137C","92E00D3","C8D1783","C9500DB","D4A00D0",
246 | "D8A167F","B5500D7","56A00CD","A5B147D","25D00D5","92D00CA","D2B027A","A9500D2","B550781","6CA00D9",
247 | "B5500CE","535157F","4DA00D6","A5B00CB","457037C","52B00D4","A9A0883","E9500DA","6AA00D0","AEA0680",
248 | "AB500D7","4B600CD","AAE047D","A5700D5","52600CA","F260379","D9500D1","5B50782","56A00D9","96D00CE",
249 | "4DD057F","4AD00D7","A4D00CB","D4D047B","D2500D3","D550883","B5400DA","B6A00CF","95A1680","95B00D8",
250 | "49B00CD","A97047D","A4B00D5","B270ACA","6A500DC","6D400D1","AF40681","AB600D9","93700CE","4AF057F",
251 | "49700D7","64B00CC","74A037B","EA500D2","6B50883","5AC00DB","AB600CF","96D0580","92E00D8","C9600CD",
252 | "D95047C","D4A00D4","DA500C9","755027A","56A00D1","ABB0781","25D00DA","92D00CF","CAB057E","A9500D6",
253 | "B4A00CB","BAA047B","AD500D2","55D0983","4BA00DB","A5B00D0","5171680","52B00D8","A9300CD","795047D",
254 | "6AA00D4","AD500C9","5B5027A","4B600D2","96E0681","A4E00D9","D2600CE","EA6057E","D5300D5","5AA00CB",
255 | "76A037B","96D00D3","4AB0B83","4AD00DB","A4D00D0","D0B1680","D2500D7","D5200CC","DD4057C","B5A00D4",
256 | "56D00C9","55B027A","49B00D2","A570782","A4B00D9","AA500CE","B25157E","6D200D6","ADA00CA","4B6137B",
257 | "93700D3","49F08C9","49700DB","64B00D0","68A1680","EA500D7","6AA00CC","A6C147C","AAE00D4","92E00CA",
258 | "D2E0379","C9600D1","D550781","D4A00D9","DA400CD","5D5057E","56A00D6","A6C00CB","55D047B","52D00D3",
259 | "A9B0883","A9500DB","B4A00CF","B6A067F","AD500D7","55A00CD","ABA047C","A5A00D4","52B00CA","B27037A",
260 | "69300D1","7330781","6AA00D9","AD500CE","4B5157E","4B600D6","A5700CB","54E047C","D1600D2","E960882",
261 | "D5200DA","DAA00CF","6AA167F","56D00D7","4AE00CD","A9D047D","A2D00D4","D1500C9","F250279","D5200D1"
262 | }
263 | Gregorian=tostring(Gregorian)
264 | local Year,Month,Day,Pos,Data,MonthInfo,LeapInfo,Leap,Newyear,Sum,thisMonthInfo,GDate
265 | Year=tonumber(Gregorian.sub(Gregorian,1,4)) Month=tonumber(Gregorian.sub(Gregorian,5,6))
266 | Day=tonumber(Gregorian.sub(Gregorian,7,8))
267 | if (Year>2100 or Year<1900 or Month>12 or Month<1 or Day>30 or Day<1 or string.len(Gregorian)<8) then
268 | return "无效日期"
269 | end
270 |
271 | --获取当年农历数据
272 | Pos=(Year-1899)+1 Data=LunarData[Pos]
273 | --print(Data)
274 | --判断公历日期
275 | local tb1=Analyze(Data)
276 | MonthInfo=tb1[1] LeapInfo=tb1[2] Leap=tb1[3] Newyear=tb1[4]
277 | --计算到当天到当年农历新年的天数
278 | Sum=0
279 |
280 | if Leap>0 then --有闰月
281 | thisMonthInfo=string.sub(MonthInfo,1,Leap) .. LeapInfo .. string.sub(MonthInfo,Leap+1)
282 | if (Leap~=Month and tonumber(IsLeap)==1) then
283 | return "该月不是闰月!"
284 | end
285 | if (Month<=Leap and tonumber(IsLeap)==0) then
286 | for i=1,Month-1 do Sum=Sum+29+string.sub(thisMonthInfo,i,i) end
287 | else
288 | for i=1,Month do Sum=Sum+29+string.sub(thisMonthInfo,i,i) end
289 | end
290 | else
291 | if (tonumber(IsLeap)==1) then
292 | return "该年没有闰月!"
293 | end
294 | for i=1,Month-1 do
295 | thisMonthInfo=MonthInfo
296 | Sum=Sum+29+string.sub(thisMonthInfo,i,i)
297 | end
298 | end
299 | Sum=math.floor(Sum+Day-1)
300 | GDate=Year .. Newyear
301 | GDate=GettotalDay(GDate,Sum)
302 |
303 | return GDate
304 | end
305 |
306 | local function main()
307 | print(LunarDate2Date(20210101,0))
308 | --print(19660808 .. "-" ..Date2LunarDate(19660808))
309 | --print(20001218 .. "-" ..Date2LunarDate(20001218))
310 | print(os.date("%Y%m%d") .. "-" ..Date2LunarDate(os.date("%Y%m%d")))
311 | --print(20200525 .. "-" ..Date2LunarDate(20200525))
312 | --print(20220105 .. "-" ..Date2LunarDate(20220105))
313 | --print(20350129 .. "-" ..Date2LunarDate(20350129))
314 | end
315 |
316 | --main()
--------------------------------------------------------------------------------
/lua/lunarGz.lua:
--------------------------------------------------------------------------------
1 | ------------------------------------
2 | ----------modify: 空山明月-----------
3 | ------------------------------------
4 |
5 | --公历转干支历实现
6 | --[[干支历的年以立春发生时刻(注意,不是立春日的0时)为年干支的起点;各月干支以十二节时刻(注意,不一定是各节气日的0时)
7 | --]]
8 | -- require('common')
9 | require("lunarJq")
10 |
11 | GanZhiLi = {
12 | }
13 |
14 | --创建干支历对象
15 | function GanZhiLi:new()
16 | local o = {}
17 | setmetatable(o, self)
18 | self.__index = self
19 | o:setTime(os.time())
20 | return o
21 | end
22 |
23 | --将offset的数值转化为特定偏移下的周期数,起始数,偏移量,周期
24 | function GanZhiLi:calRound(start, offset, round)
25 | if start > round or start <=0 then return nil end --参数不对
26 | offset = math.floor(math.fmod(start+offset, round))
27 | if offset >=0 then
28 | if offset==0 then offset=round end
29 | return offset
30 | else
31 | return round + offset
32 | end
33 | end
34 |
35 | --周期循环数
36 | function calR2(n, round)
37 | local x = math.floor(math.fmod(n,round))
38 | if x==0 then x=round end
39 | return x
40 | end
41 |
42 | --设置用于转换干支历的公历时间
43 | function GanZhiLi:setTime(t)
44 | self.ttime = t
45 | self.tday = os.date('*t', t)
46 | --for k,v in pairs(self.tday) do
47 | -- print(k,v)
48 | --end
49 | --先取公历今年的干支
50 | self.jqs = getYearJQ(self.tday.year)
51 | self.ganZhiYearNum = self:calGanZhiYearNum()
52 | if self.ganZhiYearNum ~= self.tday.year then
53 | --如果在节气上还没到今年的立春,则还没到干支历的今年,需要取干支历的年份的24节气
54 | self.jqs = getYearJQ(self.ganZhiYearNum)
55 | end
56 | self.ganZhiMonNum = self:calGanZhiMonthNum()
57 | self.curJq = self:getCurJQ()
58 |
59 | end
60 |
61 | function GanZhiLi:getCurJQ()
62 | --for i=1,24 do
63 | -- local x = os.date('*t', self.jqs[i])
64 | -- print(x.year, x.month, x.day, x.hour, x.min, x.sec)
65 | --end
66 | local x = 0
67 | if self.ttime < self.jqs[1] then return nil end --出错,计算错年了?
68 | for i=1,23 do
69 | if self.jqs[i] <= self.ttime and self.jqs[i+1] > self.ttime then x=i break end
70 | end
71 | if x==0 then x=24 end
72 | return x --返回以立春为起始序号1的节气
73 | end
74 |
75 |
76 | --根据公历年份和节气计算干支历的年份
77 | function GanZhiLi:calGanZhiYearNum()
78 | if (self.ttime < self.jqs[1]) then return self.tday.year -1
79 | else return self.tday.year end
80 | end
81 |
82 | --获取干支月份
83 | function GanZhiLi:calGanZhiMonthNum()
84 | if self.ttime < self.jqs[1] then return nil end
85 | local x = 0
86 | if self.ttime < self.jqs[1] then return nil end --出错,计算错年了?
87 | for i=1,23 do
88 | if self.jqs[i] <= self.ttime and self.jqs[i+1] > self.ttime then x=i end
89 | end
90 | if x==0 then x=24 end
91 | return math.floor((x+1)/2)
92 | end
93 |
94 |
95 | --返回年的干支序号,1为甲子。。。
96 | function GanZhiLi:getYearGanZhi()
97 | local jiaziYear = 1984 --甲子年
98 | --print(self.ganZhiYearNum)
99 | local yeardiff = self.ganZhiYearNum - jiaziYear
100 | return self:calRound(1,yeardiff,60)
101 | end
102 |
103 | --返回年的天干号,1为甲
104 | function GanZhiLi:getYearGan()
105 | local idx = self:getYearGanZhi()
106 | return self:calR2(idx,10)
107 | end
108 |
109 | --返回年的地支号,1为子
110 | function GanZhiLi:getYearZhi()
111 | local idx = self:getYearGanZhi()
112 | return self:calR2(idx,12)
113 | end
114 |
115 | --返回月的干支号
116 | function GanZhiLi:getMonGanZhi()
117 | local ck ={year=2010,month=2,day=4,hour=6,min=42,sec=0}
118 | local x = os.time(ck) --参考月,立春时间2010-2-4 6:42:00对应的干支序号为15
119 | local ydiff = self.ganZhiYearNum - ck.year
120 | local mdiff = self.ganZhiMonNum-1
121 | if ydiff >=0 then
122 | mdiff = ydiff*12 + mdiff
123 | else
124 | mdiff = (ydiff+1)*12 + mdiff -12
125 | end
126 | return self:calRound(15,mdiff, 60)
127 | end
128 |
129 |
130 | function GanZhiLi:getMonGan()
131 | local idx = self:getMonGanZhi()
132 | return self:calR2(idx,10)
133 | end
134 |
135 | function GanZhiLi:getMonZhi()
136 | local idx = self:getMonGanZhi()
137 | return self:calR2(idx,12)
138 | end
139 |
140 | --返回日的干支号,甲子从1开始
141 | function GanZhiLi:getDayGanZhi()
142 | local DAYSEC = 24*3600
143 | local jiaziDayTime = os.time({year=2012, month=8, day=30, hour=23, min=0,sec=0})
144 | local daydiff = math.floor((self.ttime - jiaziDayTime)/DAYSEC)
145 | return self:calRound(1,daydiff,60)
146 | end
147 |
148 | --返回日的天干号
149 | function GanZhiLi:getDayGan()
150 | local idx = self:getDayGanZhi()
151 | return self:calR2(idx,10)
152 | end
153 |
154 | --返回日的地支号
155 | function GanZhiLi:getDayZhi()
156 | local idx = self:getDayGanZhi()
157 | return self:calR2(idx,12)
158 | end
159 |
160 | --返回时辰的干支号
161 | function GanZhiLi:getHourGanZhi()
162 | local SHICHENSEC=3600*2
163 | local jiaziShiTime = os.time({year=2012, month=8, day=30, hour=23, min=0, sec=0})
164 | local shiDiff = math.floor((self.ttime - jiaziShiTime)/SHICHENSEC)
165 | return self:calRound(1,shiDiff,60)
166 | end
167 |
168 | --返回时干号
169 | function GanZhiLi:getShiGan()
170 | local idx = self:getHourGanZhi()
171 | return self:calR2(idx,10)
172 | end
173 |
174 | --返回时支号
175 | function GanZhiLi:getShiZhi()
176 | local idx = self:getHourGanZhi()
177 | return self:calR2(idx,12)
178 | end
179 |
180 |
181 |
182 |
183 |
184 | --====================以下是测试代码=============
185 |
186 | local jqB={ --节气表
187 | "立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露",
188 | "秋分","寒露","霜降","立冬","小雪","大雪","冬至","小寒","大寒",}
189 | --天干
190 | local tiangan = {'甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸'}
191 |
192 | --地支
193 | local dizhi = {'子', '丑', '寅', '卯', '辰', '巳', '午', '未', '申', '酉', '戌', '亥'}
194 |
195 |
196 | --根据六十甲子序号,返回六十甲子字符串,甲子从1开始
197 | local function get60JiaZiStr(i)
198 | local gan = i % 10
199 | if gan == 0 then gan = 10 end
200 | local zhi = i % 12
201 | if zhi == 0 then zhi = 12 end
202 | return tiangan[gan]..dizhi[zhi]
203 | end
204 |
205 | function lunarJzl(y)
206 | local x,yidx,midx,didx,hidx
207 | y=tostring(y)
208 | x = GanZhiLi:new()
209 | if tonumber(y.sub(y,1,4))>1970 then
210 | x:setTime(os.time({year=tonumber(y.sub(y,1,4)),month=tonumber(y.sub(y,5,6)), day=tonumber(y.sub(y,7,8)),hour=tonumber(y.sub(y,9,10)),min=4,sec=5}))
211 | yidx = x:getYearGanZhi()
212 | midx = x:getMonGanZhi()
213 | didx = x:getDayGanZhi()
214 | hidx = x:getHourGanZhi()
215 | GzData= get60JiaZiStr(yidx) .. '年' .. get60JiaZiStr(midx) .. '月' .. get60JiaZiStr(didx) .. '日' .. get60JiaZiStr(hidx) .. '时'
216 | --print('干支:' .. GzData)
217 | return GzData
218 | else
219 | return "不支持1971年前的日期"
220 | end
221 | end
222 |
223 | --测试
224 | --print(lunarJzl(os.date("%Y%m%d%H")))
--------------------------------------------------------------------------------
/lua/new_spelling.lua:
--------------------------------------------------------------------------------
1 | local basic = require('lib/basic')
2 | local map = basic.map
3 | local index = basic.index
4 | local utf8chars = basic.utf8chars
5 | local matchstr = basic.matchstr
6 |
7 | local function SubStringGetByteCount(str, index)
8 | local curByte = string.byte(str, index)
9 | local byteCount = 1;
10 | if curByte == nil then
11 | byteCount = 0
12 | elseif curByte > 0 and curByte <= 127 then
13 | byteCount = 1
14 | elseif curByte>=192 and curByte<=223 then
15 | byteCount = 2
16 | elseif curByte>=224 and curByte<=239 then
17 | byteCount = 3
18 | elseif curByte>=240 and curByte<=247 then
19 | byteCount = 4
20 | end
21 | return byteCount;
22 | end
23 |
24 | -- 获取中英混合UTF8字符串的真实字符数量
25 | local function SubStringGetTotalIndex(str)
26 | local curIndex = 0;
27 | local i = 1;
28 | local lastCount = 1;
29 | repeat
30 | lastCount = SubStringGetByteCount(str, i)
31 | i = i + lastCount;
32 | curIndex = curIndex + 1;
33 | until(lastCount == 0);
34 | return curIndex - 1;
35 | end
36 |
37 | local function xform(input)
38 | if input == "" then return "" end
39 | input = input:gsub('%[', '〈')
40 | input = input:gsub('%]', '〉')
41 | input = input:gsub('※', ' ')
42 | input = input:gsub('_', ' ')
43 | input = input:gsub(',', '·')
44 | return input
45 | end
46 |
47 | local function subspelling(str, ...)
48 | local first, last = ...
49 | if not first then return str end
50 | local radicals = {}
51 | local s = str
52 | s = s:gsub('{', ' {')
53 | s = s:gsub('}', '} ')
54 | for seg in s:gmatch('%S+') do
55 | if seg:find('^{.+}$') then
56 | table.insert(radicals, seg)
57 | else
58 | for pos, code in utf8.codes(seg) do
59 | table.insert(radicals, utf8.char(code))
60 | end
61 | end
62 | end
63 | return table.concat{ table.unpack(radicals, first, last) }
64 | end
65 |
66 | local function lookup(db)
67 | return function (str)
68 | return db:lookup(str)
69 | end
70 | end
71 |
72 | local function parse_spll(str)
73 | local s = string.gsub(str, ',.*', '')
74 | return string.gsub(s, '^%[', '')
75 | end
76 |
77 | local function parse_encode(str)
78 | local s = string.gsub(str, '%[(.-),(.-),(.-),(.-)%]', '[%2]')
79 | return string.gsub(s, '^%[', '')
80 | end
81 |
82 | local function spell_phrase(s, spll_rvdb)
83 | local chars = utf8chars(s)
84 | local rvlk_results
85 | if #chars == 2 or #chars == 3 then
86 | rvlk_results = map(chars, lookup(spll_rvdb))
87 | else
88 | rvlk_results = map({chars[1], chars[2], chars[3], chars[#chars]},
89 | lookup(spll_rvdb))
90 | end
91 | if index(rvlk_results, '') then return '' end
92 | local spellings = map(rvlk_results, parse_spll)
93 | local sup = '◇'
94 | if #chars == 2 then
95 | return subspelling(spellings[1] .. sup, 2, 2) ..
96 | subspelling(spellings[1] .. sup, 4, 4) ..
97 | subspelling(spellings[2] .. sup, 2, 2) ..
98 | subspelling(spellings[2] .. sup, 4, 4)
99 | elseif #chars == 3 then
100 | return subspelling(spellings[1], 2, 2) ..
101 | subspelling(spellings[2], 2, 2) ..
102 | subspelling(spellings[3] .. sup, 2, 2) ..
103 | subspelling(spellings[3] .. sup, 4, 4)
104 | else
105 | return subspelling(spellings[1], 2, 2) ..
106 | subspelling(spellings[2], 2, 2) ..
107 | subspelling(spellings[3], 2, 2) ..
108 | subspelling(spellings[4], 2, 2)
109 | end
110 | end
111 |
112 | local function isgb2312(cand, env)
113 | local ctext = cand.text
114 | if utf8.len(ctext) == 1 then
115 | local spll_raw = env.spll_rvdb:lookup(ctext)
116 | if spll_raw ~= '' then
117 | local chars =xform(spll_raw:gsub('%[(.-),(.-),(.-),(.-)%]', '[%4]'))
118 | if chars:find("GB2312") then return 1 else return 0 end
119 | else
120 | return 1
121 | end
122 | elseif utf8.len(ctext)>1 then
123 | local arr = utf8chars(ctext)
124 | local flag=1
125 | for i =1,#arr do
126 | local spll_raw = env.spll_rvdb:lookup(arr[i])
127 | if spll_raw ~= '' then
128 | local chars =xform(spll_raw:gsub('%[(.-),(.-),(.-),(.-)%]', '[%4]'))
129 | if chars:find("GBK") then return 0 else flag=1 end
130 | end
131 | end
132 |
133 | return flag
134 | end
135 | end
136 |
137 | local function get_en_code(s, spll_rvdb)
138 | local chars = utf8chars(s)
139 | local rvlk_results
140 | if #chars == 2 or #chars == 3 or #chars == 1 then
141 | rvlk_results = map(chars, lookup(spll_rvdb))
142 | else
143 | rvlk_results = map({chars[1], chars[2], chars[3], chars[#chars]},
144 | lookup(spll_rvdb))
145 | end
146 | if index(rvlk_results, '') then return '' end
147 | local spellings = map(rvlk_results, parse_encode)
148 | local sup = '◇'
149 | if #chars == 1 then
150 | return spellings[1]:gsub('[^%a]+','')
151 | elseif #chars == 2 then
152 | return spellings[1]:gsub('[^%a]+',''):sub(1,2) ..
153 | spellings[2]:gsub('[^%a]+',''):sub(1,2)
154 | elseif #chars == 3 then
155 | return spellings[1]:gsub('[^%a]+',''):sub(1,1) ..
156 | spellings[2]:gsub('[^%a]+',''):sub(1,1) ..
157 | spellings[3]:gsub('[^%a]+',''):sub(1,2)
158 | else
159 | return spellings[1]:gsub('[^%a]+',''):sub(1,1) ..
160 | spellings[2]:gsub('[^%a]+',''):sub(1,1) ..
161 | spellings[3]:gsub('[^%a]+',''):sub(1,1) ..
162 | spellings[4]:gsub('[^%a]+',''):sub(1,1)
163 | end
164 | end
165 |
166 | local function get_tricomment(cand, env)
167 | local ctext = cand.text
168 | if utf8.len(ctext) == 1 then
169 | local spll_raw = env.spll_rvdb:lookup(ctext)
170 | if spll_raw ~= '' then
171 | if env.engine.context:get_option("new_hide_pinyin") then
172 | -- return xform(spll_raw:gsub('%[(.-,.-),.+%]', '[%1]'))
173 | return xform(spll_raw:gsub('%[(.-),.+%]', '[%1]'))
174 | else
175 | return xform(spll_raw:gsub('%[(.-),(.-),(.-),(.-)%]', '[%1'..' · '..'%2'..' · '..'%3]'))
176 | end
177 | end
178 | else
179 | local spelling = spell_phrase(ctext, env.spll_rvdb)
180 | if spelling ~= '' then
181 | spelling = spelling:gsub('{(.-)}', '<%1>')
182 | local code = env.code_rvdb:lookup(ctext)
183 | if code ~= '' then
184 | code = matchstr(code, '%S+')
185 | table.sort(code, function(i, j) return i:len() < j:len() end)
186 | code = table.concat(code, ' ')
187 | return '〈 ' .. spelling .. ' · ' .. code .. ' 〉'
188 | else
189 | return '〈 ' .. spelling .. ' 〉'
190 | end
191 | end
192 | end
193 | return ''
194 | end
195 |
196 | local function file_exists(path)
197 | local file = io.open(path, "rb")
198 | if file then file:close() end
199 | return file ~= nil
200 | end
201 |
202 | local function formatDir(path,filename)
203 | if path:find("\\") then
204 | return path .. "\\" .. filename
205 | elseif path:find("/") then
206 | return path .. "/" .. filename
207 | else
208 | return path .. "\\" .. filename
209 | end
210 | end
211 |
212 | local function get_item(filepath,item)
213 | local file = io.open(filepath, "rb")
214 | if file then
215 | local isexist=nil
216 | for line in file:lines() do
217 | if line:find(item) and not line:find("(%#)") then
218 | isexist=line:gsub('(.-):%s*(.-)', '%2')
219 | end
220 | end
221 | file:close()
222 | return isexist
223 | end
224 | end
225 |
226 | local function get_horizontal_style(filename,item)
227 | local shared_data_dir=rime_api.get_shared_data_dir() -- 获取程序目录data路径
228 | local user_data_dir=rime_api.get_user_data_dir() -- 获取用户目录路径
229 | local flag=get_item(formatDir(user_data_dir,filename),item)
230 | if flag~=nil then
231 | return flag
232 | else
233 | flag=get_item(formatDir(user_data_dir,"weasel.custom.yaml"),item)
234 | if flag~=nil then return flag else return get_item(formatDir(shared_data_dir,filename),item) end
235 | end
236 | end
237 |
238 | local function filter(input, env)
239 | local codetext=env.engine.context.input -- 获取编码
240 | local script_text=env.engine.context:get_script_text()
241 | local hide_pinyin=env.engine.context:get_option("new_hide_pinyin")
242 | local schema_name=env.engine.schema.schema_name or ""
243 | local schema_id=env.engine.schema.schema_id or ""
244 | local spelling_states=env.engine.context:get_option(spelling_keyword)
245 | local composition = env.engine.context.composition
246 | local segment = composition:back()
247 | -- if codetext==rv_var.switch_keyword and schema_name then segment.prompt =" 〈 当前方案:"..schema_name.." 〉" end
248 | -- 获取输入法常用参数
249 | -- env.engine.context:get_commit_text() -- filter中为获取提交词
250 | -- env.engine.context:get_script_text()-- 获取编码带引导符
251 | -- local caret_pos = env.engine.context.caret_pos - 光标的位置通常可以理解为单字节编码长度
252 | -- local schema = env.engine.schema.config:get_int('menu/page_size') -- 获取方案候选项数目参数
253 | -- local ascii_mode=env.engine.context:get_option("ascii_mode") -- env.engine.context:set_option("ascii_mode", not ascii_mode)
254 | -- local schema_id=env.engine.schema.schema_id -- 获取方案id
255 | -- local schema_name=env.engine.schema.schema_name -- 获取方案名称
256 | -- local sync_dir=rime_api.get_sync_dir() -- 获取同步资料目录
257 | -- local rime_version=rime_api.get_rime_version() -- 获取rime版本号--macos无效
258 | -- local shared_data_dir=rime_api.get_shared_data_dir() -- 获取程序目录data路径
259 | -- local user_data_dir=rime_api.get_user_data_dir() -- 获取用户目录路径
260 | local horizontal=get_horizontal_style(schema_id..".custom.yaml","style/horizontal") or ""
261 | CandidateText={}
262 | if spelling_states then
263 | for cand in input:iter() do
264 | if isgb2312(cand,env)==1 and env.engine.context:get_option("GB2312") or not env.engine.context:get_option("GB2312") then
265 | table.insert(CandidateText,cand.text)
266 | if cand.type == 'simplifier' and env.name_space == 'new_for_rvlk' then
267 | if cand.comment=="" then
268 | local comment = get_tricomment(cand, env)
269 | -- local rvlk_comment=
270 | yield(Candidate(spelling_keyword, cand.start, cand._end, cand.text, comment))
271 | end
272 | else
273 | if script_text:find("^z[a-z]*") and not script_text:find("%p$") or script_text:find("^([%/])[a-z]*") and not script_text:find("%p$") then
274 | -- cand.quality=10 -- 调整权值 "💡" cand.type:'reverse_lookup'
275 | local add_comment=get_tricomment(cand, env)
276 | local code_comment=env.code_rvdb:lookup(cand.text)
277 | if add_comment~=nil or add_comment~="" then
278 | if cand.comment == "" then
279 | yield(Candidate(spelling_keyword, cand.start, cand._end, cand.text,add_comment))
280 | else
281 | if cand.comment:find("(☯)") then
282 | segment.prompt="〈编码:"..get_en_code(cand.text, env.spll_rvdb).. "〉"
283 | yield(cand)
284 | else
285 | if utf8.len(cand.text) == 1 and code_comment and not hide_pinyin then
286 | yield(Candidate(spelling_keyword, cand.start, cand._end, cand.text,xform(code_comment:gsub('%[(.-),(.-),(.-),(.-)%]', '[%1'..' · '..'%2'..' · '..'%3]'))))
287 | else
288 | yield(Candidate(spelling_keyword, cand.start, cand._end, cand.text,add_comment:gsub("〉"," · ") .. cand.comment .. " 〉"))
289 | end
290 | end
291 | end
292 | end
293 | elseif script_text:find("^([%~])[a-z]*") and not script_text:find("%p$") and env.engine.context:get_option("rvl_zhuyin") then
294 | local code_comment=env.code_rvdb:lookup(cand.text)
295 | if code_comment~="" then
296 | code_comment=xform(code_comment:gsub('%[(.-),(.-),(.-),(.-)%]', '[%3'..' · '..'%1]'))
297 | yield(Candidate("rvl_zhuyin", cand.start, cand._end, cand.text,code_comment))
298 | else
299 | yield(cand)
300 | end
301 | -- elseif script_text==rv_var.switch_keyword then
302 | -- if cand.text:find("方案") then cand.comment="〈 "..schema_name.." 〉" end
303 | -- yield(cand)
304 | else
305 | local add_comment = ''
306 | local code_comment=env.code_rvdb:lookup(cand.text)
307 | if cand.comment:find("(☯)") and script_text:find("^%`*(%l+%`%l+)") then
308 | segment.prompt="〈编码:"..get_en_code(cand.text, env.spll_rvdb).. "〉"
309 | end
310 | if cand.type == 'punct' then
311 | add_comment = xform(code_comment:gsub('%[(.-),(.-),(.-),(.-)%]', '[%1'..' · '..'%2'..' · '..'%3]'))
312 | elseif cand.type ~= 'sentence' then
313 | add_comment = get_tricomment(cand, env)
314 | end
315 | if add_comment ~= '' then
316 | if cand.comment=="" then cand.comment = add_comment .. cand.comment end
317 | end
318 | yield(cand)
319 | end
320 | end
321 | end
322 | end
323 | else
324 | if script_text:find("^z") then
325 | for cand in input:iter() do
326 | if isgb2312(cand,env)==1 and env.engine.context:get_option("GB2312") or not env.engine.context:get_option("GB2312") then
327 | table.insert(CandidateText,cand.text)
328 | local add_comment=get_tricomment(cand, env)
329 | local code_comment=env.code_rvdb:lookup(cand.text)
330 | if cand.comment=="" then
331 | if add_comment~=nil or add_comment~="" then
332 | cand.comment = add_comment
333 | end
334 | elseif not horizontal:find("true") then
335 | if add_comment~=nil or add_comment~="" then
336 | if utf8.len(cand.text) == 1 and code_comment and not hide_pinyin then
337 | cand.comment = xform(code_comment:gsub('%[(.-),(.-),(.-),(.-)%]', '[%1'..' · '..'%2'..' · '..'%3]'))
338 | elseif utf8.len(cand.text) == 1 and code_comment and hide_pinyin then
339 | cand.comment = xform(code_comment:gsub('%[(.-),(.-),(.-),(.-)%]', '[%1'..' · '..'%2]'))
340 | else
341 | cand.comment = add_comment:gsub("〉"," · ") .. cand.comment .. " 〉"
342 | end
343 | end
344 | else
345 | if cand.comment:find("%s") then cand.comment=" "..cand.comment:gsub("%s+"," · ") else cand.comment=" "..cand.comment end
346 | end
347 | yield(cand)
348 | end
349 | end
350 | elseif script_text:find("^([%~])[a-z]*") and not script_text:find("%p$") and env.engine.context:get_option("rvl_zhuyin") then
351 | for cand in input:iter() do
352 | if isgb2312(cand,env)==1 and env.engine.context:get_option("GB2312") or not env.engine.context:get_option("GB2312") then
353 | table.insert(CandidateText,cand.text)
354 | local code_comment=env.code_rvdb:lookup(cand.text)
355 | if code_comment~="" then
356 | code_comment=xform(code_comment:gsub('%[(.-),(.-),(.-),(.-)%]', '%3')):gsub("^%s+",""):gsub("%s+$","")
357 | if code_comment:find("%s") then code_comment=code_comment:gsub("%s+"," · ") end
358 | yield(Candidate("zhuyin_rvlk", cand.start, cand._end, cand.text," "..code_comment))
359 | end
360 | end
361 | end
362 | else
363 | for cand in input:iter() do
364 | if isgb2312(cand,env)==1 and env.engine.context:get_option("GB2312") or not env.engine.context:get_option("GB2312") then
365 | table.insert(CandidateText,cand.text)
366 | -- if script_text==rv_var.switch_keyword then
367 | -- if cand.text:find("方案") then cand.comment="〈 "..schema_name.." 〉" end
368 | -- end
369 | if cand.comment:find("(☯)") and script_text:find("^%`*(%l+%`%l+)") then
370 | segment.prompt ="〈编码:"..get_en_code(cand.text, env.spll_rvdb).. "〉"
371 | end
372 | yield(cand)
373 | end
374 | end
375 | end
376 | end
377 | end
378 |
379 | local function init(env)
380 | local config = env.engine.schema.config
381 | page_size = env.engine.schema.page_size
382 | local spll_rvdb = config:get_string('lua_reverse_db/spelling')
383 | local code_rvdb = config:get_string('lua_reverse_db/code')
384 | local abc_extags_size = config:get_list_size('abc_segmentor/extra_tags')
385 | env.spll_rvdb = ReverseDb('build/' .. spll_rvdb .. '.reverse.bin')
386 | env.code_rvdb = ReverseDb('build/' .. code_rvdb .. '.reverse.bin')
387 | env.is_mixtyping = abc_extags_size > 0
388 | end
389 |
390 | return { init = init, func = filter }
391 |
392 |
393 |
394 |
--------------------------------------------------------------------------------
/lua/number.lua:
--------------------------------------------------------------------------------
1 | local function splitNumPart(str)
2 | local part = {}
3 | part.int, part.dot, part.dec = string.match(str, "^(%d*)(%.?)(%d*)")
4 | return part
5 | end
6 |
7 | local function GetPreciseDecimal(nNum, n)
8 | if type(nNum) ~= "number" then nNum =tonumber(nNum) end
9 | n = n or 0;
10 | n = math.floor(n)
11 | if n < 0 then n = 0 end
12 | local nDecimal = 10 ^ n
13 | local nTemp = math.floor(nNum * nDecimal);
14 | local nRet = nTemp / nDecimal;
15 | return nRet;
16 | end
17 |
18 | local function decimal_func(str, posMap, valMap)
19 | local dec
20 | posMap = posMap or {[1]="角"; [2]="分"; [3]="厘"; [4]="毫"}
21 | valMap = valMap or {[0]="零"; "壹"; "贰"; "叁" ;"肆"; "伍"; "陆"; "柒"; "捌"; "玖"}
22 | if #str>4 then dec = string.sub(tostring(str), 1, 4) else dec =tostring(str) end
23 | dec = string.gsub(dec, "0+$", "")
24 |
25 | if dec == "" then return "整" end
26 |
27 | local result = ""
28 | for pos =1, #dec do
29 | local val = tonumber(string.sub(dec, pos, pos))
30 | if val~=0 then result = result .. valMap[val] .. posMap[pos] else result = result .. valMap[val] end
31 | end
32 | result=result:gsub(valMap[0]..valMap[0] ,valMap[0])
33 | return result:gsub(valMap[0]..valMap[0] ,valMap[0])
34 | end
35 |
36 | -- 把数字串按千分位四位数分割,进行转换为中文
37 | local function formatNum(num,t)
38 | local digitUnit,wordFigure
39 | local result=""
40 | num=tostring(num)
41 | if tonumber(t) < 1 then digitUnit = {"", "十", "百","千"} else digitUnit = {"","拾","佰","仟"} end
42 | if tonumber(t) <1 then
43 | wordFigure = {"〇","一","二","三","四","五","六","七","八","九"}
44 | else wordFigure = {"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"} end
45 | if string.len(num)>4 or tonumber(num)==0 then return wordFigure[1] end
46 | local lens=string.len(num)
47 | for i=1,lens do
48 | local n=wordFigure[tonumber(string.sub(num,-i,-i))+1]
49 | if n~=wordFigure[1] then result=n .. digitUnit[i] .. result else result=n .. result end
50 | end
51 | result=result:gsub(wordFigure[1]..wordFigure[1] ,wordFigure[1])
52 | result=result:gsub(wordFigure[1].."$","") result=result:gsub(wordFigure[1].."$","")
53 |
54 | return result
55 | end
56 |
57 | -- 数值转换为中文
58 | function number2cnChar(num,flag,digitUnit,wordFigure) --flag=0中文小写反之为大写
59 | local st,result
60 | num=tostring(num) result=""
61 | local num1,num2=math.modf(num)
62 | if tonumber(num2)==0 then
63 | if tonumber(flag) < 1 then
64 | digitUnit = digitUnit or {[1]="万";[2]="亿"} wordFigure = wordFigure or {[1]="〇"; [2]="一"; [3]="十"; [4]="元"}
65 | else
66 | digitUnit = digitUnit or {[1]="万";[2]="亿"} wordFigure = wordFigure or {[1]="零"; [2]="壹"; [3]="拾"; [4]="元"}
67 | end
68 | local lens=string.len(num1)
69 | if lens<5 then result=formatNum(num1,flag) elseif lens<9 then result=formatNum(string.sub(num1,1,-5),flag) .. digitUnit[1].. formatNum(string.sub(num1,-4,-1),flag)
70 | elseif lens<13 then result=formatNum(string.sub(num1,1,-9),flag) .. digitUnit[2] .. formatNum(string.sub(num1,-8,-5),flag) .. digitUnit[1] .. formatNum(string.sub(num1,-4,-1),flag) else result="" end
71 | result=result:gsub("^" .. wordFigure[1],"") result=result:gsub(wordFigure[1] .. digitUnit[1],"") result=result:gsub(wordFigure[1] .. digitUnit[2],"")
72 | result=result:gsub(wordFigure[1] .. wordFigure[1],wordFigure[1]) result=result:gsub(wordFigure[1] .. "$","")
73 | if lens>4 then result=result:gsub("^"..wordFigure[2].. wordFigure[3],wordFigure[3]) end
74 | if result~="" then result=result .. wordFigure[4] else result="数值超限!" end
75 | else return "数值超限!" end
76 |
77 | return result
78 | end
79 |
80 | local function number2zh(num,t)
81 | local result,wordFigure
82 | result=""
83 | if tonumber(t) <1 then
84 | wordFigure = {"〇","一","二","三","四","五","六","七","八","九"}
85 | else wordFigure = {"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"} end
86 | if tostring(num)==nil then return "" end
87 | for pos=1,string.len(num) do
88 | result=result..wordFigure[tonumber(string.sub(num, pos, pos)+1)]
89 | end
90 | result=result:gsub(wordFigure[1] .. wordFigure[1],wordFigure[1])
91 | return result:gsub(wordFigure[1] .. wordFigure[1],wordFigure[1])
92 | end
93 |
94 | function number_translatorFunc(num)
95 | local numberPart=splitNumPart(num)
96 | local result={}
97 | if numberPart.dot~="" then
98 | table.insert(result,{number2cnChar(numberPart.int,0,{"万", "亿"},{"〇","一","十","点"})..number2zh(numberPart.dec,0),"〈数字小写〉"})
99 | table.insert(result,{number2cnChar(numberPart.int,1,{"萬", "億"},{"〇","一","十","点"})..number2zh(numberPart.dec,1),"〈数字大写〉"})
100 | else
101 | table.insert(result,{number2cnChar(numberPart.int,0,{"万", "亿"},{"〇","一","十",""}),"〈数字小写〉"})
102 | table.insert(result,{number2cnChar(numberPart.int,1,{"萬", "億"},{"零","壹","拾",""}),"〈数字大写〉"})
103 | end
104 | table.insert(result,{number2cnChar(numberPart.int,1)..decimal_func(numberPart.dec,{[1]="角"; [2]="分"; [3]="厘"; [4]="毫"},{[0]="零"; "壹"; "贰"; "叁" ;"肆"; "伍"; "陆"; "柒"; "捌"; "玖"}),"〈金额大写〉"})
105 | table.insert(result,{number2cnChar(numberPart.int,0)..decimal_func(numberPart.dec,{[1]="角"; [2]="分"; [3]="厘"; [4]="毫"},{[0]="〇"; "一"; "二"; "三" ;"四"; "五"; "六"; "七"; "八"; "九"}),"〈金额小写〉"})
106 | return result
107 | end
108 |
109 | -- print(#number_translatorFunc(3355.433))
--------------------------------------------------------------------------------
/lua/switcher.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | switch_keyword关键字更换在rime.lua文件rv_var中
3 | 须将 lua_processor@switch_processor 放在 engine/processors 里,并位于默认 selector 之前
4 | --]]
5 |
6 | local kRejected = 0
7 | local kAccepted = 1
8 | local kNoop = 2
9 |
10 | -- 帮助函数,返回被选中的候选的索引
11 | local function select_index(key, env)
12 | local ch = key.keycode
13 | local index = -1
14 | local select_keys = env.engine.schema.select_keys
15 |
16 | if select_keys ~= nil and select_keys ~= "" and not key.ctrl() and ch >= 0x20 and ch < 0x7f then
17 | local pos = string.find(select_keys, string.char(ch))
18 | if pos ~= nil then index = pos end
19 | elseif ch >= 0x30 and ch <= 0x39 then
20 | index = (ch - 0x30 + 9) % 10
21 | elseif ch >= 0xffb0 and ch < 0xffb9 then
22 | index = (ch - 0xffb0 + 9) % 10
23 | elseif ch == 0x20 then
24 | index = 0
25 | end
26 | return index
27 | end
28 |
29 | -- 切换开关函数
30 | local function apply_switch(env, keyword, target_state)
31 | local context = env.engine.context
32 | local switcher = env.switcher
33 | local config = switcher.user_config
34 | context:set_option(keyword, target_state)
35 | -- 如果设置了自动保存,则需相应的配置
36 | if switcher:is_auto_save(keyword) and config ~= nil then
37 | config:set_bool("var/option/" .. keyword, target_state)
38 | -- switcher:refresh_menu(keyword)
39 | end
40 | end
41 |
42 | local function get_switches_list(key, env)
43 | local config =env.engine.schema.config
44 | local size=config:get_list_size("switches")
45 | local switches_list={}
46 | for i =1, size do
47 | table.insert(switches_list,{config:get_string("switches/@" .. i-1 .. "/name"),config:get_string("switches/@" .. i .. "/reset")})
48 | end
49 | return switches_list
50 | end
51 |
52 | local function get_switch_states(list,name)
53 | if type(list)~="table" then return "" end
54 | for i =1, #list do
55 | if list[i][1]==name then return list[i][2] end
56 | end
57 | return ""
58 | end
59 |
60 | local function IsExistChar(obj,chars)
61 | if type(obj)~="table" or chars=="" then return "" end
62 | for i =1,#obj do
63 | if obj[i][2]==chars then return obj[i][1] end
64 | end
65 | return ""
66 | end
67 |
68 | local function get_switch_keywords(obj,chars)
69 | if type(obj)~="table" or chars=="" then return "" end
70 | for i =1,#obj do
71 | if obj[i][1]==chars or obj[i][2]==chars then return obj[i][3] end
72 | end
73 | return ""
74 | end
75 |
76 | local function selector(key, env)
77 | if env.switcher == nil then return kNoop end
78 | if key:release() or key:alt() then return kNoop end
79 | local context = env.engine.context
80 | if (context:is_composing()) then
81 | local idx = select_index(key,env)
82 | if idx < 0 then return kNoop end
83 | local composition = context.composition
84 | local segment = composition:back()
85 | local codetext=env.engine.context.input
86 | local schema_name=env.engine.schema.schema_name or ""
87 | local candidate_count = segment.menu:candidate_count()
88 | local selected_candidate=segment:get_selected_candidate() or ""
89 | local page_pos= math.modf( segment.selected_index/page_size )+1
90 | local trad_mode=env.engine.context:get_option(trad_keyword)
91 | -- if segment.selected_index>page_size then
92 | -- local candidate_pos= math.fmod( segment.selected_index, page_size )
93 | -- end
94 | if page_pos>1 then idx=(page_pos-1)*page_size+idx end
95 | if candidate_count then
96 | local last_candidate=selected_candidate.text
97 | if key.keycode>0x2f and key.keycode<0x6a and idx>-1 then
98 | last_candidate=segment:get_candidate_at(idx).text or ""
99 | end
100 | if context.input == rv_var.switch_schema and last_candidate and not trad_mode then -- 控制关键字切换方案
101 | local sc_id= IsExistChar(enable_schema_list,last_candidate)
102 | -- env.engine:commit_text(last_candidate.."-"..sc_id)
103 | -- context:clear()
104 | if sc_id:find("%a") then
105 | env.engine:apply_schema(Schema(sc_id))
106 | return kAccepted
107 | end
108 | elseif context.input == rv_var.switch_keyword and last_candidate or trad_mode and context.input == rv_var.switch_schema and last_candidate then -- 关键字切换方案选项开关,如简繁切换、拆分开关等等
109 | local keyword=get_switch_keywords(candidate_keywords,last_candidate)
110 | -- env.engine:commit_text(last_candidate .. "-" .. keyword)
111 | if keyword~="" then
112 | local flag=env.engine.context:get_option(keyword)
113 | if flag~=nil then
114 | if env.engine.context:get_option(keyword) then apply_switch(env, keyword, false) else apply_switch(env, keyword, true) end
115 | context:clear()
116 | return kAccepted
117 | end
118 | end
119 | end
120 | end
121 | end
122 |
123 | return kNoop
124 | end
125 |
126 | -- 初始化
127 | local function init(env)
128 | if Switcher == nil then return end
129 | env.switcher = Switcher(env.engine)
130 | page_size = env.engine.schema.page_size
131 | end
132 |
133 | return { init = init, func = selector }
--------------------------------------------------------------------------------
/opencc/es.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Chinese to Emoji",
3 | "segmentation": {
4 | "type": "mmseg",
5 | "dict": {
6 | "type": "text",
7 | "file": "es.txt"
8 | }
9 | },
10 | "conversion_chain": [{
11 | "dict": {
12 | "type": "text",
13 | "file": "es.txt"
14 | }
15 | }]
16 | }
17 |
--------------------------------------------------------------------------------
/pinyin.schema.yaml:
--------------------------------------------------------------------------------
1 | # Rime settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | schema:
7 | schema_id: pinyin
8 | name: "纯拼音"
9 | version: "1.0"
10 | icon: icons/CN.ico
11 | ascii_icon: icons/EN.ico
12 | full_icon: icons/full.ico
13 | half_icon: icons/half.ico
14 | author:
15 | - 佚名
16 | description: |
17 | 源自 Android 拼音
18 | dependencies:
19 | - wubi
20 |
21 | switches:
22 | - name: ascii_mode
23 | reset: 0
24 | states: [ 中, 英 ]
25 |
26 |
27 | engine:
28 | processors:
29 | - ascii_composer
30 | - recognizer
31 | - key_binder
32 | - speller
33 | - punctuator
34 | - selector
35 | - navigator
36 | - express_editor
37 | segmentors:
38 | - ascii_segmentor
39 | - matcher
40 | - abc_segmentor
41 | - punct_segmentor
42 | - fallback_segmentor
43 | translators:
44 | - punct_translator
45 | - script_translator
46 | - reverse_lookup_translator
47 | - "lua_translator@time_date"
48 | filters:
49 | - simplifier
50 | # - reverse_lookup_filter@ci_reverse_lookup # 注释本行去掉拼音模式下编码提示
51 | - uniquifier
52 |
53 | speller:
54 | alphabet: zyxwvutsrqponmlkjihgfedcba
55 | delimiter: " '"
56 | algebra:
57 | - abbrev/^([a-z]).+$/$1/
58 | - abbrev/^([zcs]h).+$/$1/
59 | - derive/^([nl])ue$/$1ve/
60 | - derive/^([jqxy])u/$1v/
61 | - derive/un$/uen/
62 | - derive/ui$/uei/
63 | - derive/iu$/iou/
64 | - derive/([aeiou])ng$/$1gn/
65 | - derive/([dtngkhrzcs])o(u|ng)$/$1o/
66 | - derive/ong$/on/
67 | - derive/ao$/oa/
68 | - derive/([iu])a(o|ng?)$/a$1$2/
69 |
70 | translator:
71 | dictionary: pinyin
72 | preedit_format:
73 | - xform/([nl])v/$1ü/
74 | - xform/([nl])ue/$1üe/
75 | - xform/([jqxy])v/$1u/
76 |
77 | punctuator:
78 | import_preset: symbols
79 |
80 | key_binder:
81 | import_preset: default
82 |
83 | recognizer:
84 | import_preset: default
85 | patterns:
86 | punct: '^/([0-9]0?|[A-Za-z]+)$'
87 | reverse_lookup: "^z[a-z]*'?$"
88 |
89 | ci_reverse_lookup:
90 | dictionary: wubi.extended
91 | enable_completion: true
92 | tips: 〈拼音〉
93 |
94 | style:
95 | horizontal: true #竖排为false
96 | inline_preedit: true
97 |
98 |
--------------------------------------------------------------------------------
/punctuation.yaml:
--------------------------------------------------------------------------------
1 | # Rime basic symbols
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | full_shape:
7 | ' ' : { commit: ' ' }
8 | ',' : { commit: , }
9 | '.' : { commit: 。 }
10 | '<' : [ 《, 〈, «, ‹ ]
11 | '>' : [ 》, 〉, », › ]
12 | '/' : [ /, ÷ ]
13 | '?' : { commit: ? }
14 | ';' : { commit: ; }
15 | ':' : { commit: : }
16 | '''' : { pair: [ '‘', '’' ] }
17 | '"' : { pair: [ '“', '”' ] }
18 | '\' : [ 、, \ ]
19 | '|' : [ ·, |, '§', '¦' ]
20 | '`' : `
21 | '~' : ~
22 | '!' : { commit: ! }
23 | '@' : [ @, ☯ ]
24 | '#' : [ #, ⌘ ]
25 | '%' : [ %, '°', '℃' ]
26 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ]
27 | '^' : { commit: …… }
28 | '&' : &
29 | '*' : [ *, ·, ・, ×, ※, ❂ ]
30 | '(' : (
31 | ')' : )
32 | '-' : -
33 | '_' : ——
34 | '+' : +
35 | '=' : =
36 | '[' : [ 「, 【, 〔, [ ]
37 | ']' : [ 」, 】, 〕, ] ]
38 | '{' : [ 『, 〖, { ]
39 | '}' : [ 』, 〗, } ]
40 |
41 | half_shape:
42 | ',' : { commit: , }
43 | '.' : { commit: 。 }
44 | '<' : [ 《, 〈, «, ‹ ]
45 | '>' : [ 》, 〉, », › ]
46 | '/' : [ 、, '/', /, ÷ ]
47 | '?' : { commit: ? }
48 | ';' : { commit: ; }
49 | ':' : { commit: : }
50 | '''' : { pair: [ '‘', '’' ] }
51 | '"' : { pair: [ '“', '”' ] }
52 | '\' : [ 、, '\', \ ]
53 | '|' : [ ·, '|', |, '§', '¦' ]
54 | '`' : '`'
55 | '~' : [ '~', ~ ]
56 | '!' : { commit: ! }
57 | '@' : '@'
58 | '#' : '#'
59 | '%' : [ '%', %, '°', '℃' ]
60 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ]
61 | '^' : { commit: …… }
62 | '&' : '&'
63 | '*' : [ '*', *, ·, ・, ×, ※, ❂ ]
64 | '(' : (
65 | ')' : )
66 | '-' : '-'
67 | '_' : ——
68 | '+' : '+'
69 | '=' : '='
70 | '[' : [ 「, 【, 〔, [ ]
71 | ']' : [ 」, 】, 〕, ] ]
72 | '{' : [ 『, 〖, { ]
73 | '}' : [ 』, 〗, } ]
74 |
75 | ascii_style:
76 | ',' : { commit: ',' }
77 | '.' : { commit: '.' }
78 | '<' : '<'
79 | '>' : '>'
80 | '/' : '/'
81 | '?' : { commit: '?' }
82 | ';' : { commit: ';' }
83 | ':' : { commit: ':' }
84 | "'" : "'"
85 | '"' : '"'
86 | '\' : '\'
87 | '|' : '|'
88 | '`' : '`'
89 | '~' : '~'
90 | '!' : { commit: '!' }
91 | '@' : '@'
92 | '#' : '#'
93 | '%' : '%'
94 | '$' : '$'
95 | '^' : '^'
96 | '&' : '&'
97 | '*' : '*'
98 | '(' : '('
99 | ')' : ')'
100 | '-' : '-'
101 | '_' : '_'
102 | '+' : '+'
103 | '=' : '='
104 | '[' : '['
105 | ']' : ']'
106 | '{' : '{'
107 | '}' : '}'
108 |
--------------------------------------------------------------------------------
/quick_symbols.dict.yaml:
--------------------------------------------------------------------------------
1 | # Rime dictionary
2 | # encoding: utf-8
3 | #
4 | # Credit: 何海峰
5 | # modify: 空山明月、程心诚医
6 | # date: 2024-05-27
7 | ---
8 | name: quick_symbols
9 | version: "1.0.1"
10 | sort: original
11 | use_preset_vocabulary: false
12 | ...
13 | : ;q
14 | ? ;w
15 | “ ;e
16 | ” ;r
17 | @ ;t
18 | ・ ;y
19 | 「 ;u
20 | 」 ;i
21 | → ;o
22 | ~ ;p
23 | ! ;a
24 | …… ;s
25 | 、 ;d
26 | 《 ;g
27 | - ;h
28 | :「 ;j
29 | 〔 ;k
30 | 〕 ;l
31 | ( ;z
32 | * ;x
33 | ) ;c
34 | —— ;v
35 | 》 ;b
36 | // ;n
37 | > ;m
--------------------------------------------------------------------------------
/rime.lua:
--------------------------------------------------------------------------------
1 | --[
2 | --modify: 空山明月
3 | --date: 2024-04-03
4 | --]
5 |
6 | -- --=========================================================关键字修改--==========================================================
7 | -- --==========================================================--==========================================================
8 | rv_var={ week_var="week",date_var="date",nl_var="nl",time_var="time",jq_var="jq",switch_keyword="next",help="help",switch_schema="mode"} -- 编码关键字修改
9 | trad_keyword="zh_trad" -- 简繁切换switcher参数
10 | single_keyword="single_char" -- 单字过滤switcher参数
11 | spelling_keyword="new_spelling" -- 拆分switcher参数
12 | GB2312_keyword="GB2312" -- GB2312开关switcher参数
13 | emoji_keyword="show_es" -- GB2312开关switcher参数
14 | candidate_keywords={{"Emoji😀","Emoji😀",emoji_keyword},{"简繁","簡繁",trad_keyword},{"拆分","拆分",spelling_keyword},{"GB2312过滤","GB2312過濾",GB2312_keyword},{"单字模式","單字模式",single_keyword}} -- 活动开关项关键字
15 | -- --==========================================================--==========================================================
16 | -- --==========================================================--==========================================================
17 | -- 拆分数据匹配
18 | new_spelling = require("new_spelling")
19 | -- 监控并记录自造词至文件等,必须配置lua_processor@submit_text_processor
20 | submit_text_processor = require("Submit_text")
21 | helper = require("helper")
22 | switch_processor = require("switcher")
23 | calculator = require("calculator")
24 | require("lunarDate")
25 | require("lunarJq")
26 | require("lunarGz")
27 | require("number")
28 | -- --=========================================================;获取Rime程序目录/用户目录/同步目录路径===========================
29 | function GetRimeAllDir()
30 | local sync_dir=rime_api.get_sync_dir() -- 获取同步资料目录
31 | -- local rime_version=rime_api.get_rime_version() -- 获取rime版本号macos无效
32 | local shared_data_dir=rime_api.get_shared_data_dir() -- 获取程序目录data路径
33 | local user_data_dir=rime_api.get_user_data_dir() -- 获取用户目录路径
34 | return {sync_dir=sync_dir or ""
35 | ,rime_version=rime_version or ""
36 | ,shared_data_dir=shared_data_dir or ""
37 | ,user_data_dir=user_data_dir or ""}
38 | end
39 |
40 | local function get_schema_name(schema_id)
41 | local user_data_dir=rime_api.get_user_data_dir() -- 获取用户目录路径
42 | local schema_name=""
43 | if user_data_dir:find("/") then user_data_dir=user_data_dir.."/"..schema_id..".schema.yaml" else user_data_dir=user_data_dir.."\\"..schema_id..".schema.yaml" end
44 | local file = io.open(user_data_dir, "rb")
45 | if file then
46 | for line in file:lines() do
47 | local m,n=line:match("(%s*name%:%s)%s*%p*([^%c%s]+)%p*")
48 | if m and n then
49 | return n:gsub("[']+$",""):gsub('["]+$','')
50 | end
51 | end
52 | file:close()
53 | return schema_name
54 | end
55 | return schema_name
56 | end
57 |
58 | local function get_schema_list()
59 | local user_data_dir=rime_api.get_user_data_dir()
60 | if user_data_dir:find("/") then user_data_dir=user_data_dir.."/build/default.yaml" else user_data_dir=user_data_dir.."\\build\\default.yaml" end
61 | local file = io.open(user_data_dir, "rb")
62 | if file then
63 | local schema_list={}
64 | for line in file:lines() do
65 | local m,n=line:match("(%-%s*schema%:%s)([^%c%s]+)")
66 | if m and n then
67 | local name=get_schema_name(n)
68 | if name~="" then table.insert(schema_list,{n,name}) end
69 | end
70 | end
71 | file:close()
72 | return schema_list
73 | end
74 | end
75 |
76 | rime_dirs=GetRimeAllDir() RimeDefalutDir=""
77 | enable_schema_list=get_schema_list()
78 | debug_path=debug.getinfo(1,"S").source:sub(2):sub(1,-10)
79 | if rime_dirs.shared_data_dir==debug_path then
80 | RimeDefalutDir=rime_dirs.shared_data_dir
81 | elseif rime_dirs.user_data_dir==debug_path then
82 | RimeDefalutDir=rime_dirs.user_data_dir
83 | else
84 | RimeDefalutDir=debug_path
85 | end
86 | -- --=========================================================自造词文件存放路径===========================================================
87 | -- 自造词文件存放路径
88 | userphrasepath=""
89 | if RimeDefalutDir~="" then
90 | if RimeDefalutDir:find("\\") then
91 | userphrasepath=RimeDefalutDir.."\\userphrase.txt"
92 | elseif RimeDefalutDir:find("/") then
93 | userphrasepath=RimeDefalutDir.."/userphrase.txt"
94 | end
95 | end
96 | -- --=========================================================读取lua目录下hotstring.txt文件===========================================================
97 | -- --======================================================格式:编码+Tab+字符串+Tab+字符串说明========================================================
98 | function FileIsExist(name)
99 | local f=io.open(name,"r")
100 | if f~=nil then io.close(f) return true else return false end
101 | end
102 |
103 | function string.split(str, delimiter)
104 | if str==nil or str=='' or delimiter==nil or delimiter=="" then
105 | return ""
106 | end
107 |
108 | local result = {}
109 | for match in (str..delimiter):gmatch("(.-)"..delimiter) do
110 | table.insert(result, match)
111 | end
112 | return result
113 | end
114 |
115 | local function splitCharPart(str)
116 | local part = {}
117 | if str==nil or str=='' then
118 | return part
119 | else
120 | part[1], part[2], part[3] = string.match(str:gsub("\r",""), "^([^%c]+)%c([^%c]+)%c?([^%c]*)")
121 | part[1]=part[1]:gsub("[^%a]",""):lower()
122 | if part[1] then
123 | part[1]=part[1]:gsub("\\r","\r")
124 | if part[2] then part[2]=part[2]:gsub("\\r","\r") end
125 | if part[3] then part[3]=part[3]:gsub("\\r","\r") end
126 | end
127 | end
128 |
129 | return part
130 | end
131 |
132 | function table.kIn(tbl, key)
133 | if tbl == nil then
134 | return false
135 | end
136 | for k, v in pairs(tbl) do
137 | if k == key then
138 | return true
139 | end
140 | end
141 | return false
142 | end
143 |
144 | -- 查看某值是否为表tbl中的value值
145 | function table.vIn(tbl, value)
146 | if tbl == nil then
147 | return false
148 | end
149 | for k, v in pairs(tbl) do
150 | if v == value then
151 | return true
152 | end
153 | end
154 | return false
155 | end
156 |
157 | local function FormatFileContent(FilePath) -- 格式化lua字符串函数
158 | local hotstring_obj={}
159 | file = io.open(FilePath,"r")
160 | if file~=nil then
161 | for line in file:lines() do
162 | local tarr=splitCharPart(line)
163 | if tarr[1] then
164 | if type(hotstring_obj[tarr[1]])~="table" then
165 | hotstring_obj[tarr[1]]={}
166 | table.insert(hotstring_obj[tarr[1]],{tarr[2],tarr[3]})
167 | else
168 | table.insert(hotstring_obj[tarr[1]],{tarr[2],tarr[3]})
169 | end
170 | end
171 | end
172 | io.close(file)
173 | end
174 | return hotstring_obj
175 | end
176 |
177 | function formatRimeDir(FilePath,dirName)
178 | FilePath=FilePath or debug.getinfo(1,"S").source:sub(2):sub(1,-10)
179 | if FilePath:find("\\") then
180 | if dirName:find("/") then dirName=dirName:gsub("/","\\") end
181 | return FilePath .."\\" .. dirName .. "\\"
182 | elseif FilePath:find("/") then
183 | if dirName:find("\\") then dirName=dirName:gsub("\\","/") end
184 | return FilePath .. "/" ..dirName .. "/"
185 | else
186 | if dirName:find("/") then dirName=dirName:gsub("/","\\") end
187 | return FilePath .. "\\" .. dirName .. "\\"
188 | end
189 | end
190 |
191 | luaDefalutDir=formatRimeDir(RimeDefalutDir,"lua") -- 设置lua脚本文件读取全局默认路径为data\lua目录
192 | local hotstring_obj=FormatFileContent(luaDefalutDir.."hotstring.txt") -- 读取hotstring.txt内容并格式化为所需数据格式
193 | -- --====================================================================================================================
194 | --====================================================================================================================
195 | function RunScript(cmd, raw)
196 | local f = assert(io.popen(cmd, 'r'))
197 | -- wait(10000);
198 | local s = assert(f:read('*a'))
199 | f:close()
200 | if raw then return s end
201 | s = string.gsub(s, '^%s+', '')
202 | s = string.gsub(s, '%s+$', '')
203 | s = string.gsub(s, '[\n\r]+', ' ')
204 | return s
205 | end
206 |
207 | function RunCapture(filepath)
208 | file=io.open(filepath,"r")
209 | if file~=nil then
210 | io.popen(filepath)
211 | file.close(file)
212 | return 1
213 | end
214 | return 0
215 | end
216 | --===================================================时间/日期/农历/历法/数字转换输出=================================================================
217 | -- --====================================================================================================================
218 | function CnDate_translator(y)
219 | local t,cstr,t2,t1
220 | cstr = {"〇","一","二","三","四","五","六","七","八","九"} t="" t1=tostring(y)
221 | if t1.len(tostring(t1))~=8 then return t1 end
222 | for i =1,t1.len(t1) do
223 | t2=cstr[tonumber(t1.sub(t1,i,i))+1]
224 | if i==5 and t2 ~= "〇" then t2="年十" elseif i==5 and t2 == "〇" then t2="年" end
225 | if i==6 and t2 ~= "〇" then t2 =t2 .. "月" elseif i==6 and t2 == "〇" then t2="月" end
226 | --if t.sub(t,t.len(t)-1)=="年" then t2=t2 .. "月" end
227 | if i==7 and tonumber(t1.sub(t1,7,7))>1 then t2= t2 .. "十" elseif i==7 and t2 == "〇" then t2="" elseif i==7 and tonumber(t1.sub(t1,7,7))==1 then t2="十" end
228 | if i==8 and t2 ~= "〇" then t2 =t2 .. "日" elseif i==8 and t2 == "〇" then t2="日" end
229 | t=t .. t2
230 | end
231 | return t
232 | end
233 |
234 | local GetLunarSichen= function(time,t)
235 | local time=tonumber(time)
236 | local LunarSichen = {"子时(夜半|三更)", "丑时(鸡鸣|四更)", "寅时(平旦|五更)", "卯时(日出)", "辰时(食时)", "巳时(隅中)", "午时(日中)", "未时(日昳)", "申时(哺时)", "酉时(日入)", "戌时(黄昏|一更)", "亥时(人定|二更)"}
237 | if tonumber(t)==1 then sj=math.floor((time+1)/2)+1 elseif tonumber(t)==0 then sj=math.floor((time+13)/2)+1 end
238 | if sj>12 then return LunarSichen[sj-12] else return LunarSichen[sj] end
239 | end
240 |
241 | --年天数判断
242 | local function IsLeap(y)
243 | local year=tonumber(y)
244 | if math.fmod(year,400)~=0 and math.fmod(year,4)==0 or math.fmod(year,400)==0 then return 366
245 | else return 365 end
246 | end
247 |
248 | local format_Time= function()
249 | if os.date("%p")=="AM" then return "上午" else return "下午" end
250 | end
251 |
252 | -- 星期格式转换
253 | -- modify by: 空山明月
254 | local format_week= function(n)
255 | local obj={"日","一","二","三","四","五","六"}
256 | if tonumber(n)==1 then
257 | return "周"..obj[os.date("%w")+1]
258 | elseif tonumber(n)==2 then
259 | return "星期"..obj[os.date("%w")+1]
260 | else
261 | return "礼拜"..obj[os.date("%w")+1]
262 | end
263 | end
264 | ------------------------lua内置日期变量参考-------------------------------------
265 | --[[
266 | --%a 星期简称,如Wed %A 星期全称,如Wednesday
267 | --%b 月份简称,如Sep %B 月份全称,如September
268 | --%c 日期时间格式 (e.g., 09/16/98 23:48:10)
269 | --%d 一个月的第几天 [01-31] %j 一年的第几天
270 | --%H 24小时制 [00-23] %I 12小时制 [01-12]
271 | --%M 分钟 [00-59] %m 月份 (09) [01-12]
272 | --%p 上午/下午 (pm or am)
273 | --%S 秒 (10) [00-61]
274 | --%w 星期的第几天 [0-6 = Sunday-Saturday] %W 一年的第几周
275 | --%x 日期格式 (e.g., 09/16/98) %X 时间格式 (e.g., 23:48:10)
276 | --%Y 年份全称 (1998) %y 年份简称 [00-99]
277 | --%% 百分号
278 | --os.date() 把时间戳转化成可显示的时间字符串
279 | --os.time ([table])
280 | --]]
281 | ----------------------------------------------------------------
282 |
283 | -- 分割字符串
284 | -- str: 需要被分割的字符串
285 | -- reps: 分割字符串的符号
286 | -- return: 返回被一个字符集
287 | -- author: 空山明月
288 | local function split(str,reps)
289 | local resultStrList = {}
290 | string.gsub(str,'[^'..reps..']+',function (w)
291 | table.insert(resultStrList,w)
292 | end)
293 | return resultStrList
294 | end
295 |
296 | -- 将数字转换成中文数字
297 | -- author: 空山明月
298 | local function num2strcn(strNum)
299 | local hzNum = {"一", "二", "三", "四", "五", "六", "七", "八", "九", "零"}
300 | local hzWei = {"十", "百", "千"}
301 | local strValue = ""
302 |
303 | local num = tonumber(strNum)
304 | if num < 10 then
305 | if num == 0 then
306 | num = 10
307 | end
308 | strValue = hzNum[num]
309 | end
310 |
311 | if num >= 10 and num < 20 then
312 | if num == 10 then
313 | strValue = hzWei[1]
314 | else
315 | local sencValue = string.sub(strNum,2,2)
316 | strValue = hzWei[1]..hzNum[tonumber(sencValue)]
317 | end
318 | end
319 |
320 | if num >= 20 and num < 100 then
321 | local firstValue = string.sub(strNum,1,1)
322 | local sencValue = string.sub(strNum,2,2)
323 |
324 | if sencValue == "0" then
325 | strValue = hzNum[tonumber(firstValue)]..hzWei[1]
326 | else
327 | strValue = hzNum[tonumber(firstValue)]..hzWei[1]..hzNum[tonumber(sencValue)]
328 | end
329 | end
330 |
331 | return strValue
332 | end
333 |
334 | -- 将时间字符串转换成中文时间格式
335 | -- strDate: 格式 2024.05.12
336 | -- return: 返回中文描述的时间字符串,格式 二〇二四年五月十二日
337 | -- author: 空山明月
338 | local function date2strcn(strDate)
339 | local hzNum = {"一", "二", "三", "四", "五", "六", "七", "八", "九", "零"}
340 | local strYear = ""
341 | local strMoth = ""
342 | local strDay = ""
343 |
344 | local dtArray = split(strDate, '.')
345 | for i=1, #dtArray do
346 | local szNum = dtArray[i]
347 |
348 | for j=1, string.len(tostring(szNum)) do
349 | local strNum = string.sub(szNum,j,j)
350 |
351 | if i == 1 then
352 | if strNum == "0" then
353 | strNum = "10"
354 | end
355 |
356 | local index = tonumber(strNum)
357 | local strValue = hzNum[index]
358 | strYear = strYear..strValue
359 | end
360 |
361 | if i == 2 then
362 | if j == 1 then
363 | if strNum ~= "0" then
364 | local index = tonumber(strNum)
365 | local strValue = hzNum[index]
366 | strMoth = strMoth..strValue.."十"
367 | end
368 | end
369 |
370 | if j == 2 then
371 | if strNum ~= "0" then
372 | local index = tonumber(strNum)
373 | local strValue = hzNum[index]
374 | strMoth = strMoth..strValue
375 | end
376 | end
377 |
378 | end
379 |
380 | if i == 3 then
381 | if j == 1 then
382 | if strNum ~= "0" then
383 | local index = tonumber(strNum)
384 | local strValue = hzNum[index]
385 |
386 | if strNum == "1" then
387 | strDay = strDay.."十"
388 | else
389 | strDay = strDay..strValue.."十"
390 | end
391 | end
392 | end
393 |
394 | if j == 2 then
395 | if strNum ~= "0" then
396 | local index = tonumber(strNum)
397 | local strValue = hzNum[index]
398 | strDay = strDay..strValue
399 | end
400 | end
401 | end
402 | end
403 | end
404 |
405 | return strYear.."年"..strMoth.."月"..strDay.."日"
406 | end
407 |
408 | -- 时间向前或向后计算
409 | -- author: 空山明月
410 | local function addDaysToDate(days, format)
411 | return os.date(format, os.time() + days * 86400)
412 | end
413 |
414 | -- 从当前日期向前或向后计算
415 | -- author: 空山明月
416 | function somedate_translator(input, seg, days)
417 | local keyword = rv_var["date_var"]
418 | if (input == keyword) then
419 | local dates = {
420 | addDaysToDate(days, "%Y年%m月%d日")
421 | ,addDaysToDate(days, "%Y-%m-%d")
422 | ,addDaysToDate(days, "%Y%m%d")
423 | ,date2strcn(addDaysToDate(days, "%Y.%m.%d"))
424 | }
425 | for i =1,#dates do
426 | yield(Candidate(keyword, seg.start, seg._end, dates[i], "〈日期〉"))
427 | end
428 | dates = nil
429 | end
430 | end
431 |
432 | -- 获取本月相邻月份同一天时的日期
433 | -- 比如今天是 2024-05-13,则可获取 2024-04/6-13 的日期
434 | -- today: 当天日期
435 | -- is_next: true 表示获取下个月,fase 表示获取上个月
436 | -- retrun: 返回结果表示与当天相差的天数
437 | -- author: 空山明月
438 | function get_month_sameday(is_next)
439 | local offset_days = 0
440 | local this_year, this_month = os.date("%Y", os.time()), os.date("%m", os.time())
441 | local now_days = os.date("%d", os.time()) -- 本月第几天
442 |
443 | local last_month, next_month = 0, 0
444 | local this_day_amount = 0
445 | local last_day_amount = 0
446 | local next_day_amount = 0
447 |
448 | if is_next then
449 | -- 如果现在是12月份,需要向后推一年
450 | if this_month == 12 then
451 | last_month, next_month = this_month - 1, 1
452 | else
453 | last_month, next_month = this_month - 1, this_month + 1
454 | end
455 |
456 | this_day_amount = os.date("%d", os.time({year=this_year, month=this_month+1, day=0}))
457 | next_day_amount = os.date("%d", os.time({year=this_year, month=next_month+1, day=0}))
458 |
459 | -- 如果时间间隔超出了下个月的最后一天,则按最后一天算
460 | local temp_offset_max = this_day_amount
461 | local temp_offset_min = this_day_amount - now_days + next_day_amount
462 | if now_days >= next_day_amount then
463 | offset_days = temp_offset_min
464 | else
465 | offset_days = temp_offset_max
466 | end
467 | else
468 | -- 如果当前是1月份,需要向前推一年
469 | if this_month == 1 then
470 | last_month, next_month = 12, this_month + 1
471 | else
472 | last_month, next_month = this_month - 1, this_month + 1
473 | end
474 |
475 | this_day_amount = os.date("%d", os.time({year=this_year, month=this_month+1, day=0}))
476 | last_day_amount = os.date("%d", os.time({year=this_year, month=last_month+1, day=0}))
477 |
478 | -- 如果时间间隔超出了下个月的最后一天,则按最后一天算
479 | if now_days <= last_day_amount then
480 | offset_days = last_day_amount
481 | else
482 | offset_days = now_days
483 | end
484 | end
485 |
486 | return offset_days
487 | end
488 |
489 | -- 公历日期
490 | function date_translator(input, seg)
491 | local keyword = rv_var["date_var"]
492 | if (input == keyword) then
493 | local dates = {
494 | os.date("%Y年%m月%d日")
495 | ,os.date("%Y-%m-%d")
496 | ,os.date("%Y%m%d")
497 | -- ,os.date("%Y.%m.%d")
498 | -- ,os.date("%Y%m%d")
499 | -- ,os.date("%Y-%m-%d 第%W周")
500 | ,date2strcn(os.date("%Y.%m.%d"))
501 | -- ,CnDate_translator(os.date("%Y%m%d"))
502 | -- ,os.date("%Y-%m-%d|%j/" .. IsLeap(os.date("%Y")))
503 | }
504 | -- Candidate(type, start, end, text, comment)
505 | for i =1,#dates do
506 | yield(Candidate(keyword, seg.start, seg._end, dates[i], "〈日期〉"))
507 | end
508 | dates = nil
509 | end
510 | end
511 |
512 | -- 公历时间
513 | function time_translator(input, seg)
514 | local keyword = rv_var["time_var"]
515 | if (input == keyword) then
516 | local times = {
517 | os.date("%H:%M:%S")
518 | ,os.date("%H").."时"..os.date("%M").."分"..os.date("%S").."秒"
519 | ,num2strcn(tostring(os.date("%H"))).."时"..num2strcn(tostring(os.date("%M"))).."分"..num2strcn(tostring(os.date("%S"))).."秒"
520 | }
521 | for i =1,#times do
522 | yield(Candidate(keyword, seg.start, seg._end, times[i], "〈时间〉"))
523 | end
524 | times = nil
525 | end
526 | end
527 |
528 | -- 农历日期
529 | function lunar_translator(input, seg)
530 | local keyword = rv_var["nl_var"]
531 | if (input == keyword) then
532 | local lunar = {
533 | {Date2LunarDate(os.date("%Y%m%d")) .. JQtest(os.date("%Y%m%d")),"〈公历⇉农历〉"}
534 | ,{Date2LunarDate(os.date("%Y%m%d")) .. GetLunarSichen(os.date("%H"),1),"〈公历⇉农历〉"}
535 | ,{lunarJzl(os.date("%Y%m%d%H")),"〈公历⇉干支〉"}
536 | ,{LunarDate2Date(os.date("%Y%m%d"),0),"〈农历⇉公历〉"}
537 | }
538 | local leapDate={LunarDate2Date(os.date("%Y%m%d"),1).."(闰)","〈农历⇉公历〉"}
539 | if string.match(leapDate[1],"^(%d+)")~=nil then table.insert(lunar,leapDate) end
540 | for i =1,#lunar do
541 | yield(Candidate(keyword, seg.start, seg._end, lunar[i][1], lunar[i][2]))
542 | end
543 | lunar = nil
544 | end
545 | end
546 |
547 | local function QueryLunarInfo(date)
548 | local str,LunarDate,LunarGz,result,DateTime
549 | date=tostring(date) result={}
550 | str = date:gsub("^(%u+)","")
551 | if string.match(str,"^(20)%d%d+$")~=nil or string.match(str,"^(19)%d%d+$")~=nil then
552 | if string.len(str)==4 then str=str..string.sub(os.date("%m%d%H"),1) elseif string.len(str)==5 then str=str..string.sub(os.date("%m%d%H"),2) elseif string.len(str)==6 then str=str..string.sub(os.date("%m%d%H"),3) elseif string.len(str)==7 then str=str..string.sub(os.date("%m%d%H"),4)
553 | elseif string.len(str)==8 then str=str..string.sub(os.date("%m%d%H"),5) elseif string.len(str)==9 then str=str..string.sub(os.date("%m%d%H"),6) else str=string.sub(str,1,10) end
554 | if tonumber(string.sub(str,5,6))>12 or tonumber(string.sub(str,5,6))<1 or tonumber(string.sub(str,7,8))>31 or tonumber(string.sub(str,7,8))<1 or tonumber(string.sub(str,9,10))>24 then return result end
555 | LunarDate=Date2LunarDate(str) LunarGz=lunarJzl(str) DateTime=LunarDate2Date(str,0)
556 | if LunarGz~=nil then
557 | result={
558 | {CnDate_translator(string.sub(str,1,8)),"〈中文日期〉"}
559 | ,{LunarDate,"〈公历⇉农历〉"}
560 | ,{LunarGz,"〈公历⇉干支〉"}
561 | }
562 | if tonumber(string.sub(str,7,8))<31 then
563 | table.insert(result,{DateTime,"〈农历⇉公历〉"})
564 | local leapDate={LunarDate2Date(str,1).."(闰)","〈农历⇉公历〉"}
565 | if string.match(leapDate[1],"^(%d+)")~=nil then table.insert(result,leapDate) end
566 | end
567 | end
568 | end
569 |
570 | return result
571 | end
572 |
573 | -- 农历查询
574 | function QueryLunar_translator(input, seg) --输入一个或一个以上等于号,进行农历反查
575 | local str,lunar
576 | if string.match(input,"^=+(%d+)$")~=nil then
577 | str = string.gsub(input,"^(=+)", "")
578 | if string.match(str,"^(20)%d%d+$")~=nil or string.match(str,"^(19)%d%d+$")~=nil then
579 | lunar=QueryLunarInfo(str)
580 | if #lunar>0 then
581 | for i=1,#lunar do
582 | yield(Candidate(input, seg.start, seg._end, lunar[i][1],lunar[i][2]))
583 | end
584 | end
585 | end
586 | end
587 | end
588 |
589 | --- 单字模式
590 | function single_char(input, env)
591 | local b = env.engine.context:get_option(single_keyword)
592 | local input_text = env.engine.context.input
593 | for cand in input:iter() do
594 | if (not b or utf8.len(cand.text) == 1 or table.vIn(rv_var, input_text) or input_text:find("^z") or input_text:find("^[%u%p]")) then
595 | yield(cand)
596 | end
597 | end
598 | end
599 |
600 | -- 星期
601 | function week_translator(input, seg)
602 | local keyword = rv_var["week_var"]
603 | -- local luapath=debug.getinfo(1,"S").source:sub(2):sub(1,-9) -- luapath.."lua\\user.txt"
604 | if (input == keyword) then
605 | local weeks = {
606 | format_week(1)
607 | ,format_week(2)
608 | ,format_week(0)
609 | }
610 | for i =1,#weeks do
611 | yield(Candidate(keyword, seg.start, seg._end, weeks[i], "〈星期〉"))
612 | end
613 | weeks = nil
614 | end
615 | end
616 |
617 | --列出当年余下的节气
618 | function Jq_translator(input, seg)
619 | local keyword = rv_var["jq_var"]
620 | if (input == keyword) then
621 | local jqs = GetNowTimeJq(os.date("%Y%m%d"))
622 | for i =1,#jqs do
623 | yield(Candidate(keyword, seg.start, seg._end, jqs[i], "〈节气〉"))
624 | end
625 | jqs = nil
626 | end
627 | end
628 |
629 | -------------------------------------------------------------
630 | --[[
631 | hotstring.txt文件格式:
632 | 编码+tab+内容+tab+注解
633 | 或
634 | 编码+tab+内容
635 | --]]
636 | ----------------------------------------------------------------
637 |
638 | -- 匹配长字符串
639 | function longstring_translator(input, seg) --编码为小写字母开头为过滤条件为"^(%l+%a+)" 以/开头的"^(%l+)"改为"^/",编码为大写字母开头改为"^(%u+%a+)",不分大小写为"^(%a+)"
640 | local str,m,strings
641 | if string.match(input,"^(%u+%a+)")~=nil then
642 | str = string.gsub(input,"^/", "")
643 | if type(hotstring_obj)== "table" then
644 | strings=hotstring_obj[str:lower(str)]
645 | if type(strings)== "table" then
646 | for i =1,#strings do
647 | if strings[i][2]~="" then m="〈".. strings[i][2].."〉" else m="" end
648 | yield(Candidate(input, seg.start, seg._end, strings[i][1],m))
649 | end
650 | end
651 | end
652 | end
653 | end
654 |
655 | function number_translator(input, seg)
656 | local str,num,numberPart
657 | if string.match(input,"^(%u+%d+)(%.?)(%d*)$")~=nil then
658 | str = string.gsub(input,"^(%a+)", "") numberPart=number_translatorFunc(str)
659 | if #numberPart>0 then
660 | for i=1,#numberPart do
661 | yield(Candidate(input, seg.start, seg._end, numberPart[i][1],numberPart[i][2]))
662 | end
663 | end
664 | end
665 | end
666 |
667 | local function set_switch_keywords(input, seg,env)
668 | local schema = env.engine.schema
669 | local config = env.engine.schema.config
670 | local schema_name=env.engine.schema.schema_name or ""
671 | local schema_id=env.engine.schema.schema_id or ""
672 | local composition = env.engine.context.composition
673 | local segment = composition:back()
674 | local trad_mode=env.engine.context:get_option(trad_keyword)
675 |
676 | if input == rv_var.switch_keyword and #candidate_keywords>0 or input == rv_var.switch_schema and #enable_schema_list>0 and trad_mode then
677 | if schema_name then segment.prompt =" 〈 当前方案:"..schema_name.." 〉" end
678 | local cand =nil
679 | local seg_text=""
680 | for i =1,#candidate_keywords do
681 | if trad_mode then seg_text=candidate_keywords[i][2] else seg_text=candidate_keywords[i][1] end
682 | if env.engine.context:get_option(candidate_keywords[i][3]) then
683 | cand = Candidate(input, seg.start, seg._end, seg_text," ✓")
684 | else
685 | cand = Candidate(input, seg.start, seg._end, seg_text," ✕")
686 | end
687 | cand.quality=100000000
688 | yield(cand)
689 | end
690 | elseif input == rv_var.switch_schema and #enable_schema_list>0 and not trad_mode then
691 | local select_index=1
692 | for i =1,#enable_schema_list do
693 | if enable_schema_list[i][2] then
694 | local comment=""
695 | if enable_schema_list[i][1]==schema_id then comment=" ☚" select_index=i-1 end
696 | local cand = Candidate(input, seg.start, seg._end, enable_schema_list[i][2],comment)
697 | segment.selected_index=select_index
698 | cand.quality=100000000
699 | yield(cand)
700 | end
701 | end
702 | end
703 | end
704 |
705 | -- 时期类字符串集
706 | -- author: 空山明月
707 | str_date_time={
708 | today="wygd",
709 | next_day="jegd",
710 | after_next_day = "rggd",
711 | lastday = "jtgd",
712 | before_lastday = "uegd",
713 | time = "jfuj",
714 | this_week = "sgmf",
715 | last_week = "hhmf",
716 | next_week = "ghmf",
717 | this_month = "sgee",
718 | last_month = "hhee",
719 | next_month = "ghee",
720 | }
721 |
722 | -- 时间字符串转译成时间
723 | -- author: 空山明月
724 | function str2datetime_translator(input, seg)
725 |
726 | -- 输出今天的日期
727 | if (input == str_date_time["today"]) then
728 | date_translator("date", seg)
729 | end
730 |
731 | -- 输出明天的日期
732 | if (input == str_date_time["next_day"]) then
733 | somedate_translator("date", seg, 1)
734 | end
735 |
736 | -- 输出后天的日期
737 | if (input == str_date_time["after_next_day"]) then
738 | somedate_translator("date", seg, 2)
739 | end
740 |
741 | -- 输出昨天的日期
742 | if (input == str_date_time["lastday"]) then
743 | somedate_translator("date", seg, -1)
744 | end
745 |
746 | -- 输出前天的日期
747 | if (input == str_date_time["before_lastday"]) then
748 | somedate_translator("date", seg, -2)
749 | end
750 |
751 | -- 输出当前时间
752 | if (input == str_date_time["time"]) then
753 | time_translator("time", seg)
754 | end
755 |
756 | -- 输出本周时间:表示本周的当天时间
757 | if (input == str_date_time["this_week"]) then
758 | date_translator("date", seg)
759 | end
760 |
761 | -- 输出上周时间:表示上周对应星期时间
762 | -- 比如今天是周三,则此函数返回上周周三对应的日期
763 | if (input == str_date_time["last_week"]) then
764 | somedate_translator("date", seg, -7)
765 | end
766 |
767 | -- 输出下周时间:表示上周对应星期时间
768 | -- 比如今天是周三,则此函数返回下周周三对应的日期
769 | if (input == str_date_time["next_week"]) then
770 | somedate_translator("date", seg, 7)
771 | end
772 |
773 | -- 输出本月日期,默认是本月当天日期
774 | if (input == str_date_time["this_month"]) then
775 | date_translator("date", seg)
776 | end
777 |
778 | -- 输出上月与当天天数相同的日期,有末则按最后一天计算
779 | if (input == str_date_time["last_month"]) then
780 | local days_offset = get_month_sameday(false)
781 | somedate_translator("date", seg, -days_offset)
782 | end
783 |
784 | -- 输出下月与当天天数相同的日期,有末则按最后一天计算
785 | if (input == str_date_time["next_month"]) then
786 | local days_offset = get_month_sameday(true)
787 | somedate_translator("date", seg, days_offset)
788 | end
789 | end
790 |
791 | function time_date(input, seg, env)
792 | date_translator(input, seg)
793 | time_translator(input, seg)
794 | week_translator(input, seg)
795 | lunar_translator(input, seg)
796 | Jq_translator(input, seg)
797 | -- longstring_translator(input, seg)
798 | QueryLunar_translator(input, seg)
799 | -- number_translator(input, seg)
800 | set_switch_keywords(input, seg,env)
801 | str2datetime_translator(input, seg)
802 | end
803 |
--------------------------------------------------------------------------------
/squirrel.yaml:
--------------------------------------------------------------------------------
1 | # Squirrel settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | config_version: '0.38'
7 | keyboard_layout: last
8 | chord_duration: 0.1 # seconds
9 | show_notifications_when: appropriate
10 |
11 | style:
12 | color_scheme: poetry_spring
13 | color_scheme_dark: dark_spring
14 | text_orientation: horizontal # horizontal | vertical
15 | inline_preedit: true
16 | corner_radius: 10
17 | hilited_corner_radius: 0
18 | border_height: 0
19 | border_width: 0
20 | # space between candidates in stacked layout
21 | line_spacing: 5
22 | # space between preedit and candidates in non-inline mode
23 | spacing: 10
24 | candidate_format: '%c %@'
25 | # adjust the base line of vertical text
26 | #base_offset: 6
27 | font_face: 'Lucida Grande'
28 | font_point: 21
29 | label_font_face: 'Lucida Grande'
30 | label_font_point: 18
31 | comment_font_face: 'Lucida Grande, 雅黑字根, 黑体字根'
32 | comment_font_point: 18
33 |
34 | preset_color_schemes:
35 | native:
36 | name: 系統配色
37 |
38 | poetry_spring:
39 | name: 诗意之春/Poetry Spring
40 | author: 空山明月
41 | text_color: 0x333333
42 | back_color: 0xe3fbe6
43 | label_color: 0x5c5c5c
44 | candidate_text_color: 0x333333
45 | hilited_text_color: 0x333333
46 | hilited_candidate_label_color: 0xFFFFFF
47 | hilited_candidate_text_color: 0xFFFFFF
48 | hilited_candidate_back_color: 0x35922a
49 | comment_text_color: 0x5c5c5c
50 | hilited_comment_text_color: 0xFFFFFF
51 |
52 | dark_spring:
53 | name: 春夜阑珊/Dark Spring
54 | author: 空山明月
55 | text_color: 0xFFFFFF
56 | back_color: 0x4b4848
57 | label_color: 0xe0e0e0
58 | candidate_text_color: 0xFFFFFF
59 | hilited_text_color: 0xFFFFFF
60 | hilited_candidate_label_color: 0xe0e0e0
61 | hilited_candidate_text_color: 0xFFFFFF
62 | hilited_candidate_back_color: 0x35922a
63 | comment_text_color: 0xe0e0e0
64 | hilited_comment_text_color: 0xe0e0e0
65 |
66 | app_options:
67 | com.apple.Spotlight:
68 | ascii_mode: true
69 | com.alfredapp.Alfred:
70 | ascii_mode: true
71 | com.runningwithcrayons.Alfred-2:
72 | ascii_mode: true
73 | com.blacktree.Quicksilver:
74 | ascii_mode: true
75 | com.apple.Terminal:
76 | ascii_mode: true
77 | no_inline: true
78 | com.googlecode.iterm2:
79 | ascii_mode: true
80 | no_inline: true
81 | org.vim.MacVim:
82 | ascii_mode: true # 初始爲西文模式
83 | no_inline: true # 不使用行內編輯
84 | vim_mode: true # 退出VIM插入模式自動切換輸入法狀態
85 | com.apple.dt.Xcode:
86 | ascii_mode: true
87 | com.barebones.textwrangler:
88 | ascii_mode: true
89 | com.macromates.TextMate.preview:
90 | ascii_mode: true
91 | com.github.atom:
92 | ascii_mode: true
93 | com.microsoft.VSCode:
94 | ascii_mode: true
95 | com.sublimetext.2:
96 | ascii_mode: true
97 | org.gnu.Aquamacs:
98 | ascii_mode: true
99 | org.gnu.Emacs:
100 | ascii_mode: true
101 | no_inline: true
102 | co.zeit.hyper:
103 | ascii_mode: true
104 | com.google.Chrome:
105 | # 規避 https://github.com/rime/squirrel/issues/435
106 | inline: true
107 | ru.keepcoder.Telegram:
108 | # 規避 https://github.com/rime/squirrel/issues/475
109 | inline: true
--------------------------------------------------------------------------------
/symbols.yaml:
--------------------------------------------------------------------------------
1 | # Rime's punctuation and symbols
2 | # encoding: utf-8
3 | #
4 | # Usage: patch your Rime schema to enable /X symbols
5 | # by: 空山明月
6 | # date: 2024-05-27
7 |
8 | config_version: '1.3'
9 |
10 | patch:
11 | punctuator/import_preset: symbols
12 | recognizer/patterns/punct: '^/([0-9]0?|[A-Za-z]+)$'
13 |
14 | punctuator:
15 | full_shape:
16 | ',' : { commit: , }
17 | '.' : { commit: 。 }
18 | '<' : 《
19 | '>' : 》
20 | '/' : 、
21 | '?' : { commit: ? }
22 | ';' : { commit: ; }
23 | ':' : { commit: : }
24 | '''' : { pair: [ '‘', '’' ] }
25 | '"' : { pair: [ '“', '”' ] }
26 | '\' : 、
27 | '|' : |
28 | '`' : ‵
29 | '~' : ~
30 | '!' : { commit: ! }
31 | '@' : '@'
32 | '#' : '#'
33 | '%' : '%'
34 | '$' : ¥
35 | '^' : { commit: …… }
36 | '&' : '&'
37 | '*' : *
38 | '(' : (
39 | ')' : )
40 | '-' : '-'
41 | '_' : ——
42 | '+' : '+'
43 | '=' : '='
44 | '[' : 【
45 | ']' : 】
46 | '{' : {
47 | '}' : }
48 | half_shape:
49 | ',' : { commit: , }
50 | '.' : { commit: 。 }
51 | '<' : 《
52 | '>' : 》
53 | '/' : 、
54 | '?' : { commit: ? }
55 | ';' : { commit: ; }
56 | ':' : { commit: : }
57 | '''' : { pair: [ '‘', '’' ] }
58 | '"' : { pair: [ '“', '”' ] }
59 | '\' : 、
60 | '|' : |
61 | '`' : ‵
62 | '~' : ~
63 | '!' : { commit: ! }
64 | '@' : '@'
65 | '#' : '#'
66 | '%' : '%'
67 | '$' : ¥
68 | '^' : { commit: …… }
69 | '&' : '&'
70 | '*' : *
71 | '(' : (
72 | ')' : )
73 | '-' : '-'
74 | '_' : ——
75 | '+' : '+'
76 | '=' : '='
77 | '[' : 【
78 | ']' : 】
79 | '{' : {
80 | '}' : }
81 | symbols:
82 | #符號、電腦
83 | '/fh': [ ©, ®, ℗, ℠, ™, ℡, ℻, ☇, ☈, ☉, ☊, ☋, ☌, ☍, ☎, ☏, ☐, ☑, ☒, ☓, ☕, ☖, ☗, ⛉, ⛊, ☘, ☙, ☚, ☛, ☜, ☝, ☞, ☟, ☠, ☡, ☢, ☣, ☤, ☥, ☦, ☧, ☨, ☩, ☪, ☫, ☬, ☭, ☮, ☯, ☸, ♨, ♰, ♱, ♲, ♳, ♴, ♵, ♶, ♷, ♸, ♹, ♺, ♻, ♼, ♽, ♾, ♿, ⚆, ⚇, ⚈, ⚉, ⚐, ⚑, ⚒, ⚓, ⚔, ⚕, ⚖, ⚗, ⚘, ⚙, ⚚, ⚛, ⚜, ⚝, ⚞, ⚟, ⚠, ⚡, ⚰, ⚱, ⚲, ⚳, ⚴, ⚵, ⚶, ⚷, ⚸, ⚹, ⚺, ⚻, ⚼, ⚽, ⚾, ⚿, ⛀, ⛁, ⛂, ⛃, ⛋, ⛌, ⛍, ⛎, ⛏, ⛐, ⛑, ⛒, ⛓, ⛔, ⛕, ⛖, ⛗, ⛘, ⛙, ⛚, ⛛, ⛜, ⛝, ⛞, ⛟, ⛠, ⛡, ⛢, ⛣, ⛨, ⛩, ⛪, ⛫, ⛬, ⛭, ⛮, ⛯, ⛰, ⛱, ⛲, ⛳, ⛴, ⛵, ⛶, ⛷, ⛸, ⛹, ⛺, ⛻, ⛼, ⛽, ⛾, ⛿ ]
84 | '/dn': [ , ❖, ⌘, ⌃, ⌥, ⎇, ⇧, ⇪, ␣, ⇥, ⇤, ↩, ⌅, ⌤, ⌫, ⌦, ⌧, ⎋, ⌨, ◁, ⌀, ⌖, ⌗, ⏏, ↖, ↘, ⇞, ⇟, ⌚, ⏰, ⏱, ⏲, ⏳, ⌛, ⌜, ⌝⌞⌟, ⍑, ⏩, ⏪, ⏫, ⏬, ⏭, ⏮, ⏯ ]
85 | #象棋、麻將、色子、撲克
86 | '/xq': [ ♔, ♕, ♖, ♗, ♘, ♙, ♚, ♛, ♜, ♝, ♞, ♟ ]
87 | '/mj': [ 🀀, 🀁, 🀂, 🀃, 🀄, 🀅, 🀆, 🀇, 🀈, 🀉, 🀊, 🀋, 🀌, 🀍, 🀎, 🀏, 🀐, 🀑, 🀒, 🀓, 🀔, 🀕, 🀖, 🀗, 🀘, 🀙, 🀚, 🀛, 🀜, 🀝, 🀞, 🀟, 🀠, 🀡, 🀢, 🀣, 🀤, 🀥, 🀦, 🀧, 🀨, 🀩, 🀪, 🀫 ]
88 | '/sz': [ ⚀, ⚁, ⚂, ⚃, ⚄, ⚅ ]
89 | '/pk': [ ♠, ♥, ♣, ♦, ♤, ♡, ♧, ♢ ]
90 | #表情
91 | '/bq': [ ☻, ☺, ☹ ]
92 | #天氣
93 | '/tq': [ ☀, ☁, ⛅, ⛈, ⛆, ☂, ☔, ☃, ⛄, ⛇ ]
94 | #音樂
95 | '/yy': [ 𝄞, ♩, ♪, ♫, ♬, ♭, ♮, ♯ ]
96 | #兩性
97 | '/lx': [ ♂, ♀, ⚢, ⚣, ⚤, ⚥, ⚦, ⚧, ⚨, ⚩, ⚪, ⚫, ⚬, ⚭, ⚮, ⚯ ]
98 | #八卦、八卦名、六十四卦、六十四卦名、太玄經
99 | '/bg': [ ☰, ☱, ☲, ☳, ☴, ☵, ☶, ☷ ]
100 | '/bgm': [ 乾, 兌, 離, 震, 巽, 坎, 艮, 坤 ]
101 | '/lssg': [ ䷀, ䷁, ䷂, ䷃, ䷄, ䷅, ䷆, ䷇, ䷈, ䷉, ䷊, ䷋, ䷌, ䷍, ䷎, ䷏, ䷐, ䷑, ䷒, ䷓, ䷔, ䷕, ䷖, ䷗, ䷘, ䷙, ䷚, ䷛, ䷜, ䷝, ䷞, ䷟, ䷠, ䷡, ䷢, ䷣, ䷤, ䷥, ䷦, ䷧, ䷨, ䷩, ䷪, ䷫, ䷬, ䷭, ䷮, ䷯, ䷰, ䷱, ䷲, ䷳, ䷴, ䷵, ䷶, ䷷, ䷸, ䷹, ䷺, ䷻, ䷼, ䷽, ䷾, ䷿ ]
102 | '/lssgm': [ 乾, 坤, 屯, 蒙, 需, 訟, 師, 比, 小畜, 履, 泰, 否, 同人, 大有, 謙, 豫, 隨, 蠱, 臨, 觀, 噬嗑, 賁, 剝, 復, 无妄, 大畜, 頤, 大過, 坎, 離, 咸, 恆, 遯, 大壯, 晉, 明夷, 家人, 睽, 蹇, 解, 損, 益, 夬, 姤, 萃, 升, 困, 井, 革, 鼎, 震, 艮, 漸, 歸妹, 豐, 旅, 巽, 兌, 渙, 節, 中孚, 小過, 既濟, 未濟 ]
103 | '/txj': [ ⚊, ⚋, ⚌, ⚍, ⚎, ⚏, 𝌀, 𝌁, 𝌂, 𝌃, 𝌄, 𝌅, 𝌆, 𝌇, 𝌈, 𝌉, 𝌊, 𝌋, 𝌌, 𝌍, 𝌎, 𝌏, 𝌐, 𝌑, 𝌒, 𝌓, 𝌔, 𝌕, 𝌖, 𝌗, 𝌘, 𝌙, 𝌚, 𝌛, 𝌜, 𝌝, 𝌞, 𝌟, 𝌠, 𝌡, 𝌢, 𝌣, 𝌤, 𝌥, 𝌦, 𝌧, 𝌨, 𝌩, 𝌪, 𝌫, 𝌬, 𝌭, 𝌮, 𝌯, 𝌰, 𝌱, 𝌲, 𝌳, 𝌴, 𝌵, 𝌶, 𝌷, 𝌸, 𝌹, 𝌺, 𝌻, 𝌼, 𝌽, 𝌾, 𝌿, 𝍀, 𝍁, 𝍂, 𝍃, 𝍄, 𝍅, 𝍆, 𝍇, 𝍈, 𝍉, 𝍊, 𝍋, 𝍌, 𝍍, 𝍎, 𝍏, 𝍐, 𝍑, 𝍒, 𝍓, 𝍔, 𝍕, 𝍖 ]
104 | #天體、星座、星座名、十二宮
105 | '/tt': [ ☄, ☼, ☽, ☾, ☿, ♀, ♁, ♂, ♃, ♄, ♅, ♆, ♇ ]
106 | '/xz': [ ♈, ♉, ♊, ♋, ♌, ♍, ♎, ♏, ♐, ♑, ♒, ♓ ]
107 | '/xzm': [ 白羊座, 金牛座, 雙子座, 巨蟹座, 獅子座, 室女座, 天秤座, 天蠍座, 人馬座, 摩羯座, 寶瓶座, 雙魚座 ]
108 | '/seg': [ 白羊宮, 金牛宮, 雙子宮, 巨蟹宮, 獅子宮, 室女宮, 天秤宮, 天蠍宮, 人馬宮, 摩羯宮, 寶瓶宮, 雙魚宮 ]
109 | #星號
110 | '/xh': [ ★, ☆, ⛤, ⛥, ⛦, ⛧, ✡, ❋, ❊, ❉, ❈, ❇, ❆, ❅, ❄, ❃, ❂, ❁, ❀, ✿, ✾, ✽, ✼, ✻, ✺, ✹, ✸, ✷, ✶, ✵, ✴, ✳, ✲, ✱, ✰, ✯, ✮, ✭, ✬, ✫, ✪, ✩, ✧, ✦, ✥, ✤, ✣, ✢ ]
111 | #方塊
112 | '/fk': [ ▀, ▁, ▂, ▃, ▄, ▅, ▆, ▇, █, ▉, ▊, ▋, ▌, ▍, ▎, ▏, ▐, ░, ▒, ▓, ▔, ▕, ▖, ▗, ▘, ▙, ▚, ▛, ▜, ▝, ▞, ▟ ]
113 | #幾何
114 | '/jh': [ ■, □, ▢, ▣, ▤, ▥, ▦, ▧, ▨, ▩, ▪, ▫, ▬, ▭, ▮, ▯, ▰, ▱, ▲, △, ▴, ▵, ▶, ▷, ▸, ▹, ►, ▻, ▼, ▽, ▾, ▿, ◀, ◁, ◂, ◃, ◄, ◅, ◆, ◇, ◈, ◉, ◊, ○, ◌, ◍, ◎, ●, ◐, ◑, ◒, ◓, ◔, ◕, ◖, ◗, ◘, ◙, ◚, ◛, ◜, ◝, ◞, ◟, ◠, ◡, ◢, ◣, ◤, ◥, ◦, ◧, ◨, ◩, ◪, ◫, ◬, ◭, ◮, ◯, ◰, ◱, ◲, ◳, ◴, ◵, ◶, ◷, ◸, ◹, ◺, ◻, ◼, ◽, ◾, ◿ ]
115 | #箭頭
116 | '/jt': [ ↑, ↓, ←, →, ↕, ↔, ↖, ↗, ↙, ↘, ↚, ↛, ↮, ↜, ↝, ↞, ↟, ↠, ↡, ↢, ↣, ↤, ↥, ↦, ↧, ↨, ↩, ↪, ↫, ↬, ↭, ↯, ↰, ↱, ↲, ↳, ↴, ↵, ↶, ↷, ↸, ↹, ↺, ↻, ↼, ↽, ↾, ↿, ⇀, ⇁, ⇂, ⇃, ⇄, ⇅, ⇆, ⇇, ⇈, ⇉, ⇊, ⇋, ⇌, ⇐, ⇍, ⇑, ⇒, ⇏, ⇓, ⇔, ⇎, ⇕, ⇖, ⇗, ⇘, ⇙, ⇚, ⇛, ⇜, ⇝, ⇞, ⇟, ⇠, ⇡, ⇢, ⇣, ⇤, ⇥, ⇦, ⇧, ⇨, ⇩, ⇪, ⇫, ⇬, ⇭, ⇮, ⇯, ⇰, ⇱, ⇲, ⇳, ⇴, ⇵, ⇶, ⇷, ⇸, ⇹, ⇺, ⇻, ⇼, ⇽, ➔, ➘, ➙, ➚, ➛, ➜, ➝, ➞, ➟, ➠, ➡, ➢, ➣, ➤, ➥, ➦, ➧, ➨, ➩, ➪, ➫, ➬, ➭, ➮, ➱, ➲, ➳, ➴, ➵, ➶, ➷, ➸, ➹, ➺, ➻, ➼, ➽, ➾ ]
117 | #數學
118 | '/sx': [ ±, ÷, ×, ∈, ∏, ∑, -, +, <, ≮, =, ≠, >, ≯, ∕, √, ∝, ∞, ∟, ∠, ∥, ∧, ∨, ∩, ∪, ∫, ∮, ∴, ∵, ∷, ∽, ≈, ≌, ≒, ≡, ≤, ≥, ≦, ≧, ⊕, ⊙, ⊥, ⊿, ㏑, ㏒ ]
119 | #數字+圈/弧/點
120 | '/szq': [ ⓪, ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩, ⑪, ⑫, ⑬, ⑭, ⑮, ⑯, ⑰, ⑱, ⑲, ⑳, ㉑, ㉒, ㉓, ㉔, ㉕, ㉖, ㉗, ㉘, ㉙, ㉚, ㉛, ㉜, ㉝, ㉞, ㉟, ㊱, ㊲, ㊳, ㊴, ㊵, ㊶, ㊷, ㊸, ㊹, ㊺, ㊻, ㊼, ㊽, ㊾, ㊿, ⓿, ❶, ❷, ❸, ❹, ❺, ❻, ❼, ❽, ❾, ❿, ⓫, ⓬, ⓭, ⓮, ⓯, ⓰, ⓱, ⓲, ⓳, ⓴ ]
121 | '/szh': [ ⑴, ⑵, ⑶, ⑷, ⑸, ⑹, ⑺, ⑻, ⑼, ⑽, ⑾, ⑿, ⒀, ⒁, ⒂, ⒃, ⒄, ⒅, ⒆, ⒇ ]
122 | '/szd': [ ⒈, ⒉, ⒊, ⒋, ⒌, ⒍, ⒎, ⒏, ⒐, ⒑, ⒒, ⒓, ⒔, ⒕, ⒖, ⒗, ⒘, ⒙, ⒚, ⒛ ]
123 | #字母+圈/弧
124 | '/zmq': [ ⓐ, Ⓐ, ⓑ, Ⓑ, ⓒ, Ⓒ, ⓓ, Ⓓ, ⓔ, Ⓔ, ⓕ, Ⓕ, ⓖ, Ⓖ, ⓗ, Ⓗ, ⓘ, Ⓘ, ⓙ, Ⓙ, ⓚ, Ⓚ, ⓛ, Ⓛ, ⓜ, Ⓜ, ⓝ, Ⓝ, ⓞ, Ⓞ, ⓟ, Ⓟ, ⓠ, Ⓠ, ⓡ, Ⓡ, ⓢ, Ⓢ, ⓣ, Ⓣ, ⓤ, Ⓤ, ⓥ, Ⓥ, ⓦ, Ⓦ, ⓧ, Ⓧ, ⓨ, Ⓨ, ⓩ, Ⓩ ]
125 | '/zmh': [ ⒜, ⒝, ⒞, ⒟, ⒠, ⒡, ⒢, ⒣, ⒤, ⒥, ⒦, ⒧, ⒨, ⒩, ⒪, ⒫, ⒬, ⒭, ⒮, ⒯, ⒰, ⒱, ⒲, ⒳, ⒴, ⒵ ]
126 | #數字、分數
127 | '/0': [ 〇, 零, ₀, ⁰, ⓪, ⓿ , 0]
128 | '/1': [ 一, 壹, ₁, ¹, Ⅰ, ⅰ, ①, ➀, ❶, ➊, ⓵, ⑴, ⒈, 1, ㊀, ㈠, 弌, 壱, 幺, ㆒ ]
129 | '/2': [ 二, 貳, ₂, ², Ⅱ, ⅱ, ②, ➁, ❷, ➋, ⓶, ⑵, ⒉, 2, ㊁, ㈡, 弍, 弐, 貮, 㒃, 㒳, 兩, 倆, ㆓]
130 | '/3': [ 三, 叄, ₃, ³, Ⅲ, ⅲ, ③, ➂, ❸, ➌, ⓷, ⑶, ⒊, 3, ㊂, ㈢, 參, 参, 叁, 弎, 仨, ㆔]
131 | '/4': [ 四, 肆, ₄, ⁴, Ⅳ, ⅳ, ④, ➃, ❹, ➍, ⓸, ⑷, ⒋, 4, ㊃, ㈣, 亖]
132 | '/5': [ 五, 伍, ₅, ⁵, Ⅴ, ⅴ, ⑤, ➄, ❺, ➎, ⓹, ⑸, ⒌, 5, ㊄, ㈤, 㐅, 㠪, 𠄡 ]
133 | '/6': [ 六, 陸, ₆, ⁶, Ⅵ, ⅵ, ⑥, ➅, ❻, ➏, ⓺, ⑹, ⒍, 6, ㊅, ㈥, ↅ]
134 | '/7': [ 七, 柒, ₇, ⁷, Ⅶ, ⅶ, ⑦, ➆, ❼, ➐, ⓻, ⑺, ⒎, 7, ㊆, ㈦, 漆]
135 | '/8': [ 八, 捌, ₈, ⁸, Ⅷ, ⅷ, ⑧, ➇, ❽, ➑, ⓼, ⑻, ⒏, 8, ㊇, ㈧ ]
136 | '/9': [ 九, 玖, ₉, ⁹, Ⅸ, ⅸ, ⑨, ➈, ❾, ➒, ⓽, ⑼, ⒐, 9, ㊈, ㈨ ]
137 | '/10': [ 十, 拾, ₁₀, ¹⁰, Ⅹ, ⅹ, ⑩, ➉, ❿, ➓, ⓾, ⑽, ⒑, 10, ㊉, ㈩, 什 ]
138 | '/fs': [ ⅟, ½, ↉, ⅓, ⅔, ¼, ⅕, ⅖, ⅗, ⅘, ⅙, ⅚, ⅐, ⅛, ⅜, ⅝, ⅞, ⅑, ⅒ ]
139 | #蘇州碼
140 | '/szm': [ 〡, 〢, 〣, 〤, 〥, 〦, 〧, 〨, 〩, 〸, 〹, 〺 ]
141 | #羅馬數字
142 | '/lm': [ ⅰ, ⅱ, ⅲ, ⅳ, ⅴ, ⅵ, ⅶ, ⅷ, ⅸ, ⅹ, ⅺ, ⅻ, ⅼ, ⅽ, ⅾ, ⅿ ]
143 | '/lmd': [ Ⅰ, Ⅱ, Ⅲ, Ⅳ, Ⅴ, Ⅵ, Ⅶ, Ⅷ, Ⅸ, Ⅹ, Ⅺ, Ⅻ, Ⅼ, Ⅽ, Ⅾ, Ⅿ ]
144 | #拉丁
145 | '/a': [ā, á, ǎ, à, ȁ, â, ă, ȃ, ȧ, ä, å, ã, ₐ, ᵃ, ª, ⱥ, ꬰ, ả, ą, ạ, ḁ, ẚ, ấ, ầ, ẫ, ẩ, ắ, ằ, ẵ, ẳ, ǡ, ǟ, ǻ, ậ, ặ, ᶏ, ɐ, ᵄ, ɑ, ᵅ, ᶐ, ɒ, ᶛ]
146 | '/A': [Ā, Á, Ǎ, À, Ȁ, Â, Ă, Ȃ, Ȧ, Ä, Å, Ã, ᴀ, ᴬ, Ⱥ, Ả, Ą, Ạ, Ḁ, Ấ, Ầ, Ẫ, Ẩ, Ắ, Ằ, Ẵ, Ẳ, Ǡ, Ǟ, Ǻ, Ậ, Ặ, Ɐ, Ɑ, Ɒ ]
147 | '/b': [ḃ, ḅ, ᵇ, ƀ, ƃ, ḇ, ɓ, ᵬ, ᶀ, ꞗ]
148 | '/B': [Ḃ, Ḅ, ʙ, ᴃ, ᴮ, ᴯ, Ƀ, Ƃ, Ḇ, Ɓ, Ꞗ]
149 | '/c': [ç, ć, č, ĉ, ċ, ᶜ, ȼ, ꞓ, ƈ, ḉ, ꞔ, ɕ, ᶝ, ꜿ]
150 | '/C': [Ç, Ć, Č, Ĉ, Ċ, ᴄ, Ȼ, Ꞓ, Ƈ, Ḉ, Ꜿ]
151 | '/d': [ď, ḋ, ᵈ, đ, ƌ, ᵭ, ḑ, ḓ, ḏ, ḍ, ɖ, ɗ, ᶑ, ᶁ, ð, ᶞ, ꝱ, ʤ, ʣ, ʥ, ȡ, ƍ, dz, dž, ẟ]
152 | '/D': [Ď, Ḋ, ᴅ, ᴆ, ᴰ, Đ, Ƌ, Ḑ, Ḓ, Ḏ, Ḍ, Ɖ, Ɗ, Ð, DZ, Dz, DŽ, Dž ]
153 | '/e': [ē, é, ě, è, ȅ, ê, ĕ, ȇ, ė, ë, ẽ, ₑ, ᵉ, ɇ, ꬳ, ẻ, ȩ, ę, ḙ, ẹ, ḛ, ḗ, ḕ, ế, ề, ễ, ể, ḝ, ệ, ᶒ, ꬴ, ɘ, ə, ɚ, ᶕ, ɛ, ᵋ, ᶓ, ɜ, ᵌ, ᴈ, ᶟ, ɝ, ᶔ, ɞ, ʚ, ǝ, ₔ, ᵊ, ȝ, ⱸ]
154 | '/E': [Ē, É, Ě, È, Ȅ, Ê, Ĕ, Ȇ, Ė, Ë, Ẽ, ᴇ, ᴱ, Ɇ, Ẻ, Ȩ, Ę, Ḙ, Ẹ, Ḛ, Ḗ, Ḕ, Ế, Ề, Ễ, Ể, Ḝ, Ệ, Ə, Ɛ, Ɜ, Ǝ, ⱻ, ᴲ, Ȝ ]
155 | '/f': [ḟ, ᶠ, ƒ, ᵮ, ᶂ, ꞙ ]
156 | '/F': [Ḟ, ꜰ, Ƒ, Ꞙ, ꟻ]
157 | '/g': [ḡ, ǵ, ǧ, ĝ, ğ, ġ, ᵍ, ǥ, ꞡ, ģ, ɠ, ᵷ, ᶃ, ɡ, ꬶ, ᶢ, ɣ, ˠ, ɤ, ᵹ]
158 | '/G': [Ḡ, Ǵ, Ǧ, Ĝ, Ğ, Ġ, ʛ, ᴳ, Ǥ, Ꞡ, Ģ, Ɠ, Ɡ, Ɣ ]
159 | '/h': [ĥ, ȟ, ḣ, ḧ, ͪ, ħ, ɦ, ʱ, ꜧ, ꭜ, ɧ, ḩ, ẖ, ḫ, ḥ, ⱨ, ꞕ, ɥ, ᶣ, ʮ, ʯ, ⱶ]
160 | '/H': [Ĥ, Ȟ, Ḣ, Ḧ, ʜ, ᴴ, Ħ, Ɦ, Ꜧ, Ḩ, Ḫ, Ḥ, Ⱨ, Ɥ, Ⱶ]
161 | '/i': [ī, í, ǐ, ì, ȉ, î, ĭ, ȋ, ï, ĩ, ᵢ, ı, ɨ, ᶤ, ỉ, į, ị, ḭ, ᴉ, ᵎ, ḯ, ᶖ, ɩ, ᶥ, ᵼ]
162 | '/I': [Ī, Í, Ǐ, Ì, Ȉ, Î, Ĭ, Ȋ, Ï, Ĩ, ɪ, ᴵ, ᶦ, Ɨ, ᵻ, ᶧ, Ỉ, Į, Ị, Ḭ, Ḯ, ꟾ, Ɩ ]
163 | '/j': [ĵ, ǰ, ⱼ, ʲ, ɉ, ȷ, ɟ, ᶡ, ʄ, ʝ, ᶨ]
164 | '/J': [Ĵ, ᴊ, ᴶ, Ɉ, Ʝ ]
165 | '/k': [ḱ, ǩ, ₖ, ᵏ, ꝁ, ꝃ, ꞣ, ꝅ, ķ, ḵ, ḳ, ƙ, ᶄ, ⱪ, ʞ, ĸ]
166 | '/K': [Ḱ, Ǩ, ᴋ, ᴷ, Ꝁ, Ꝃ, Ꞣ, Ꝅ, Ķ, Ḵ, Ḳ, Ƙ, Ⱪ, Ʞ ]
167 | '/l': [ĺ, ˡ, ł, ꝉ, ƚ, ⱡ, ɫ, ꭞ, ꬸ, ɬ, ľ, ļ, ḻ, ḽ, ḷ, ŀ, ꝲ, ƛ, ᶅ, ᶪ, ɭ, ᶩ, ḹ, ꬷ, ꭝ, ꬹ, ȴ, ꝇ]
168 | '/L': [Ĺ, ʟ, ᶫ, Ƚ, Ꝉ, Ł, ᴌ, Ⱡ, Ɫ, Ɬ, Ľ, Ļ, Ḻ, Ḽ, Ḷ, Ŀ, Ꝇ]
169 | '/m': [ḿ, ṁ, ᵐ, ₘ, ṃ, ᵯ, ɱ, ᶬ, ꬺ, ᶆ, ꝳ, ɯ, ᵚ, ɰ, ᶭ, ᴟ]
170 | '/M': [Ḿ, Ṁ, ᴍ, ᴹ, Ṃ, Ɱ, Ɯ, ꟽ, ꟿ ]
171 | '/n': [ń, ň, ǹ, ṅ, ñ, ₙ, ⁿ, ɲ, ᶮ, ɳ, ᶯ, ȵ, ƞ, ŋ, ᵑ, ꬻ, ꬼ, ꝴ, ʼn, ꞥ, ņ, ṉ, ṋ, ṇ, ᵰ, ꞑ, ᶇ]
172 | '/N': [Ń, Ň, Ǹ, Ṅ, Ñ, ɴ, ᴺ, ᴻ, ᶰ, Ɲ, Ƞ, Ŋ, Ņ, Ṉ, Ṋ, Ṇ, Ꞑ ]
173 | '/o': [ō, ó, ő, ǒ, ò, ô, ŏ, ȯ, ö, õ, ₒ, ᵒ, º, ɔ, ᵓ, ᶗ, ꬿ, ø, ǫ, ọ, ơ, ɵ, ᶱ, ᴑ, ᴒ, ᴓ, ꝋ, ꝍ, ṓ, ṑ, ố, ồ, ỗ, ổ, ȱ, ȫ, ȭ, ṍ, ṏ, ộ, ǭ, ǿ, ớ, ờ, ỡ, ở, ợ, ɷ, ⱺ, ᴖ, ᵔ, ᴗ, ᵕ]
174 | '/O': [Ō, Ó, Ő, Ǒ, Ò, Ô, Ŏ, Ȯ, Ö, Õ, ᴏ, ᴼ, Ɔ, ᴐ, Ø, Ǫ, Ọ, Ơ, Ɵ, Ꝋ, Ꝍ, Ṓ, Ṑ, Ố, Ồ, Ỗ, Ổ, Ȱ, Ȫ, Ȭ, Ṍ, Ṏ, Ộ, Ǭ, Ǿ, Ớ, Ờ, Ỡ, Ở, Ợ ]
175 | '/p': [ṕ, ṗ, ᵖ, ᵽ, ꝑ, ᵱ, ƥ, ᶈ, ꝓ, ꝕ, ɸ, ᶲ, ⱷ ]
176 | '/P': [Ṕ, Ṗ, ᴘ, ᴾ, Ᵽ, Ꝑ, Ƥ, Ꝓ, Ꝕ, ꟼ]
177 | '/q': [ɋ, ꝗ, ꝙ, ʠ]
178 | '/Q': [Ɋ, Ꝗ, Ꝙ ]
179 | '/r': [ŕ, ř, ȑ, ȓ, ṙ, ᵣ, ɍ, ꞧ, ᵲ, ŗ, ṟ, ṛ, ṝ, ᵳ, ɽ, ᶉ, ꭇ, ꭈ, ꭊ, ꭉ, ꝵ, ꭋ, ꭌ, ɹ, ʴ, ɺ, ɻ, ʵ, ⱹ, ɼ, ʳ, ɾ, ɿ, ꝛ, ꝝ]
180 | '/R': [Ŕ, Ř, Ȑ, Ȓ, Ṙ, ʀ, ᴙ, ᴿ, Ʀ, ꭆ, Ɍ, Ꞧ, Ŗ, Ṟ, Ṛ, Ṝ, Ɽ, ꝶ, ʶ, ʁ, Ꝛ, Ꝝ]
181 | '/s': [ś, ŝ, š, ṡ, ˢ, ʂ, ᶳ, ᵴ, ꞩ, ᶊ, ş, ṣ, ș, ȿ, ṥ, ṧ, ṩ, ʃ, ᶴ, ʆ, ᶘ, ʅ, ƪ, ß, ſ, ẛ, ẜ, ẝ]
182 | '/S': [Ś, Ŝ, Š, Ṡ, ꜱ, Ꞩ, Ş, Ṣ, Ș, Ṥ, Ṧ, Ṩ, Ʃ, ẞ, ]
183 | '/t': [ť, ṫ, ẗ, ᵗ, ₜ, ʈ, þ, ꝥ, ꝧ, ŧ, ⱦ, ţ, ṯ, ṱ, ṭ, ț, ƭ, ᵵ, ƫ, ᶵ, ʇ, ȶ, ꝷ]
184 | '/T': [Ť, Ṫ, ᴛ, ᵀ, Ʈ, Þ, Ꝥ, Ꝧ, Ŧ, Ⱦ, Ţ, Ṯ, Ṱ, Ṭ, Ț, Ƭ, Ʇ ]
185 | '/u': [ū, ú, ű, ǔ, ù, ȕ, û, ŭ, ȗ, ü, ǖ, ǘ, ǚ, ǜ, ů, ũ, ᵤ, ᵘ, ʉ, ᶶ, ủ, ų, ṷ, ụ, ṳ, ṵ, ư, ʊ, ᶷ, ᵿ, ᶙ, ṻ, ṹ, ứ, ừ, ữ, ử, ự, ꭒ, ꭟ, ꝸ, ꭎ, ꭏ, ᴝ, ᵙ, ᴞ]
186 | '/U': [Ū, Ú, Ű, Ǔ, Ù, Ȕ, Û, Ŭ, Ȗ, Ü, Ǖ, Ǘ, Ǚ, Ǜ, Ů, Ũ, ᴜ, ᵁ, ᶸ, Ʉ, Ủ, Ų, Ṷ, Ụ, Ṳ, Ṵ, Ư, Ʊ, Ṻ, Ṹ, Ứ, Ừ, Ữ, Ử, Ự ]
187 | '/v': [ü, ǖ, ǘ, ǚ, ǜ, ṽ, ᵛ, ᵥ, ṿ, ꝟ, ʋ, ᶹ, ᶌ, ⱴ, ⱱ, ỽ, ʌ, ᶺ]
188 | '/V': [Ü, Ǖ, Ǘ, Ǚ, Ǜ, Ṽ, ᴠ, ⱽ, Ṿ, Ꝟ, Ʋ, Ỽ, Ʌ ]
189 | '/w': [ẃ, ẁ, ŵ, ẇ, ẅ, ẘ, ʷ, ẉ, ƿ, ʍ, ⱳ]
190 | '/W': [Ẃ, Ẁ, Ŵ, Ẇ, Ẅ, W̊, ᴡ, ᵂ, Ẉ, Ƿ, Ⱳ]
191 | '/x': [ẋ, ẍ, ᶍ, ˣ, ₓ, ꭖ, ꭗ, ꭘ, ꭙ]
192 | '/X': [Ẋ, Ẍ ]
193 | '/y': [ȳ, ý, ỳ, ŷ, ẏ, ÿ, ẙ, ỹ, ʸ, ɏ, ỷ, ỵ, ƴ, ʎ, ỿ, ꭚ]
194 | '/Y': [Ȳ, Ý, Ỳ, Ŷ, Ẏ, Ÿ, Ỹ, ʏ, Ɏ, Ỷ, Ỵ, Ƴ, Ỿ ]
195 | '/z': [ź, ž, ẑ, ż, ᶻ, ʐ, ᶼ, ʑ, ᶽ, ƶ, ẕ, ẓ, ᵶ, ȥ, ⱬ, ᶎ, ʒ, ᶾ, ǯ, ʓ, ƹ, ƺ, ᶚ, θ, ᶿ, ɀ, ꝣ]
196 | '/Z': [Ź, Ž, Ẑ, Ż, ᴢ, Ƶ, Ẕ, Ẓ, Ȥ, Ⱬ Ʒ, ᴣ, Ǯ, Ƹ, Ɀ, Ꝣ]
197 | '/aa': [ꜳ]
198 | '/AA': [Ꜳ]
199 | '/ae': [æ, ǣ, ǽ, ᵆ, ᴂ]
200 | '/AE': [Æ, Ǣ, Ǽ, ᴭ, ᴁ ]
201 | '/ao': [ꜵ]
202 | '/AO': [Ꜵ]
203 | '/au': [ꜷ]
204 | '/AU': [Ꜷ]
205 | '/av': [ꜹ, ꜻ]
206 | '/AV': [Ꜹ, Ꜻ]
207 | '/ay': [ꜽ]
208 | '/AY': [Ꜽ]
209 | '/db': [ȸ]
210 | '/ff': [ff]
211 | '/ffi': [ffi]
212 | '/ffl': [ffl]
213 | '/fi': [fi]
214 | '/fl': [fl]
215 | '/fn': [ʩ]
216 | '/hv': [ƕ]
217 | '/HV': [Ƕ]
218 | '/ij': [ij]
219 | '/IJ': [IJ]
220 | '/lj': [lj]
221 | '/ll': [ỻ]
222 | '/LL': [Ỻ]
223 | '/ls': [ʪ]
224 | '/lz': [ʫ, ɮ]
225 | '/nj': [nj]
226 | '/Nj': [Nj]
227 | '/NJ': [NJ]
228 | '/oe': [œ, ᴔ]
229 | '/OE': [Œ, ɶ ]
230 | '/oi': [ƣ]
231 | '/OI': [Ƣ]
232 | '/oo': [ꝏ]
233 | '/OO': [Ꝏ]
234 | '/ou': [ȣ ]
235 | '/OU': [Ȣ, ᴽ]
236 | '/qp': [ȹ]
237 | '/Rx': [℞]
238 | '/tc': [ʨ]
239 | '/th': [ᵺ]
240 | '/ts': [ʦ, ʧ]
241 | '/tz': [ꜩ]
242 | '/TZ': [Ꜩ]
243 | '/ue': [ᵫ]
244 | '/vy': [ꝡ]
245 | '/VY': [Ꝡ]
246 | '/ww': [ʬ]
247 | #上標、下標
248 | '/sb': [ ⁰, ¹, ², ³, ⁴, ⁵, ⁶, ⁷, ⁸, ⁹, ˜, ⁺, ⁻, ⁼, ⁽, ⁾, ᴬ, ᵃ, ᵄ, ᵅ, ᶛ, ᴭ, ᵆ, ᴮ, ᴯ, ᵇ, ᵝ, ᶜ, ᵓ, ᶝ, ᴰ, ᵈ, ᶞ, ᵟ, ᴱ, ᵉ, ᴲ, ᵊ, ᵋ, ᶟ, ᵌ, ᶠ, ᶡ, ᶲ, ᵠ, ᴳ, ᵍ, ᶢ, ˠ, ᵞ, ᴴ, ʰ, ᶣ, ʱ, ᴵ, ⁱ, ᶤ, ᵎ, ᶥ, ᴶ, ʲ, ᶨ, ᴷ, ᵏ, ᴸ, ᶫ, ˡ, ᶩ, ᶪ, ᴹ, ᵐ, ᶬ, ᵚ, ᶭ, ᴺ, ᴻ, ⁿ, ᵑ, ᶮ, ᶯ, ᴼ, ᵒ, ᶱ, ᴽ, ᴾ, ᵖ, ᴿ, ʳ, ʶ, ʴ, ʵ, ˢ, ᶴ, ᶳ, ᵀ, ᵗ, ᶵ, ᶿ, ᵁ, ᵘ, ᶶ, ᶷ, ᵙ, ⱽ, ᵛ, ᶺ, ᶹ, ᵂ, ʷ, ˣ, ᵡ, ʸ, ᶻ, ᶾ, ᶽ, ᶼ ]
249 | '/xb': [ ₀, ₁, ₂, ₃, ₄, ₅, ₆, ₇, ₈, ₉, ₊, ₋, ₌, ₍, ₎, ‸, ᴀ, ₐ, ᴁ, ʙ, ᴃ, ᵦ, ᴄ, ᴐ, ᴒ, ᴅ, ᴆ, ᴇ, ₑ, ₔ, ᵩ, ɢ, ʛ, ᴦ, ᵧ, ʜ, ₕ, ɪ, ᵻ, ᵢ, ᴊ, ⱼ, ᴋ, ₖ, ʟ, ₗ, ᴌ, ᴧ, ᴍ, ₘ, ꟺ, ɴ, ᴎ, ₙ, ᴏ, ₒ, ɶ, ʘ, ᴓ, ᴑ, ᴘ, ₚ, ᴨ, ᴪ, ʀ, ᵣ, ᴙ, ʁ, ᴚ, ᵨ, ₛ, ᴛ, ₜ, ᴜ, ᵤ, ᵾ, ᴠ, ᵥ, ᴡ, ₓ, ᵪ, ʏ, ᴢ, ᴣ ]
250 | #希臘
251 | '/xl': [ α, β, γ, δ, ε, ζ, η, θ, ι, κ, λ, μ, ν, ξ, ο, π, ρ, σ, ς, τ, υ, φ, χ, ψ, ω ]
252 | '/xld': [ Α, Β, Γ, Δ, Ε, Ζ, Η, Θ, Ι, Κ, Λ, Μ, Ν, Ξ, Ο, Π, Ρ, Σ, Τ, Υ, Φ, Χ, Ψ, Ω ]
253 | #俄語
254 | '/ey': [ а, б, в, г, д, е, ё, ж, з, и, й, к, л, м, н, о, п, р, с, т, у, ф, х, ц, ч, ш, щ, ъ, ы, ь, э, ю, я ]
255 | '/eyd': [ А, Б, В, Г, Д, Е, Ё, Ж, З, И, Й, К, Л, М, Н, О, П, Р, С, Т, У, Ф, Х, Ц, Ч, Ш, Щ, Ъ, Ы, Ь, Э, Ю, Я ]
256 | #月份、日期、曜日等
257 | '/yf': [ ㋀, ㋁, ㋂, ㋃, ㋄, ㋅, ㋆, ㋇, ㋈, ㋉, ㋊, ㋋ ]
258 | '/rq': [ ㏠, ㏡, ㏢, ㏣, ㏤, ㏥, ㏦, ㏧, ㏨, ㏩, ㏪, ㏫, ㏬, ㏭, ㏮, ㏯, ㏰, ㏱, ㏲, ㏳, ㏴, ㏵, ㏶, ㏷, ㏸, ㏹, ㏺, ㏻, ㏼, ㏽, ㏾ ]
259 | '/yr': [ 月, 火, 水, 木, 金, 土, 日, ㊊, ㊋, ㊌, ㊍, ㊎, ㊏, ㊐, ㊗, ㊡, ㈪, ㈫, ㈬, ㈭, ㈮, ㈯, ㈰, ㈷, ㉁, ㉀ ]
260 | #時間
261 | '/sj': [ ㍘, ㍙, ㍚, ㍛, ㍜, ㍝, ㍞, ㍟, ㍠, ㍡, ㍢, ㍣, ㍤, ㍥, ㍦, ㍧, ㍨, ㍩, ㍪, ㍫, ㍬, ㍭, ㍮, ㍯, ㍰ ]
262 | #天干、地支、干支
263 | '/tg': [ 甲, 乙, 丙, 丁, 戊, 己, 庚, 辛, 壬, 癸 ]
264 | '/dz': [ 子, 丑, 寅, 卯, 辰, 巳, 午, 未, 申, 酉, 戌, 亥 ]
265 | '/gz': [ 甲子, 乙丑, 丙寅, 丁卯, 戊辰, 己巳, 庚午, 辛未, 壬申, 癸酉, 甲戌, 乙亥, 丙子, 丁丑, 戊寅, 己卯, 庚辰, 辛巳, 壬午, 癸未, 甲申, 乙酉, 丙戌, 丁亥, 戊子, 己丑, 庚寅, 辛卯, 壬辰, 癸巳, 甲午, 乙未, 丙申, 丁酉, 戊戌, 己亥, 庚子, 辛丑, 壬寅, 癸卯, 甲辰, 乙巳, 丙午, 丁未, 戊申, 己酉, 庚戌, 辛亥, 壬子, 癸丑, 甲寅, 乙卯, 丙辰, 丁巳, 戊午, 己未, 庚申, 辛酉, 壬戌, 癸亥 ]
266 | #節氣
267 | '/jq': [ 立春, 雨水, 驚蟄, 春分, 清明, 穀雨, 立夏, 小滿, 芒種, 夏至, 小暑, 大暑, 立秋, 處暑, 白露, 秋分, 寒露, 霜降, 立冬, 小雪, 大雪, 冬至, 小寒, 大寒 ]
268 | #單位
269 | '/dw': [ Å, ℃, %, ‰, ‱, °, ℉, ㏃, ㏆, ㎈, ㏄, ㏅, ㎝, ㎠, ㎤, ㏈, ㎗, ㎙, ㎓, ㎬, ㏉, ㏊, ㏋, ㎐, ㏌, ㎄, ㎅, ㎉, ㎏, ㎑, ㏍, ㎘, ㎞, ㏎, ㎢, ㎦, ㎪, ㏏, ㎸, ㎾, ㏀, ㏐, ㏓, ㎧, ㎨, ㎡, ㎥, ㎃, ㏔, ㎆, ㎎, ㎒, ㏕, ㎖, ㎜, ㎟, ㎣, ㏖, ㎫, ㎳, ㎷, ㎹, ㎽, ㎿, ㏁, ㎁, ㎋, ㎚, ㎱, ㎵, ㎻, ㏘, ㎩, ㎀, ㎊, ㏗, ㏙, ㏚, ㎰, ㎴, ㎺, ㎭, ㎮, ㎯, ㏛, ㏜, ㎔, ㏝, ㎂, ㎌, ㎍, ㎕, ㎛, ㎲, ㎶, ㎼ ]
270 | #貨幣
271 | '/hb': [ ¥, ¥, ¤, ¢, $, $, £, £, ৳, ฿, ₠, ₡, ₢, ₣, ₤, ₥, ₦, ₧, ₩, ₪, ₫, €, ₭, ₮, ₯, ₰, ₱, ₲, ₳, ₴, ₵, ₶, ₷, ₸, ₹, ₺, ₨, ﷼ ]
272 | #結構、偏旁、康熙(部首)、筆畫、標點
273 | '/jg': [ ⿰, ⿱, ⿲, ⿳, ⿴, ⿵, ⿶, ⿷, ⿸, ⿹, ⿺, ⿻, 〾 ]
274 | '/pp': [ 乛, 冫, 丷, 龹, ⺌, 龸, 亻, 亼, 亽, 仒, 冖, 冂, 冃, 冄, 宀, 罒, 㓁, 罓, 冈, 凵, 厶, 刂, 勹, 匚, 匸, 卩, 阝, 厂, 丆, 广, 壬, 訁, 讠, 釒, 钅, 飠, 饣, 龺, 攵, 夂, 夊, 尢, 尣, 兂, 旡, 巜, 巛, 彐, 彑, 彡, 彳, 龰, 辶, 廴, 㞢, 忄, 㣺, 扌, 爫, 龵, 廾, 歺, 癶, 氵, 氺, 火, 灬, 爿, 丬, 疒, 牜, ⺶, 犭, 豕, 豸, 虍, 艹, 卝, 龷, 丗, 龶, 芈, 丵, 菐, 黹, 礻, 衤, 糸, 糹, 纟, 龻, 镸, 髟, 襾, 覀, 吅, 㗊, 㠭, 㸚, 叕]
275 | '/kx': [ 一, 丨, 丶, 丿, 乙, 亅, 二, 亠, 人, 儿, 入, 八, 冂, 冖, 冫, 几, 凵, 刀, 力, 勹, 匕, 匚, 匸, 十, 卜, 卩, 厂, 厶, 又, 口, 囗, 土, 士, 夂, 夊, 夕, 大, 女, 子, 宀, 寸, 小, 尢, 尸, 屮, 山, 巛, 工, 己, 巾, 干, 幺, 广, 廴, 廾, 弋, 弓, 彐, 彡, 彳, 心, 戈, 戶, 手, 支, 攴, 文, 斗, 斤, 方, 无, 日, 曰, 月, 木, 欠, 止, 歹, 殳, 毋, 比, 毛, 氏, 气, 水, 火, 爪, 父, 爻, 爿, 片, 牙, 牛, 犬, 玄, 玉, 瓜, 瓦, 甘, 生, 用, 田, 疋, 疒, 癶, 白, 皮, 皿, 目, 矛, 矢, 石, 示, 禸, 禾, 穴, 立, 竹, 米, 糸, 缶, 网, 羊, 羽, 老, 而, 耒, 耳, 聿, 肉, 臣, 自, 至, 臼, 舌, 舛, 舟, 艮, 色, 艸, 虍, 虫, 血, 行, 衣, 襾, 見, 角, 言, 谷, 豆, 豕, 豸, 貝, 赤, 走, 足, 身, 車, 辛, 辰, 辵, 邑, 酉, 釆, 里, 金, 長, 門, 阜, 隶, 隹, 雨, 靑, 非, 面, 革, 韋, 韭, 音, 頁, 風, 飛, 食, 首, 香, 馬, 骨, 高, 髟, 鬥, 鬯, 鬲, 鬼, 魚, 鳥, 鹵, 鹿, 麥, 麻, 黃, 黍, 黑, 黹, 黽, 鼎, 鼓, 鼠, 鼻, 齊, 齒, 龍, 龜, 龠 ]
276 | '/bh': [ ㇀, ㇁, ㇂, ㇃, ㇄, ㇅, ㇆, ㇇, ㇈, ㇉, ㇊, ㇋, ㇌, ㇍, ㇎, ㇏, ㇐, ㇑, ㇒, ㇓, ㇔, ㇕, ㇖, ㇗, ㇘, ㇙, ㇚, ㇛, ㇜, ㇝, ㇞, ㇟, ㇠, ㇡, ㇢, ㇣ ]
277 | '/bd': [ 、, 。, 「, 」, 『, 』, 【, 】, 〈, 〉, 《, 》, ₋, ⁻, ―, ˗, ˉ, _, ﹍, ﹎, ., ¡, ‼, ⁉, ¿, ؟, ⁈, ⁇, 、, 。, 〃, 〄, 々, 〆, 〇, 〒, 〓, 〔, 〕, 〖, 〗, 〘, 〙, 〚, 〛, 〜, 〝, 〞, 〟, 〠, 〰, 〱, 〲, 〳, 〴, 〵, 〶, 〷, 〻, 〼, 〽 ]
278 | '/bdz': [ ﹅, ﹆, ﹁, ﹂, ﹃, ﹄, ︙, ︱, ︻, ︼, ︗, ︘, ︵, ︶, ︷, ︸, ︹, ︺, ︿, ﹀, ︽, ︾, ︰, ︲, ︳, ︴, ﹉, ﹊, ﹋, ﹌, ﹍, ﹎, ﹏, ﹇, ﹈, ︐, ︑, ︒, ︔, ︕, ︖ ]
279 | #拼音、註音、聲調
280 | '/py': [ ā, á, ǎ, à, ō, ó, ǒ, ò, ê, ê̄, ế, ê̌, ề, ē, é, ě, è, ī, í, ǐ, ì, ū, ú, ǔ, ù, ü, ǖ, ǘ, ǚ, ǜ, ḿ, m̀, ń, ň, ǹ, ẑ, ĉ, ŝ, ŋ ]
281 | '/pyd': [ Ā, Á, Ǎ, À, Ō, Ó, Ǒ, Ò, Ê, Ê̄, Ế, Ê̌, Ề, Ē, É, Ě, È, Ī, Í, Ǐ, Ì, Ū, Ú, Ǔ, Ù, Ü, Ǖ, Ǘ, Ǚ, Ǜ, Ḿ, M̀, Ń, Ň, Ǹ, Ẑ, Ĉ, Ŝ, Ŋ ]
282 | '/zy': [ ㄅ, ㄆ, ㄇ, ㄈ, ㄉ, ㄊ, ㄋ, ㄌ, ㄍ, ㄎ, ㄏ, ㄐ, ㄑ, ㄒ, ㄓ, ㄔ, ㄕ, ㄖ, ㄗ, ㄘ, ㄙ, ㄧ, ㄨ, ㄩ, ㄚ, ㄛ, ㄜ, ㄝ, ㄞ, ㄟ, ㄠ, ㄡ, ㄢ, ㄣ, ㄤ, ㄥ, ㄦ, ㄪ, ㄫ, ㄬ, ㄭ, ㆠ, ㆡ, ㆢ, ㆣ, ㆤ, ㆥ, ㆦ, ㆧ, ㆨ, ㆩ, ㆪ, ㆫ, ㆬ, ㆭ, ㆮ, ㆯ, ㆰ, ㆱ, ㆲ, ㆳ, ㆴ, ㆵ, ㆶ, ㆷ ]
283 | '/sd': [ ˉ, ˊ, ˇ, ˋ, ˆ, ˙, ˜, ˥, ˦, ˧, ˨, ˩, ꜀, ꜁, ꜂, ꜃, ꜄, ꜅, ꜆, ꜇ ]
284 | #漢字+圈/弧
285 | '/hzq': [ ㊀, ㊁, ㊂, ㊃, ㊄, ㊅, ㊆, ㊇, ㊈, ㊉, ㊊, ㊋, ㊌, ㊍, ㊎, ㊏, ㊐, ㊑, ㊒, ㊓, ㊔, ㊕, ㊖, ㊗, ㊘, ㊙, ㊚, ㊛, ㊜, ㊝, ㊞, ㊟, ㊠, ㊡, ㊢, ㊣, ㊤, ㊥, ㊦, ㊧, ㊨, ㊩, ㊪, ㊫, ㊬, ㊭, ㊮, ㊯, ㊰, ㉄, ㉅, ㉆, ㉇ ]
286 | '/hzh': [ ㈠, ㈡, ㈢, ㈣, ㈤, ㈥, ㈦, ㈧, ㈨, ㈩, ㈪, ㈫, ㈬, ㈭, ㈮, ㈯, ㈰, ㈱, ㈲, ㈳, ㈴, ㈵, ㈶, ㈷, ㈸, ㈹, ㈺, ㈻, ㈼, ㈽, ㈾, ㈿, ㉀, ㉁, ㉂, ㉃ ]
287 | #いろは順
288 | '/iro': [ い, ろ, は, に, ほ, へ, と, ち, り, ぬ, る, を, わ, か, よ, た, れ, そ, つ, ね, な, ら, む, う, ゐ, の, お, く, や, ま, け, ふ, こ, え, て, あ, さ, き, ゆ, め, み, し, ゑ, ひ, も, せ, す ]
289 | #假名
290 | '/jm': [ あ, ぁ, い, ぃ, う, ぅ, え, ぇ, お, ぉ, か, ゕ, が, き, ぎ, く, ぐ, け, ゖ, げ, こ, ご, さ, ざ, し, じ, す, ず, せ, ぜ, そ, ぞ, た, だ, ち, ぢ, つ, っ, づ, て, で, と, ど, な, に, ぬ, ね, の, は, ば, ぱ, ひ, び, ぴ, ふ, ぶ, ぷ, へ, べ, ぺ, ほ, ぼ, ぽ, ま, み, む, め, も, や, ゃ, ゆ, ゅ, よ, ょ, ら, り, る, れ, ろ, わ, ゎ, ゐ, ゔ, ゑ, を, ん, ・, ー, ゝ, ゞ, ゟ ]
291 | '/pjm': [ ア, ァ, イ, ィ, ウ, ゥ, エ, ェ, オ, ォ, カ, ヵ, ガ, キ, ギ, ク, グ, ケ, ヶ, ゲ, コ, ゴ, サ, ザ, シ, ジ, ス, ズ, セ, ゼ, ソ, ゾ, タ, ダ, チ, ヂ, ツ, ッ, ヅ, テ, デ, ト, ド, ナ, ニ, ヌ, ネ, ノ, ハ, バ, パ, ヒ, ビ, ピ, フ, ブ, プ, ヘ, ベ, ペ, ホ, ボ, ポ, マ, ミ, ム, メ, モ, ヤ, ャ, ユ, ュ, ヨ, ョ, ラ, リ, ル, レ, ロ, ワ, ヮ, ヰ, ヸ, ヴ, ヱ, ヹ, ヲ, ヺ, ン, ・, ー, ヽ, ヾ, ヿ, ㇰ, ㇱ, ㇲ, ㇳ, ㇴ, ㇵ, ㇶ, ㇷ, ㇸ, ㇹ, ㇺ, ㇻ, ㇼ, ㇽ, ㇾ, ㇿ ]
292 | '/jmk': [ か, ゕ, き, く, け, ゖ, こ, カ, ヵ, キ, ク, ケ, ヶ, コ ]
293 | '/jmg': [ が, ぎ, ぐ, げ, ご, ガ, ギ, グ, ゲ, ゴ ]
294 | '/jms': [ さ, し, す, せ, そ, サ, シ, ス, セ, ソ ]
295 | '/jmz': [ ざ, じ, ず, ぜ, ぞ, ザ, ジ, ズ, ゼ, ゾ ]
296 | '/jmt': [ た, ち, つ, っ, て, と, タ, チ, ツ, ッ, テ, ト ]
297 | '/jmd': [ だ, ぢ, づ, で, ど, ダ, ヂ, ヅ, デ, ド ]
298 | '/jmn': [ な, に, ぬ, ね, の, ん, ナ, ニ, ヌ, ネ, ノ, ン ]
299 | '/jmh': [ は, ひ, ふ, へ, ほ, ハ, ヒ, フ, ヘ, ホ ]
300 | '/jmb': [ ば, び, ぶ, べ, ぼ, バ, ビ, ブ, ベ, ボ ]
301 | '/jmp': [ ぱ, ぴ, ぷ, ぺ, ぽ, パ, ピ, プ, ペ, ポ ]
302 | '/jmm': [ ま, み, む, め, も, マ, ミ, ム, メ, モ ]
303 | '/jmy': [ や, ゃ, ゆ, ゅ, よ, ょ, ヤ, ャ, ユ, ュ, ヨ, ョ ]
304 | '/jmr': [ ら, り, る, れ, ろ, ラ, リ, ル, レ, ロ ]
305 | '/jmw': [ わ, ゐ, ゑ, を, ワ, ヰ, ヱ, ヲ ]
306 | '/jma': [ あ, か, が, さ, ざ, た, だ, な, は, ば, ぱ, ま, や, ら, わ, ア, カ, ガ, サ, ザ, タ, ダ, ナ, ハ, バ, パ, マ, ヤ, ラ, ワ ]
307 | '/jmi': [ い, き, ぎ, し, じ, ち, ぢ, に, ひ, び, ぴ, み, り, ゐ, イ, キ, ギ, シ, ジ, チ, ヂ, ニ, ヒ, ビ, ピ, ミ, リ, ヰ ]
308 | '/jmu': [ う, く, ぐ, す, ず, つ, づ, ぬ, ふ, ぶ, ぷ, む, る, ウ, ク, グ, ス, ズ, ツ, ヅ, ヌ, フ, ブ, プ, ム, ル ]
309 | '/jme': [ え, け, げ, せ, ぜ, て, で, ね, へ, べ, ぺ, め, れ, ゑ, エ, ケ, ゲ, セ, ゼ, テ, デ, ネ, ヘ, ベ, ペ, メ, レ, ヱ ]
310 | '/jmo': [ お, こ, ご, そ, ぞ, と, ど, の, ほ, ぼ, ぽ, も, ろ, を, オ, コ, ゴ, ソ, ゾ, ト, ド, ノ, ホ, ボ, ポ, モ, ロ, ヲ ]
311 | #假名+圈
312 | '/jmq': [ ㋐, ㋑, ㋒, ㋓, ㋔, ㋕, ㋖, ㋗, ㋘, ㋙, ㋚, ㋛, ㋜, ㋝, ㋞, ㋟, ㋠, ㋡, ㋢, ㋣, ㋤, ㋥, ㋦, ㋧, ㋨, ㋩, ㋪, ㋫, ㋬, ㋭, ㋮, ㋯, ㋰, ㋱, ㋲, ㋳, ㋴, ㋵, ㋶, ㋷, ㋸, ㋹, ㋺, ㋻, ㋼, ㋽, ㋾ ]
313 | #假名+半角
314 | '/jmbj': [ ア, ァ, イ, ィ, ウ, ゥ, エ, ェ, オ, ォ, カ, キ, ク, ケ, コ, サ, シ, ス, セ, ソ, タ, チ, ツ, ッ, テ, ト, ナ, ニ, ヌ, ネ, ノ, ハ, ヒ, フ, ヘ, ホ, マ, ミ, ム, メ, モ, ヤ, ャ, ユ, ュ, ヨ, ョ, ラ, リ, ル, レ, ロ, ワ, ヲ, ン, ・, ー, ゙, ゚ ]
315 | #韓文
316 | '/hw': [ ㄱ, ㄴ, ㄷ, ㄹ, ㅁ, ㅂ, ㅅ, ㅇ, ㅈ, ㅊ, ㅋ, ㅌ, ㅍ, ㅎ ]
317 | #韓文+圈/弧
318 | '/hwq': [ ㉠, ㉡, ㉢, ㉣, ㉤, ㉥, ㉦, ㉧, ㉨, ㉩, ㉪, ㉫, ㉬, ㉭, ㉮, ㉯, ㉰, ㉱, ㉲, ㉳, ㉴, ㉵, ㉶, ㉷, ㉸, ㉹, ㉺, ㉻, ㉼, ㉽, ㉾, ㉿ ]
319 | '/hwh': [ ㈀, ㈁, ㈂, ㈃, ㈄, ㈅, ㈆, ㈇, ㈈, ㈉, ㈊, ㈋, ㈌, ㈍, ㈎, ㈏, ㈐, ㈑, ㈒, ㈓, ㈔, ㈕, ㈖, ㈗, ㈘, ㈙, ㈚, ㈛, ㈜, ㈝, ㈞ ]
320 |
--------------------------------------------------------------------------------
/tables/06/squirrel.yaml:
--------------------------------------------------------------------------------
1 | # Squirrel settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | config_version: '0.38'
7 | keyboard_layout: last
8 | chord_duration: 0.1 # seconds
9 | show_notifications_when: appropriate
10 |
11 | style:
12 | color_scheme: poetry_plum
13 | color_scheme_dark: dark_plum
14 | text_orientation: horizontal # horizontal | vertical
15 | inline_preedit: true
16 | corner_radius: 10
17 | hilited_corner_radius: 0
18 | border_height: 0
19 | border_width: 0
20 | # space between candidates in stacked layout
21 | line_spacing: 5
22 | # space between preedit and candidates in non-inline mode
23 | spacing: 10
24 | candidate_format: '%c %@'
25 | # adjust the base line of vertical text
26 | #base_offset: 6
27 | font_face: 'Lucida Grande'
28 | font_point: 21
29 | label_font_face: 'Lucida Grande'
30 | label_font_point: 18
31 | comment_font_face: 'Lucida Grande, 雅黑字根, 黑体字根'
32 | comment_font_point: 18
33 |
34 | preset_color_schemes:
35 | native:
36 | name: 系統配色
37 |
38 | poetry_plum:
39 | name: 诗意之梅/Poetry Plum
40 | author: 空山明月
41 | text_color: 0x333333
42 | back_color: 0xF5EEFC
43 | label_color: 0x333333
44 | candidate_text_color: 0x333333
45 | hilited_text_color: 0x333333
46 | hilited_candidate_label_color: 0xFFFFFF
47 | hilited_candidate_text_color: 0xFFFFFF
48 | hilited_candidate_back_color: 0x4926bb
49 | comment_text_color: 0x333333
50 | hilited_comment_text_color: 0xFFFFFF
51 |
52 | dark_plum:
53 | name: 夜梅来香/Dark Plum
54 | author: 空山明月
55 | text_color: 0xFFFFFF
56 | back_color: 0x4b4848
57 | label_color: 0xe0e0e0
58 | candidate_text_color: 0xFFFFFF
59 | hilited_text_color: 0xFFFFFF
60 | hilited_candidate_label_color: 0xe0e0e0
61 | hilited_candidate_text_color: 0xFFFFFF
62 | hilited_candidate_back_color: 0x4926bb
63 | comment_text_color: 0xe0e0e0
64 | hilited_comment_text_color: 0xe0e0e0
65 |
66 | app_options:
67 | com.apple.Spotlight:
68 | ascii_mode: true
69 | com.alfredapp.Alfred:
70 | ascii_mode: true
71 | com.runningwithcrayons.Alfred-2:
72 | ascii_mode: true
73 | com.blacktree.Quicksilver:
74 | ascii_mode: true
75 | com.apple.Terminal:
76 | ascii_mode: true
77 | no_inline: true
78 | com.googlecode.iterm2:
79 | ascii_mode: true
80 | no_inline: true
81 | org.vim.MacVim:
82 | ascii_mode: true # 初始爲西文模式
83 | no_inline: true # 不使用行內編輯
84 | vim_mode: true # 退出VIM插入模式自動切換輸入法狀態
85 | com.apple.dt.Xcode:
86 | ascii_mode: true
87 | com.barebones.textwrangler:
88 | ascii_mode: true
89 | com.macromates.TextMate.preview:
90 | ascii_mode: true
91 | com.github.atom:
92 | ascii_mode: true
93 | com.microsoft.VSCode:
94 | ascii_mode: true
95 | com.sublimetext.2:
96 | ascii_mode: true
97 | org.gnu.Aquamacs:
98 | ascii_mode: true
99 | org.gnu.Emacs:
100 | ascii_mode: true
101 | no_inline: true
102 | co.zeit.hyper:
103 | ascii_mode: true
104 | com.google.Chrome:
105 | # 規避 https://github.com/rime/squirrel/issues/435
106 | inline: true
107 | ru.keepcoder.Telegram:
108 | # 規避 https://github.com/rime/squirrel/issues/475
109 | inline: true
--------------------------------------------------------------------------------
/tables/06/weasel.custom.yaml:
--------------------------------------------------------------------------------
1 | # weasel custom settings
2 | # encoding: utf-8
3 | # date: 2024-05-27
4 |
5 | patch:
6 | "style/color_scheme": poetry_plum # 日间主题
7 | "style/color_scheme_dark": dark_plum # 夜间主题
--------------------------------------------------------------------------------
/tables/06/weasel.yaml:
--------------------------------------------------------------------------------
1 | # Weasel settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | config_version: "0.26"
7 |
8 | ### 样式
9 | style:
10 | # ...外观...
11 | color_scheme: poetry_plum # 日间主题
12 | color_scheme_dark: dark_plum # 夜间主题
13 | # ...字体...
14 | font_face: Microsoft YaHei # 全局字体
15 | label_font_face: Microsoft YaHei # 标签字体
16 | comment_font_face: 黑体字根 # 注释字体
17 | font_point: 15 # 全局字号
18 | label_font_point: 13 # 标签字号
19 | comment_font_point: 13 # 注释字号
20 | # ... 窗口...
21 | fullscreen: false # 是否全屏模式
22 | horizontal: false # 是否横向布局
23 | vertical_text: true # 是否启用竖排文本
24 | vertical_text_left_to_right: true # 竖排方向是否从左到右
25 | vertical_text_with_wrap: false # 文本竖排模式下是否自动换行
26 | vertical_auto_reverse: false # 文本竖排模式下,候选窗口位于光标上方时倒序排序
27 | # ...预编辑区...
28 | inline_preedit: true # 是否在行内显示预编辑区
29 | preedit_type: composition # 预编辑区显示内容 composition(编码);preview(高亮候选);preview_all(全部候选)
30 | # ...其他选项...
31 | label_format: "%s" # 标签字符号
32 | mark_text: "" # 候选项前的标记符号
33 | ascii_tip_follow_cursor: false # 切换 ASCII 模式时,提示跟随鼠标,而非输入光标
34 | enhanced_position: false # 无法定位候选框时,在窗口左上角显示候选框
35 | display_tray_icon: false # 托盘显示独立于语言栏的额外图标
36 | antialias_mode: default # antialias_mode (default;force_dword;cleartype;grayscale;aliased)
37 | candidate_abbreviate_length: 20 # 候选项略写,超过此数字则用省略号代替。设置为 0 则不启用此功能
38 | paging_on_scroll: false # 在候选窗口上滑动滚轮的行为:true(翻页);false(选中下一个候选)
39 | click_to_capture: true # 鼠标点击候选项,创建截图
40 | ### 布局
41 | layout:
42 | align_type: center # 标签、候选文字、注解文字之间的相对对齐方式 (top ; center ; bottom)
43 | max_height: 0 # 候选框最大高度,0 不启用此功能
44 | max_width: 0 # 候选框最大宽度,0 不启用此功能
45 | min_height: 0 # 候选框最小高度
46 | min_width: 0 # 候选框最小宽度
47 | border_width: 0 # 边框宽度
48 | margin_x: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
49 | margin_y: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
50 | spacing: 5 # inline_preedit 为 false 时,编码区域和候选区域的间距
51 | candidate_spacing: 8 # 候选项之间的间距
52 | hilite_spacing: 8 # 候选项和相应标签的间距,候选项与注解文字之间的距离
53 | hilite_padding: 8 # 高亮区域和内部文字的间距,影响高亮区域大小
54 | shadow_radius: 8 # 阴影区域半径,为 0 不显示阴影;需要同时在配色方案中指定非透明的阴影颜色
55 | shadow_offset_x: 2 # 阴影绘制的偏离距离
56 | shadow_offset_y: 2 # 阴影绘制的偏离距离
57 | corner_radius: 13 # 候选窗口圆角半径
58 | round_corner: 13 # 候选背景色块圆角半径,别名 hilited_corner_radius
59 |
60 | preset_color_schemes:
61 | poetry_plum:
62 | name: 诗意之梅/Poetry Plum
63 | author: 空山明月
64 | text_color: 0x333333 # 默认文字颜色
65 | comment_text_color: 0x5c5c5c # 注释文字颜色
66 | label_color: 0x333333 # 标签文字颜色
67 | back_color: 0xF5EEFC # 候选窗背景色
68 | shadow_color: 0x66000000 # 候选窗阴影色
69 | border_color: 0xFFFFFF # 候选窗边框颜色
70 | hilited_text_color: 0x000000 # 编码文字颜色
71 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
72 | # hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
73 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
74 | hilited_candidate_back_color: 0x4926bb # 高亮候选背景颜色
75 | hilited_label_color: 0xFFFFFF # 高亮候选的标签颜色
76 | # hilited_mark_color: 0x000000 # 高亮候选前的标记颜色
77 | hilited_comment_text_color: 0xFFFFFF # 高亮候选的注释颜色
78 | candidate_text_color: 0x333333 # 非高亮候选文字颜色
79 | candidate_back_color: 0xF5EEFC # 非高亮候选背景颜色
80 | # candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
81 |
82 | dark_plum:
83 | name: 夜梅来香/Dark Plum
84 | author: 空山明月
85 | text_color: 0xFFFFFF # 默认文字颜色
86 | comment_text_color: 0xe0e0e0 # 注释文字颜色
87 | label_color: 0xe0e0e0 # 标签文字颜色
88 | back_color: 0x4b4848 # 候选窗背景色
89 | shadow_color: 0x66000000 # 候选窗阴影色
90 | border_color: 0x4b4848 # 候选窗边框颜色
91 | hilited_text_color: 0xFFFFFF # 编码文字颜色
92 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
93 | # hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
94 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
95 | hilited_candidate_back_color: 0x4926bb # 高亮候选背景颜色
96 | hilited_label_color: 0xe0e0e0 # 高亮候选的标签颜色
97 | # hilited_mark_color: 0xFFFFFF # 高亮候选前的标记颜色
98 | hilited_comment_text_color: 0xe0e0e0 # 高亮候选的注释颜色
99 | candidate_text_color: 0xFFFFFF # 非高亮候选文字颜色
100 | candidate_back_color: 0x4b4848 # 非高亮候选背景颜色
101 | # candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
--------------------------------------------------------------------------------
/tables/86/squirrel.yaml:
--------------------------------------------------------------------------------
1 | # Squirrel settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | config_version: '0.38'
7 | keyboard_layout: last
8 | chord_duration: 0.1 # seconds
9 | show_notifications_when: appropriate
10 |
11 | style:
12 | color_scheme: poetry_spring
13 | color_scheme_dark: dark_spring
14 | text_orientation: horizontal # horizontal | vertical
15 | inline_preedit: true
16 | corner_radius: 10
17 | hilited_corner_radius: 0
18 | border_height: 0
19 | border_width: 0
20 | # space between candidates in stacked layout
21 | line_spacing: 5
22 | # space between preedit and candidates in non-inline mode
23 | spacing: 10
24 | candidate_format: '%c %@'
25 | # adjust the base line of vertical text
26 | #base_offset: 6
27 | font_face: 'Lucida Grande'
28 | font_point: 21
29 | label_font_face: 'Lucida Grande'
30 | label_font_point: 18
31 | comment_font_face: 'Lucida Grande, 雅黑字根, 黑体字根'
32 | comment_font_point: 18
33 |
34 | preset_color_schemes:
35 | native:
36 | name: 系統配色
37 |
38 | poetry_spring:
39 | name: 诗意之春/Poetry Spring
40 | author: 空山明月
41 | text_color: 0x333333
42 | back_color: 0xe3fbe6
43 | label_color: 0x5c5c5c
44 | candidate_text_color: 0x333333
45 | hilited_text_color: 0x333333
46 | hilited_candidate_label_color: 0xFFFFFF
47 | hilited_candidate_text_color: 0xFFFFFF
48 | hilited_candidate_back_color: 0x35922a
49 | comment_text_color: 0x5c5c5c
50 | hilited_comment_text_color: 0xFFFFFF
51 |
52 | dark_spring:
53 | name: 春夜阑珊/Dark Spring
54 | author: 空山明月
55 | text_color: 0xFFFFFF
56 | back_color: 0x4b4848
57 | label_color: 0xe0e0e0
58 | candidate_text_color: 0xFFFFFF
59 | hilited_text_color: 0xFFFFFF
60 | hilited_candidate_label_color: 0xe0e0e0
61 | hilited_candidate_text_color: 0xFFFFFF
62 | hilited_candidate_back_color: 0x35922a
63 | comment_text_color: 0xe0e0e0
64 | hilited_comment_text_color: 0xe0e0e0
65 |
66 | app_options:
67 | com.apple.Spotlight:
68 | ascii_mode: true
69 | com.alfredapp.Alfred:
70 | ascii_mode: true
71 | com.runningwithcrayons.Alfred-2:
72 | ascii_mode: true
73 | com.blacktree.Quicksilver:
74 | ascii_mode: true
75 | com.apple.Terminal:
76 | ascii_mode: true
77 | no_inline: true
78 | com.googlecode.iterm2:
79 | ascii_mode: true
80 | no_inline: true
81 | org.vim.MacVim:
82 | ascii_mode: true # 初始爲西文模式
83 | no_inline: true # 不使用行內編輯
84 | vim_mode: true # 退出VIM插入模式自動切換輸入法狀態
85 | com.apple.dt.Xcode:
86 | ascii_mode: true
87 | com.barebones.textwrangler:
88 | ascii_mode: true
89 | com.macromates.TextMate.preview:
90 | ascii_mode: true
91 | com.github.atom:
92 | ascii_mode: true
93 | com.microsoft.VSCode:
94 | ascii_mode: true
95 | com.sublimetext.2:
96 | ascii_mode: true
97 | org.gnu.Aquamacs:
98 | ascii_mode: true
99 | org.gnu.Emacs:
100 | ascii_mode: true
101 | no_inline: true
102 | co.zeit.hyper:
103 | ascii_mode: true
104 | com.google.Chrome:
105 | # 規避 https://github.com/rime/squirrel/issues/435
106 | inline: true
107 | ru.keepcoder.Telegram:
108 | # 規避 https://github.com/rime/squirrel/issues/475
109 | inline: true
--------------------------------------------------------------------------------
/tables/86/weasel.custom.yaml:
--------------------------------------------------------------------------------
1 | # weasel custom settings
2 | # encoding: utf-8
3 | # date: 2024-05-27
4 |
5 | patch:
6 | "style/color_scheme": poetry_spring # 日间主题
7 | "style/color_scheme_dark": dark_spring # 夜间主题
--------------------------------------------------------------------------------
/tables/86/weasel.yaml:
--------------------------------------------------------------------------------
1 | # Weasel settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | config_version: "0.26"
7 |
8 | ### 样式
9 | style:
10 | # ...外观...
11 | color_scheme: poetry_spring # 日间主题
12 | color_scheme_dark: dark_spring # 夜间主题
13 | # ...字体...
14 | font_face: Microsoft YaHei # 全局字体
15 | label_font_face: Microsoft YaHei # 标签字体
16 | comment_font_face: 黑体字根 # 注释字体
17 | font_point: 15 # 全局字号
18 | label_font_point: 13 # 标签字号
19 | comment_font_point: 13 # 注释字号
20 | # ... 窗口...
21 | fullscreen: false # 是否全屏模式
22 | horizontal: false # 是否横向布局
23 | vertical_text: true # 是否启用竖排文本
24 | vertical_text_left_to_right: true # 竖排方向是否从左到右
25 | vertical_text_with_wrap: false # 文本竖排模式下是否自动换行
26 | vertical_auto_reverse: false # 文本竖排模式下,候选窗口位于光标上方时倒序排序
27 | # ...预编辑区...
28 | inline_preedit: true # 是否在行内显示预编辑区
29 | preedit_type: composition # 预编辑区显示内容 composition(编码);preview(高亮候选);preview_all(全部候选)
30 | # ...其他选项...
31 | label_format: "%s" # 标签字符号
32 | mark_text: "" # 候选项前的标记符号
33 | ascii_tip_follow_cursor: false # 切换 ASCII 模式时,提示跟随鼠标,而非输入光标
34 | enhanced_position: false # 无法定位候选框时,在窗口左上角显示候选框
35 | display_tray_icon: false # 托盘显示独立于语言栏的额外图标
36 | antialias_mode: default # antialias_mode (default;force_dword;cleartype;grayscale;aliased)
37 | candidate_abbreviate_length: 20 # 候选项略写,超过此数字则用省略号代替。设置为 0 则不启用此功能
38 | paging_on_scroll: false # 在候选窗口上滑动滚轮的行为:true(翻页);false(选中下一个候选)
39 | click_to_capture: true # 鼠标点击候选项,创建截图
40 | ### 布局
41 | layout:
42 | align_type: center # 标签、候选文字、注解文字之间的相对对齐方式 (top ; center ; bottom)
43 | max_height: 0 # 候选框最大高度,0 不启用此功能
44 | max_width: 0 # 候选框最大宽度,0 不启用此功能
45 | min_height: 0 # 候选框最小高度
46 | min_width: 0 # 候选框最小宽度
47 | border_width: 0 # 边框宽度
48 | margin_x: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
49 | margin_y: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
50 | spacing: 5 # inline_preedit 为 false 时,编码区域和候选区域的间距
51 | candidate_spacing: 8 # 候选项之间的间距
52 | hilite_spacing: 8 # 候选项和相应标签的间距,候选项与注解文字之间的距离
53 | hilite_padding: 8 # 高亮区域和内部文字的间距,影响高亮区域大小
54 | shadow_radius: 8 # 阴影区域半径,为 0 不显示阴影;需要同时在配色方案中指定非透明的阴影颜色
55 | shadow_offset_x: 2 # 阴影绘制的偏离距离
56 | shadow_offset_y: 2 # 阴影绘制的偏离距离
57 | corner_radius: 13 # 候选窗口圆角半径
58 | round_corner: 13 # 候选背景色块圆角半径,别名 hilited_corner_radius
59 |
60 | preset_color_schemes:
61 | poetry_spring:
62 | name: 诗意之春/Poetry Spring
63 | author: 空山明月
64 | text_color: 0x333333 # 默认文字颜色
65 | comment_text_color: 0x333333 # 注释文字颜色
66 | label_color: 0x333333 # 标签文字颜色
67 | back_color: 0xe3fbe6 # 候选窗背景色
68 | shadow_color: 0x66000000 # 候选窗阴影色
69 | border_color: 0xe3fbe6 # 候选窗边框颜色
70 | hilited_text_color: 0x333333 # 编码文字颜色
71 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
72 | # hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
73 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
74 | hilited_candidate_back_color: 0x50AF4C # 高亮候选背景颜色
75 | hilited_label_color: 0xFFFFFF # 高亮候选的标签颜色
76 | # hilited_mark_color: 0xFFFFFF # 高亮候选前的标记颜色
77 | hilited_comment_text_color: 0xFFFFFF # 高亮候选的注释颜色
78 | candidate_text_color: 0x333333 # 非高亮候选文字颜色
79 | candidate_back_color: 0xe3fbe6 # 非高亮候选背景颜色
80 | # candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
81 |
82 | dark_spring:
83 | name: 春夜阑珊/Dark Spring
84 | author: 空山明月
85 | text_color: 0xFFFFFF # 默认文字颜色
86 | comment_text_color: 0xe0e0e0 # 注释文字颜色
87 | label_color: 0xe0e0e0 # 标签文字颜色
88 | back_color: 0x4b4848 # 候选窗背景色
89 | shadow_color: 0x66000000 # 候选窗阴影色
90 | border_color: 0x4b4848 # 候选窗边框颜色
91 | hilited_text_color: 0xFFFFFF # 编码文字颜色
92 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
93 | # hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
94 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
95 | hilited_candidate_back_color: 0x50AF4C # 高亮候选背景颜色
96 | hilited_label_color: 0xe0e0e0 # 高亮候选的标签颜色
97 | # hilited_mark_color: 0xFFFFFF # 高亮候选前的标记颜色
98 | hilited_comment_text_color: 0xe0e0e0 # 高亮候选的注释颜色
99 | candidate_text_color: 0xFFFFFF # 非高亮候选文字颜色
100 | candidate_back_color: 0x4b4848 # 非高亮候选背景颜色
101 | # candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
--------------------------------------------------------------------------------
/tables/98/squirrel.yaml:
--------------------------------------------------------------------------------
1 | # Squirrel settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | config_version: '0.38'
7 | keyboard_layout: last
8 | chord_duration: 0.1 # seconds
9 | show_notifications_when: appropriate
10 |
11 | style:
12 | color_scheme: poetry_ocean
13 | color_scheme_dark: dark_ocean
14 | text_orientation: horizontal # horizontal | vertical
15 | inline_preedit: true
16 | corner_radius: 10
17 | hilited_corner_radius: 0
18 | border_height: 0
19 | border_width: 0
20 | # space between candidates in stacked layout
21 | line_spacing: 5
22 | # space between preedit and candidates in non-inline mode
23 | spacing: 10
24 | candidate_format: '%c %@'
25 | # adjust the base line of vertical text
26 | #base_offset: 6
27 | font_face: 'Lucida Grande'
28 | font_point: 21
29 | label_font_face: 'Lucida Grande'
30 | label_font_point: 18
31 | comment_font_face: 'Lucida Grande, 雅黑字根, 黑体字根'
32 | comment_font_point: 18
33 |
34 | preset_color_schemes:
35 | native:
36 | name: 系統配色
37 |
38 | poetry_ocean:
39 | name: 诗意之海/Poetry Ocean
40 | author: 空山明月
41 | text_color: 0x333333
42 | back_color: 0xFEE6D3
43 | label_color: 0x333333
44 | candidate_text_color: 0x333333
45 | hilited_text_color: 0x333333
46 | hilited_candidate_label_color: 0xFFFFFF
47 | hilited_candidate_text_color: 0xFFFFFF
48 | hilited_candidate_back_color: 0xB5513F
49 | comment_text_color: 0x333333
50 | hilited_comment_text_color: 0xFFFFFF
51 |
52 | dark_ocean:
53 | name: 深海无垠/Dark Ocean
54 | author: 空山明月
55 | text_color: 0xFFFFFF
56 | back_color: 0x4b4848
57 | label_color: 0xe0e0e0
58 | candidate_text_color: 0xFFFFFF
59 | hilited_text_color: 0xFFFFFF
60 | hilited_candidate_label_color: 0xe0e0e0
61 | hilited_candidate_text_color: 0xFFFFFF
62 | hilited_candidate_back_color: 0xB5513F
63 | comment_text_color: 0xe0e0e0
64 | hilited_comment_text_color: 0xe0e0e0
65 |
66 | app_options:
67 | com.apple.Spotlight:
68 | ascii_mode: true
69 | com.alfredapp.Alfred:
70 | ascii_mode: true
71 | com.runningwithcrayons.Alfred-2:
72 | ascii_mode: true
73 | com.blacktree.Quicksilver:
74 | ascii_mode: true
75 | com.apple.Terminal:
76 | ascii_mode: true
77 | no_inline: true
78 | com.googlecode.iterm2:
79 | ascii_mode: true
80 | no_inline: true
81 | org.vim.MacVim:
82 | ascii_mode: true # 初始爲西文模式
83 | no_inline: true # 不使用行內編輯
84 | vim_mode: true # 退出VIM插入模式自動切換輸入法狀態
85 | com.apple.dt.Xcode:
86 | ascii_mode: true
87 | com.barebones.textwrangler:
88 | ascii_mode: true
89 | com.macromates.TextMate.preview:
90 | ascii_mode: true
91 | com.github.atom:
92 | ascii_mode: true
93 | com.microsoft.VSCode:
94 | ascii_mode: true
95 | com.sublimetext.2:
96 | ascii_mode: true
97 | org.gnu.Aquamacs:
98 | ascii_mode: true
99 | org.gnu.Emacs:
100 | ascii_mode: true
101 | no_inline: true
102 | co.zeit.hyper:
103 | ascii_mode: true
104 | com.google.Chrome:
105 | # 規避 https://github.com/rime/squirrel/issues/435
106 | inline: true
107 | ru.keepcoder.Telegram:
108 | # 規避 https://github.com/rime/squirrel/issues/475
109 | inline: true
--------------------------------------------------------------------------------
/tables/98/weasel.custom.yaml:
--------------------------------------------------------------------------------
1 | # weasel custom settings
2 | # encoding: utf-8
3 | # date: 2024-05-27
4 |
5 | patch:
6 | "style/color_scheme": poetry_ocean # 日间主题
7 | "style/color_scheme_dark": dark_ocean # 夜间主题
--------------------------------------------------------------------------------
/tables/98/weasel.yaml:
--------------------------------------------------------------------------------
1 | # Weasel settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | config_version: "0.26"
7 |
8 | ### 样式
9 | style:
10 | # ...外观...
11 | color_scheme: poetry_ocean # 日间主题
12 | color_scheme_dark: dark_ocean # 夜间主题
13 | # ...字体...
14 | font_face: Microsoft YaHei # 全局字体
15 | label_font_face: Microsoft YaHei # 标签字体
16 | comment_font_face: 黑体字根 # 注释字体
17 | font_point: 15 # 全局字号
18 | label_font_point: 13 # 标签字号
19 | comment_font_point: 13 # 注释字号
20 | # ... 窗口...
21 | fullscreen: false # 是否全屏模式
22 | horizontal: false # 是否横向布局
23 | vertical_text: true # 是否启用竖排文本
24 | vertical_text_left_to_right: true # 竖排方向是否从左到右
25 | vertical_text_with_wrap: false # 文本竖排模式下是否自动换行
26 | vertical_auto_reverse: false # 文本竖排模式下,候选窗口位于光标上方时倒序排序
27 | # ...预编辑区...
28 | inline_preedit: true # 是否在行内显示预编辑区
29 | preedit_type: composition # 预编辑区显示内容 composition(编码);preview(高亮候选);preview_all(全部候选)
30 | # ...其他选项...
31 | label_format: "%s" # 标签字符号
32 | mark_text: "" # 候选项前的标记符号
33 | ascii_tip_follow_cursor: false # 切换 ASCII 模式时,提示跟随鼠标,而非输入光标
34 | enhanced_position: false # 无法定位候选框时,在窗口左上角显示候选框
35 | display_tray_icon: false # 托盘显示独立于语言栏的额外图标
36 | antialias_mode: default # antialias_mode (default;force_dword;cleartype;grayscale;aliased)
37 | candidate_abbreviate_length: 20 # 候选项略写,超过此数字则用省略号代替。设置为 0 则不启用此功能
38 | paging_on_scroll: false # 在候选窗口上滑动滚轮的行为:true(翻页);false(选中下一个候选)
39 | click_to_capture: true # 鼠标点击候选项,创建截图
40 | ### 布局
41 | layout:
42 | align_type: center # 标签、候选文字、注解文字之间的相对对齐方式 (top ; center ; bottom)
43 | max_height: 0 # 候选框最大高度,0 不启用此功能
44 | max_width: 0 # 候选框最大宽度,0 不启用此功能
45 | min_height: 0 # 候选框最小高度
46 | min_width: 0 # 候选框最小宽度
47 | border_width: 0 # 边框宽度
48 | margin_x: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
49 | margin_y: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
50 | spacing: 5 # inline_preedit 为 false 时,编码区域和候选区域的间距
51 | candidate_spacing: 8 # 候选项之间的间距
52 | hilite_spacing: 8 # 候选项和相应标签的间距,候选项与注解文字之间的距离
53 | hilite_padding: 8 # 高亮区域和内部文字的间距,影响高亮区域大小
54 | shadow_radius: 8 # 阴影区域半径,为 0 不显示阴影;需要同时在配色方案中指定非透明的阴影颜色
55 | shadow_offset_x: 2 # 阴影绘制的偏离距离
56 | shadow_offset_y: 2 # 阴影绘制的偏离距离
57 | corner_radius: 13 # 候选窗口圆角半径
58 | round_corner: 13 # 候选背景色块圆角半径,别名 hilited_corner_radius
59 |
60 | preset_color_schemes:
61 | poetry_ocean:
62 | name: 诗意之海/Poetry Ocean
63 | author: 空山明月
64 | text_color: 0x333333 # 默认文字颜色
65 | comment_text_color: 0x333333 # 注释文字颜色
66 | label_color: 0x333333 # 标签文字颜色
67 | back_color: 0xFEE6D3 # 候选窗背景色
68 | shadow_color: 0x66000000 # 候选窗阴影色
69 | border_color: 0xFFFFFF # 候选窗边框颜色
70 | hilited_text_color: 0x333333 # 编码文字颜色
71 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
72 | # hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
73 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
74 | hilited_candidate_back_color: 0xB5513F # 高亮候选背景颜色
75 | hilited_label_color: 0xFFFFFF # 高亮候选的标签颜色
76 | # hilited_mark_color: 0xFFFFFF # 高亮候选前的标记颜色
77 | hilited_comment_text_color: 0xFFFFFF # 高亮候选的注释颜色
78 | candidate_text_color: 0x000000 # 非高亮候选文字颜色
79 | candidate_back_color: 0xFEE6D3 # 非高亮候选背景颜色
80 | # candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
81 |
82 | dark_ocean:
83 | name: 深海无垠/Dark Ocean
84 | author: 空山明月
85 | text_color: 0xFFFFFF # 默认文字颜色
86 | comment_text_color: 0xe0e0e0 # 注释文字颜色
87 | label_color: 0xe0e0e0 # 标签文字颜色
88 | back_color: 0x4b4848 # 候选窗背景色
89 | shadow_color: 0x66000000 # 候选窗阴影色
90 | border_color: 0x4b4848 # 候选窗边框颜色
91 | hilited_text_color: 0xFFFFFF # 编码文字颜色
92 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
93 | # hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
94 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
95 | hilited_candidate_back_color: 0xB5513F # 高亮候选背景颜色
96 | hilited_label_color: 0xe0e0e0 # 高亮候选的标签颜色
97 | # hilited_mark_color: 0xFFFFFF # 高亮候选前的标记颜色
98 | hilited_comment_text_color: 0xe0e0e0 # 高亮候选的注释颜色
99 | candidate_text_color: 0xFFFFFF # 非高亮候选文字颜色
100 | candidate_back_color: 0x4b4848 # 非高亮候选背景颜色
101 | # candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
--------------------------------------------------------------------------------
/wb_spelling.schema.yaml:
--------------------------------------------------------------------------------
1 | # Rime settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | schema:
7 | schema_id: wb_spelling
8 | name: "作者:空山明月"
9 | version: "1.0"
10 | author:
11 | - LuaTable by wubixiaozhu
12 | - 拆分来自网上资料,原作者信息不详
13 | description: |
14 | 伪方案,不能打字。
15 | 不要选我,不要修改本方案及配套词典。
16 | 仅用于辅助三重注解方案实现注解功能。
17 |
18 | translator:
19 | dictionary: wb_spelling
20 |
--------------------------------------------------------------------------------
/weasel.yaml:
--------------------------------------------------------------------------------
1 | # Weasel settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | config_version: "0.26"
7 |
8 | ### 样式
9 | style:
10 | # ...外观...
11 | color_scheme: poetry_spring # 日间主题
12 | color_scheme_dark: dark_spring # 夜间主题
13 | # ...字体...
14 | font_face: Microsoft YaHei # 全局字体
15 | label_font_face: Microsoft YaHei # 标签字体
16 | comment_font_face: 黑体字根 # 注释字体
17 | font_point: 15 # 全局字号
18 | label_font_point: 13 # 标签字号
19 | comment_font_point: 13 # 注释字号
20 | # ... 窗口...
21 | fullscreen: false # 是否全屏模式
22 | horizontal: false # 是否横向布局
23 | vertical_text: true # 是否启用竖排文本
24 | vertical_text_left_to_right: true # 竖排方向是否从左到右
25 | vertical_text_with_wrap: false # 文本竖排模式下是否自动换行
26 | vertical_auto_reverse: false # 文本竖排模式下,候选窗口位于光标上方时倒序排序
27 | # ...预编辑区...
28 | inline_preedit: true # 是否在行内显示预编辑区
29 | preedit_type: composition # 预编辑区显示内容 composition(编码);preview(高亮候选);preview_all(全部候选)
30 | # ...其他选项...
31 | label_format: "%s" # 标签字符号
32 | mark_text: "" # 候选项前的标记符号
33 | ascii_tip_follow_cursor: false # 切换 ASCII 模式时,提示跟随鼠标,而非输入光标
34 | enhanced_position: false # 无法定位候选框时,在窗口左上角显示候选框
35 | display_tray_icon: false # 托盘显示独立于语言栏的额外图标
36 | antialias_mode: default # antialias_mode (default;force_dword;cleartype;grayscale;aliased)
37 | candidate_abbreviate_length: 20 # 候选项略写,超过此数字则用省略号代替。设置为 0 则不启用此功能
38 | paging_on_scroll: false # 在候选窗口上滑动滚轮的行为:true(翻页);false(选中下一个候选)
39 | click_to_capture: true # 鼠标点击候选项,创建截图
40 | ### 布局
41 | layout:
42 | align_type: center # 标签、候选文字、注解文字之间的相对对齐方式 (top ; center ; bottom)
43 | max_height: 0 # 候选框最大高度,0 不启用此功能
44 | max_width: 0 # 候选框最大宽度,0 不启用此功能
45 | min_height: 0 # 候选框最小高度
46 | min_width: 0 # 候选框最小宽度
47 | border_width: 0 # 边框宽度
48 | margin_x: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
49 | margin_y: 0 # 主体元素和候选框的左右、上下边距,为负值时,不显示候选框
50 | spacing: 5 # inline_preedit 为 false 时,编码区域和候选区域的间距
51 | candidate_spacing: 8 # 候选项之间的间距
52 | hilite_spacing: 8 # 候选项和相应标签的间距,候选项与注解文字之间的距离
53 | hilite_padding: 8 # 高亮区域和内部文字的间距,影响高亮区域大小
54 | shadow_radius: 8 # 阴影区域半径,为 0 不显示阴影;需要同时在配色方案中指定非透明的阴影颜色
55 | shadow_offset_x: 2 # 阴影绘制的偏离距离
56 | shadow_offset_y: 2 # 阴影绘制的偏离距离
57 | corner_radius: 13 # 候选窗口圆角半径
58 | round_corner: 13 # 候选背景色块圆角半径,别名 hilited_corner_radius
59 |
60 | preset_color_schemes:
61 | poetry_spring:
62 | name: 诗意之春/Poetry Spring
63 | author: 空山明月
64 | text_color: 0x333333 # 默认文字颜色
65 | comment_text_color: 0x333333 # 注释文字颜色
66 | label_color: 0x333333 # 标签文字颜色
67 | back_color: 0xe3fbe6 # 候选窗背景色
68 | shadow_color: 0x66000000 # 候选窗阴影色
69 | border_color: 0xe3fbe6 # 候选窗边框颜色
70 | hilited_text_color: 0x333333 # 编码文字颜色
71 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
72 | # hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
73 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
74 | hilited_candidate_back_color: 0x50AF4C # 高亮候选背景颜色
75 | hilited_label_color: 0xFFFFFF # 高亮候选的标签颜色
76 | # hilited_mark_color: 0xFFFFFF # 高亮候选前的标记颜色
77 | hilited_comment_text_color: 0xFFFFFF # 高亮候选的注释颜色
78 | candidate_text_color: 0x333333 # 非高亮候选文字颜色
79 | candidate_back_color: 0xe3fbe6 # 非高亮候选背景颜色
80 | # candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
81 |
82 | dark_spring:
83 | name: 春夜阑珊/Dark Spring
84 | author: 空山明月
85 | text_color: 0xFFFFFF # 默认文字颜色
86 | comment_text_color: 0xe0e0e0 # 注释文字颜色
87 | label_color: 0xe0e0e0 # 标签文字颜色
88 | back_color: 0x4b4848 # 候选窗背景色
89 | shadow_color: 0x66000000 # 候选窗阴影色
90 | border_color: 0x4b4848 # 候选窗边框颜色
91 | hilited_text_color: 0xFFFFFF # 编码文字颜色
92 | hilited_back_color: 0xd4d4d4 # 编码背景颜色
93 | # hilited_shadow_color: 0x00000000 # 编码背景块阴影颜色
94 | hilited_candidate_text_color: 0xFFFFFF # 高亮候选文字颜色
95 | hilited_candidate_back_color: 0x50AF4C # 高亮候选背景颜色
96 | hilited_label_color: 0xe0e0e0 # 高亮候选的标签颜色
97 | # hilited_mark_color: 0xFFFFFF # 高亮候选前的标记颜色
98 | hilited_comment_text_color: 0xe0e0e0 # 高亮候选的注释颜色
99 | candidate_text_color: 0xFFFFFF # 非高亮候选文字颜色
100 | candidate_back_color: 0x4b4848 # 非高亮候选背景颜色
101 | # candidate_shadow_color: 0x00000000 # 非高亮候选背景块阴影颜色
--------------------------------------------------------------------------------
/wubi.extended.dict.yaml:
--------------------------------------------------------------------------------
1 | # Rime dictionary: wubi.extended
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | ---
7 | name: wubi.extended
8 | version: "2.0"
9 | sort: by_weight
10 | import_tables:
11 | - wubi
12 | - quick_symbols
13 | columns:
14 | - text
15 | - code
16 | - weight
17 | - stem
18 | encoder:
19 | exclude_patterns:
20 | - '^z.*$'
21 | rules:
22 | - length_equal: 2
23 | formula: "AaAbBaBb"
24 | - length_equal: 3
25 | formula: "AaBaCaCb"
26 | - length_in_range: [4, 90]
27 | formula: "AaBaCaZa"
28 | ...
29 |
30 | # *备注:
31 | # 本扩展词库文件是一个范例,用户在使用的时候最好复制一份,并重命名后使用
32 | # 因为在主方案更新时,会将此文件覆盖,否则用户在更新时需要提前将此文件备份
33 | # 下面是使用说明
34 | # ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
35 |
36 | # ↓ 扩展词库的用法一:「无码加词」
37 | # 无编码词条直接拷贝进来、保存一下,就批量加入了,下面几首诗,可以「五笔词条」的方式打出
38 | # 注意,末尾不可有符号。
39 |
40 | # 春眠不觉晓,处处闻啼鸟。夜来风雨声,花落知多少
41 | # 红豆生南国,春来发几枝。愿君多采撷,此物最相思
42 | # 向晚意不适,驱车登古原。夕阳无限好,只是近黄昏
43 | # 故人西辞黄鹤楼,烟花三月下扬州。孤帆远影碧空尽,唯见长江天际流
44 |
45 | # ↓ 扩展词库的用法二:「快捷输入」
46 | # 主词库中缺少的常用短语,个人信息等等,可如下快捷输入,删掉下面三行的「#」号,则可以定义在后面的「编码」输出
47 |
48 | #北京市海淀区清华大学医学科学楼 addr
49 | #tsps_e@tsinghua.edu.cn mail
50 | #13552888888 tel
51 |
52 | # ↓ 扩展词库的用法三:「局部调频」
53 | # 重码条目可以通过「词频」微调其排序,下诗默认排在其单字「暒」和「䗌」的后面,如果添加一个更大的词频,排序就将调前。
54 | # 注意,中州韵码表的标准格式是,「词条」「编码」「词频」「造词码」,故下面的「词条」和「词频」之间,跨过了「编码」列,所以有「 2 」个英文状态下的TAB缩进符。
55 |
56 | # 日照香炉生紫烟,遥看瀑布挂前川。飞流直下三千尺,疑是银河落九天 90271400
57 |
58 | # 单字「我」在「金」前,原因是「我」的词频大,给「金」调高到超过「我」,「金」就会前置了。
59 | # 注意,「单字」是无法在「五笔词组规则」下编码的,所以给单字调频需要加上它的编码,以防「中州韵」程序产生困惑。最好拷主码表相应条目到此修改。
60 | # 因为「主码表」和「扩展词库」是权级相等的关系,所以针对主表中已存在,你却想微调的部分,拷过来后,在这里定义个更大的频数,才会覆盖掉主表内容。
61 | # 通常而言,形码的「单字序」是固定的,这是做到盲打的基本条件,除非创造新的形码方案,否则不建议变更主码表单字排序。
62 |
63 | #我 q 90788800 trny
64 | #金 q 90788801 qqqq
65 |
66 | # ↓ 扩展词库的用法四:「码表魔改」
67 | # 此处的「单字表」如果不加「词频」,将会覆盖掉主表的排序,在「扩展词库」中魔改「单字」时,请注意。
68 | # 单行单义码表,直接拷入生效。例如,下是一些「二简第三重码字」,删了「#」号,即可生效。
69 |
70 | #行 tg
71 | #合 wg
72 | #教 ft
73 | #政 gh
74 | #海 it
75 | #期 dw
76 | #真 fh
77 | #程 tk
78 |
79 | # 附言:
80 | # 「主码表」与「扩展词库」最终在「Librime」引擎中「合二为一」。
81 | # 「扩展词库」可视为「主码表」的延伸与补充,两者权级平等,故遇着想改排序的重码,变更词频时,需要与主表对照。
82 | # 数据无价,注意保存备份,可以定期保存,程序升级前,可以先取出,再覆盖回去。
83 |
84 | # 自定义词语
85 | 空山明月
86 | 中书君
--------------------------------------------------------------------------------
/wubi.schema.yaml:
--------------------------------------------------------------------------------
1 | # Rime settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | schema:
7 | schema_id: wubi
8 | name: "纯五笔"
9 | version: "2.1"
10 | icon: icons/CN.ico
11 | ascii_icon: icons/EN.ico
12 | full_icon: icons/full.ico
13 | half_icon: icons/half.ico
14 | author:
15 | - 发明人 王永民
16 | description: |
17 | 敲 z 键进入拼音反查
18 | dependencies:
19 | - wb_spelling
20 | switches:
21 | - name: show_es
22 | reset: 0
23 | states: [ 💀, 😄 ]
24 | - name: ascii_mode
25 | reset: 0
26 | states: [ 中,英 ]
27 | - name: zh_trad
28 | reset: 0
29 | states: [ 简,繁 ]
30 | - name: new_spelling
31 | reset: 1
32 | states: [ 隐,显 ]
33 | - name: rvl_zhuyin
34 | reset: 1
35 | states: [ 形,拼 ]
36 | - name: GB2312
37 | reset: 1
38 | states: [ 扩,常 ]
39 | - name: new_hide_pinyin
40 | reset: 1
41 | states: [ 音,哑 ]
42 | - name: single_char
43 | reset: 0
44 | states: [ 词,单 ]
45 | - name: ascii_punct
46 | reset: 0
47 | states: [ 。,,., ]
48 | - name: full_shape
49 | reset: 0
50 | states: [ 半,全 ]
51 | engine:
52 | filters:
53 | - lua_filter@new_spelling@spelling
54 | - simplifier
55 | - simplifier@es_conversion
56 | - lua_filter@single_char
57 | - reverse_lookup_filter@ci_reverse_lookup
58 | - uniquifier
59 |
60 | processors:
61 | - ascii_composer
62 | - lua_processor@submit_text_processor
63 | - lua_processor@switch_processor
64 | - recognizer
65 | - key_binder
66 | - speller
67 | - punctuator
68 | - selector
69 | - navigator
70 | - express_editor
71 | segmentors:
72 | - ascii_segmentor
73 | - matcher
74 | - "affix_segmentor@mkst"
75 | - "affix_segmentor@rvl_zhuyin"
76 | - "affix_segmentor@rvlk1"
77 | - abc_segmentor
78 | - punct_segmentor
79 | - fallback_segmentor
80 | translators:
81 | - punct_translator
82 | - reverse_lookup_translator
83 | - "table_translator@rvlk1"
84 | - table_translator
85 | - "table_translator@fixed"
86 | - "table_translator@mkst"
87 | - "table_translator@rvl_zhuyin"
88 | - "history_translator@history"
89 | - "lua_translator@helper"
90 | - "lua_translator@time_date"
91 | - "lua_translator@calculator"
92 |
93 | speller:
94 | auto_select: false
95 | auto_clear: max_length
96 | delimiter: "`"
97 | max_code_length: 4
98 | alphabet: ;zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA`
99 | initials: ;zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA`
100 | auto_select_pattern: ^;.$|^\w{4}$
101 | algebra: # 万能z键拼写处理,z符号匹配任意字符
102 | - derive/^(...).$/$1z/
103 | - derive/^(..).(.*)$/$1z$2/
104 | - derive/^(.).(.*)$/$1z$2/
105 | # - derive/^.(.*)$/z$1/ # 开启本行将与z键重复上屏冲突
106 | translator:
107 | dictionary: wubi.extended
108 | db_class: tabledb
109 | initial_quality: 100000
110 | enable_charset_filter: false
111 | enable_sentence: false # 开启句子输入模式
112 | enable_user_dict: false # 开启用户词典
113 | enable_encoder: false
114 | encode_commit_history: false
115 | max_phrase_length: 4
116 | enable_completion: false
117 | # preedit_format:
118 | # - 'xform/^([a-z]*)$/$1\t〈\U$1\E〉/' # 注释掉本行将只显示键名提示而不显示英文编码提示
119 | # - "xlit|ABCDEFGHIJKLMNOPQRSTUVWXY|工子又大月土王目水日口田山已火之金白木禾立女人幺言|"
120 | disable_user_dict_for_patterns:
121 | - "^z.*$"
122 | fixed:
123 | db_class: tabledb
124 | dictionary: wubi.extended
125 | disable_user_dict_for_patterns:
126 | - "^z.*$"
127 | enable_charset_filter: false
128 | enable_completion: false
129 | enable_encoder: true
130 | enable_sentence: false
131 | enable_user_dict: true
132 | encode_commit_history: false
133 | initial_quality: 1000
134 | max_phrase_length: 4
135 | mkst:
136 | db_class: tabledb
137 | dictionary: wubi.extended
138 | disable_user_dict_for_patterns:
139 | - "^z.*$"
140 | enable_charset_filter: false
141 | enable_completion: false
142 | enable_encoder: false
143 | enable_sentence: true
144 | enable_user_dict: false
145 | encode_commit_history: false
146 | initial_quality: 10
147 | max_phrase_length: 4
148 | prefix: "`"
149 | tag: mkst
150 | tips: "〈自造词〉"
151 | rvl_zhuyin:
152 | db_class: tabledb
153 | dictionary: wubi.extended
154 | disable_user_dict_for_patterns:
155 | - "^z.*$"
156 | enable_charset_filter: false
157 | enable_completion: false
158 | enable_encoder: false
159 | enable_sentence: true
160 | enable_user_dict: false
161 | encode_commit_history: false
162 | initial_quality: 10
163 | max_phrase_length: 4
164 | prefix: "~"
165 | tag: zhuyin
166 | tips: "〈以形查音〉"
167 | reverse_lookup:
168 | db_class: tabledb
169 | dictionary: pinyin
170 | disable_user_dict_for_patterns:
171 | - "^z.*$"
172 | enable_charset_filter: false
173 | enable_completion: false
174 | enable_encoder: false
175 | enable_sentence: false
176 | enable_user_dict: false
177 | encode_commit_history: false
178 | initial_quality: 100000
179 | max_phrase_length: 4
180 | preedit_format:
181 | - "xform/([nl])v/$1ü/"
182 | - "xform/([nl])ue/$1üe/"
183 | - "xform/([jqxy])v/$1u/"
184 | tag: rvlk2
185 | tips: "〈拼音反查〉"
186 | rvlk1:
187 | db_class: tabledb
188 | dictionary: pinyin
189 | disable_user_dict_for_patterns:
190 | - "^z.*$"
191 | enable_charset_filter: false
192 | enable_completion: false
193 | enable_encoder: false
194 | enable_sentence: false
195 | enable_user_dict: false
196 | encode_commit_history: false
197 | extra_tags:
198 | - rvlk2
199 | initial_quality: 100000
200 | max_phrase_length: 4
201 | preedit_format:
202 | - "xform/([nl])v/$1ü/"
203 | - "xform/([nl])ue/$1üe/"
204 | - "xform/([jqxy])v/$1u/"
205 | prefix: z
206 | tag: rvlk1
207 | tips: "〈拼音反查〉"
208 | ci_reverse_lookup:
209 | dictionary: wubi.extended
210 | tips: "〈五笔滤镜〉"
211 | tags:
212 | - rvlk2
213 | simplifier:
214 | opencc_config: s2t.json
215 | option_name: zh_trad
216 | lua_reverse_db:
217 | spelling: wb_spelling
218 | code: wb_spelling
219 | recognizer:
220 | import_preset: default
221 | patterns:
222 | email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"
223 | mkst: "^[a-y]*`[a-y`]*$"
224 | punct: "^/([0-9]0?|[A-Za-z]+)$"
225 | rvlk1: "^z[a-z]*$"
226 | rvlk2: "^z[a-z]*$"
227 | uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
228 | url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$"
229 | zhuyin: "~[a-y]*?$"
230 | helper: '^help$'
231 | expression: "^=.*$"
232 | history:
233 | input: z
234 | size: 1
235 | initial_quality: 1
236 | key_binder:
237 | bindings:
238 | - {send: Up, accept: Left, when: has_menu}
239 | - {send: Down, accept: Right, when: has_menu}
240 | - {send: Page_Up, accept: minus, when: has_menu}
241 | - {send: Page_Down, accept: equal, when: has_menu}
242 | - {send: Escape, accept: space, when: composing}
243 | - {send: space, accept: space, when: has_menu}
244 | - {toggle: zh_trad, accept: "Control+Shift+4", when: always}
245 | - {toggle: zh_trad, accept: "Control+Shift+dollar", when: always}
246 | - {toggle: zh_trad, accept: "Control+Shift+F", when: always}
247 | - {toggle: new_spelling, accept: "Control+Shift+H", when: always}
248 | - {toggle: new_hide_pinyin, accept: "Control+Shift+J", when: always}
249 | - {toggle: single_char, accept: "Control+Shift+D", when: always}
250 | - {toggle: GB2312, accept: "Control+Shift+U", when: always}
251 | # 回车清空编码
252 | # - {accept: Return, send: Escape, when: composing}
253 | # - {accept: Return, send: Escape, when: has_menu}
254 | #
255 | - {accept: semicolon, send: 2, when: has_menu}
256 | - {accept: apostrophe, send: 3, when: has_menu}
257 | #将小键盘 6~9 .映射到主键盘,数字金额大写的 Lua 如 R1234.5678 可使用小键盘输入
258 | - {accept: KP_0, send: 0, when: composing}
259 | - {accept: KP_1, send: 1, when: composing}
260 | - {accept: KP_2, send: 2, when: composing}
261 | - {accept: KP_3, send: 3, when: composing}
262 | - {accept: KP_4, send: 4, when: composing}
263 | - {accept: KP_5, send: 5, when: composing}
264 | - {accept: KP_6, send: 6, when: composing}
265 | - {accept: KP_7, send: 7, when: composing}
266 | - {accept: KP_8, send: 8, when: composing}
267 | - {accept: KP_9, send: 9, when: composing}
268 | - {accept: KP_Decimal, send: period, when: composing}
269 | - {accept: KP_Add, send: plus, when: composing}
270 | - {accept: KP_Subtract, send: minus, when: composing}
271 | - {accept: KP_Multiply, send: asterisk, when: composing}
272 | - {accept: KP_Divide, send: slash, when: composing}
273 | #
274 | - { when: always, accept: Shift+space, toggle: full_shape } # shift + space 全角半角切换
275 | - { when: always, accept: Control+period, toggle: ascii_punct } # ctrl + . 中英文标点切换
276 | punctuator:
277 | import_preset: symbols
278 |
279 | es_conversion:
280 | opencc_config: es.json
281 | option_name: show_es
282 | tips: none # all/none, "〈Emoji〉"
283 | inherit_comment: false # 继承注释
--------------------------------------------------------------------------------
/wubi_pinyin.schema.yaml:
--------------------------------------------------------------------------------
1 | # Rime schema settings
2 | # encoding: utf-8
3 | # by: 空山明月
4 | # date: 2024-05-27
5 |
6 | schema:
7 | schema_id: wubi_pinyin
8 | name: "五笔拼音"
9 | version: "2.1"
10 | icon: icons/CN.ico
11 | ascii_icon: icons/EN.ico
12 | full_icon: icons/full.ico
13 | half_icon: icons/half.ico
14 | author:
15 | - 发明人 王永民先生
16 | description: |
17 | 五笔字型+拼音混输
18 | 码表源自 ibus-table
19 | dependencies:
20 | - pinyin
21 |
22 | switches:
23 | - name: show_es
24 | reset: 0
25 | states: [ 💀, 😄 ]
26 | - name: ascii_mode
27 | reset: 0
28 | states: [ 中文, 西文 ]
29 | - name: full_shape
30 | states: [ 半角, 全角 ]
31 | - name: extended_charset
32 | states: [ 常用, 增廣 ]
33 | - name: ascii_punct
34 | states: [ 。,, ., ]
35 |
36 | engine:
37 | processors:
38 | - ascii_composer
39 | - recognizer
40 | - key_binder
41 | - speller
42 | - punctuator
43 | - selector
44 | - navigator
45 | - express_editor
46 | segmentors:
47 | - ascii_segmentor
48 | - matcher
49 | - abc_segmentor
50 | - punct_segmentor
51 | - fallback_segmentor
52 | translators:
53 | - punct_translator
54 | - reverse_lookup_translator
55 | - table_translator
56 | - "lua_translator@time_date"
57 | - "lua_translator@calculator"
58 | - "lua_translator@helper"
59 | filters:
60 | - simplifier@emoji_switch
61 | - simplifier
62 | - uniquifier
63 |
64 | emoji_switch:
65 | opencc_config: es.json
66 | option_name: show_es
67 | tips: none # all/none, "〈Emoji〉"
68 | inherit_comment: false # 继承注释
69 |
70 |
71 | speller:
72 | delimiter: " ;'"
73 | #max_code_length: 4 # 四碼頂字上屏
74 | auto_select: false
75 | auto_select_unique_candidate: false
76 |
77 | translator:
78 | dictionary: wubi
79 | prism: wubi_pinyin
80 | enable_charset_filter: true
81 | enable_sentence: true
82 | enable_encoder: true
83 | encode_commit_history: true
84 | enable_user_dict: false
85 | #max_phrase_length: 4
86 | # preedit_format:
87 | # - 'xform/^([a-z]*)$/$1\t〈\U$1\E〉/' # 注释掉本行将只显示键名提示而不显示英文编码提示
88 | # - "xlit|ABCDEFGHIJKLMNOPQRSTUVWXY|工子又大月土王目水日口田山已火之金白木禾立女人幺言|"
89 | disable_user_dict_for_patterns:
90 | - "^z.*$"
91 |
92 | abc_segmentor:
93 | extra_tags:
94 | - reverse_lookup
95 |
96 | reverse_lookup:
97 | dictionary: pinyin
98 | prefix: "`"
99 | suffix: "'"
100 | tips: 〈拼音〉
101 | preedit_format:
102 | - xform/([nl])v/$1ü/
103 | - xform/([nl])ue/$1üe/
104 | - xform/([jqxy])v/$1u/
105 | punctuator:
106 | import_preset: default
107 |
108 |
109 | recognizer:
110 | import_preset: default
111 | patterns:
112 | reverse_lookup: "`[a-z]*'?$"
113 |
114 | key_binder:
115 | import_preset: default #方案切换相关
116 | bindings:
117 | - {accept: bracketleft, send: Page_Up, when: has_menu} # [上翻页
118 | - {accept: bracketright, send: Page_Down, when: has_menu} # ]下翻页
119 | # - {accept: semicolon, send: 2, when: has_menu} #分号次选
120 | #- {accept: semicolon, send: semicolon, when: has_menu} #如要使用分号引导符号功能,并双击上屏分号,需注销此行
121 | - {accept: period, send: 3, when: has_menu} #句号次选,已用下面内容替代
122 | #- {accept: dollar, send: 2, when: composing}
123 | - {accept: Release+dollar, send: period, when: composing}
124 | - {accept: Release+period, send: period, when: composing}
125 | - {accept: comma, send: 2, when: has_menu} #逗号次选
126 | - {accept: bar, send: 2, when: composing}
127 | - {accept: Release+bar, send: comma, when: composing}
128 | - {accept: Release+comma, send: comma, when: composing}
129 |
130 | - {accept: "Tab", send: Escape, when: composing}
131 | - {accept: "Caps_Lock", send: Escape, when: composing}
132 | - {accept: "Shift_R", send: Escape, when: composing}
133 | #将小键盘 6~9 .映射到主键盘,数字金额大写的 Lua 如 R1234.5678 可使用小键盘输入
134 | - {accept: KP_0, send: 0, when: composing}
135 | - {accept: KP_1, send: 1, when: composing}
136 | - {accept: KP_2, send: 2, when: composing}
137 | - {accept: KP_3, send: 3, when: composing}
138 | - {accept: KP_4, send: 4, when: composing}
139 | - {accept: KP_5, send: 5, when: composing}
140 | - {accept: KP_6, send: 6, when: composing}
141 | - {accept: KP_7, send: 7, when: composing}
142 | - {accept: KP_8, send: 8, when: composing}
143 | - {accept: KP_9, send: 9, when: composing}
144 | - {accept: KP_Decimal, send: period, when: composing}
145 | - {accept: KP_Add, send: plus, when: composing}
146 | - {accept: KP_Subtract, send: minus, when: composing}
147 | - {accept: KP_Multiply, send: asterisk, when: composing}
148 | - {accept: KP_Divide, send: slash, when: composing}
149 |
150 | recognizer:
151 | import_preset: default
152 | patterns:
153 | expression: "^=.*$"
154 | email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"
155 | #uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
156 | uppercase: "" #中文状态大写锁定直接上屏
157 | reverse_lookup: "[a-z`]*`+[a-z`]*"
158 | punct: ""
159 |
160 | menu:
161 | page_size: 5 #候选项数
162 |
163 | style:
164 | horizontal: true #竖排为false
165 | inline_preedit: true
166 |
--------------------------------------------------------------------------------