├── lua └── yuhao │ ├── yuhao_switch_tr.lua │ ├── yuhao_switch_proc.lua │ ├── yuhao_charset_filter_common.lua │ ├── yuhao_charset_filter_harmonic.lua │ ├── yuhao_charset_filter_tonggui.lua │ ├── yuhao_charset_prioritizer_common.lua │ ├── yuhao_charset_prioritizer_harmonic.lua │ ├── yuhao_charset_prioritizer_tonggui.lua │ ├── yuhao_charset_prioritizer_ubiquitous.lua │ ├── yuhao_autocompletion_filter.lua │ ├── deprecated │ ├── yuhao_pop_candidate.lua │ ├── yuhao_no_quick_words.lua │ ├── yuhao_add_placeholder_candidate.lua │ ├── yuhao_high_freq_first.lua │ ├── yuhao_tw_first.lua │ └── yuhao_sc_first.lua │ ├── yuhao_hide_space_candidates.lua │ ├── yuhao_unicode_input.lua │ ├── yuhao_auto_select_postponed.lua │ ├── yuhao_auto_select_in_fluency_mode.lua │ ├── yuhao_single_char_only_for_full_code.lua │ ├── yuhao_embeded_cands_archived.lua │ ├── yuhao_postpone_full_code.lua │ ├── yuhao_charset_filter.lua │ ├── yuhao_core.lua │ └── yuhao_embeded_cands.lua ├── yuling ├── beta │ ├── schema │ │ ├── default.custom.yaml │ │ ├── yuling_chaifen.schema.yaml │ │ └── yuling_chaifen_tw.schema.yaml │ ├── readme.md │ ├── custom │ │ └── yuling.custom.yaml │ ├── trime │ │ ├── default.yaml │ │ ├── punctuation.yaml │ │ └── key_bindings.yaml │ └── themes │ │ └── squirrel.custom.yaml └── build_release.py ├── committee ├── future.md └── proposals │ ├── 〔宇委2023地字〕關於認定「干口」爲「舌」字根的提案.txt │ ├── 〔宇委2023玄字〕關於增加「壴」字根的提案.txt │ └── 〔宇委2023天字〕關於增加「丌(丿改丨)」字根的提案.txt ├── yujoy ├── beta │ ├── schema │ │ ├── default.custom.yaml │ │ ├── yujoy_chaifen.schema.yaml │ │ ├── yujoy_chaifen_tw.schema.yaml │ │ ├── yujoy_full.schema.yaml │ │ ├── yujoy_tw.schema.yaml │ │ └── yujoy_fluency.schema.yaml │ ├── mabiao │ │ └── baidu │ │ │ ├── 小小配置.txt │ │ │ └── fcitx配置.txt │ ├── readme.md │ ├── trime │ │ ├── default.yaml │ │ ├── punctuation.yaml │ │ └── key_bindings.yaml │ └── custom │ │ ├── yujoy_tw.custom.yaml │ │ ├── yujoy_sc.custom.yaml │ │ ├── yujoy.custom.yaml │ │ └── yujoy_fluency.custom.yaml └── build_release.py ├── yuming ├── beta │ ├── schema │ │ ├── default.custom.yaml │ │ ├── yuming_chaifen.schema.yaml │ │ ├── yuming_chaifen_tw.schema.yaml │ │ └── yuming_essence.schema.yaml │ ├── readme.md │ ├── trime │ │ ├── default.yaml │ │ ├── punctuation.yaml │ │ └── key_bindings.yaml │ └── custom │ │ ├── yuming_tw.custom.yaml │ │ ├── yuming.custom.yaml │ │ └── squirrel.custom.yaml └── build_release.py ├── yulight ├── beta │ ├── schema │ │ ├── default.custom.yaml │ │ ├── yulight_chaifen.schema.yaml │ │ ├── yulight_chaifen_tw.schema.yaml │ │ └── yuhao_pinyin.schema.yaml │ ├── mabiao │ │ └── baidu │ │ │ ├── fcitx配置.txt │ │ │ ├── 小小配置.txt │ │ │ ├── 宇浩简体简码版.conf │ │ │ └── 宇浩繁體簡碼版.conf │ ├── readme.md │ ├── custom │ │ ├── yulight_tw.custom.yaml │ │ └── yulight_sc.custom.yaml │ └── trime │ │ ├── default.yaml │ │ ├── punctuation.yaml │ │ └── key_bindings.yaml └── build_release.py ├── yustar ├── beta │ ├── schema │ │ ├── default.custom.yaml │ │ ├── yustar_chaifen.schema.yaml │ │ ├── yustar_chaifen_tw.schema.yaml │ │ └── yustar_sc.schema.yaml │ ├── readme.md │ ├── custom │ │ ├── yustar.custom.yaml │ │ ├── yustar_sc.custom.yaml │ │ └── yustar_tw.custom.yaml │ └── trime │ │ ├── default.yaml │ │ ├── punctuation.yaml │ │ └── key_bindings.yaml └── build_release.py ├── README.md └── .gitignore /lua/yuhao/yuhao_switch_tr.lua: -------------------------------------------------------------------------------- 1 | local yuhao_switch_tr = require("yuhao.yuhao_switch").tr 2 | return yuhao_switch_tr -------------------------------------------------------------------------------- /lua/yuhao/yuhao_switch_proc.lua: -------------------------------------------------------------------------------- 1 | local yuhao_switch_proc = require("yuhao.yuhao_switch").proc 2 | return yuhao_switch_proc -------------------------------------------------------------------------------- /yuling/beta/schema/default.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | schema_list: 3 | - schema: yuling # 大陸簡化字、大陸繁體字、臺灣傳統字、香港傳統字通打 -------------------------------------------------------------------------------- /lua/yuhao/yuhao_charset_filter_common.lua: -------------------------------------------------------------------------------- 1 | local yuhao_charset_filter = require("yuhao.yuhao_charset_filter") 2 | return yuhao_charset_filter.yuhao_charset_filter_common 3 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_charset_filter_harmonic.lua: -------------------------------------------------------------------------------- 1 | local yuhao_charset_filter = require("yuhao.yuhao_charset_filter") 2 | return yuhao_charset_filter.yuhao_charset_filter_harmonic -------------------------------------------------------------------------------- /lua/yuhao/yuhao_charset_filter_tonggui.lua: -------------------------------------------------------------------------------- 1 | local yuhao_charset_filter = require("yuhao.yuhao_charset_filter") 2 | return yuhao_charset_filter.yuhao_charset_filter_tonggui -------------------------------------------------------------------------------- /lua/yuhao/yuhao_charset_prioritizer_common.lua: -------------------------------------------------------------------------------- 1 | local yuhao_charset_filter = require("yuhao.yuhao_charset_filter") 2 | return yuhao_charset_filter.yuhao_charset_prioritizer_common 3 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_charset_prioritizer_harmonic.lua: -------------------------------------------------------------------------------- 1 | local yuhao_charset_filter = require("yuhao.yuhao_charset_filter") 2 | return yuhao_charset_filter.yuhao_charset_prioritizer_harmonic 3 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_charset_prioritizer_tonggui.lua: -------------------------------------------------------------------------------- 1 | local yuhao_charset_filter = require("yuhao.yuhao_charset_filter") 2 | return yuhao_charset_filter.yuhao_charset_prioritizer_tonggui 3 | -------------------------------------------------------------------------------- /committee/future.md: -------------------------------------------------------------------------------- 1 | # Future improvements 2 | 3 | ## 夭 be futher divied as 丿大 4 | 5 | 夭 is not very common. Dividing it in to two parts will not cause too much duplicated words. 6 | 7 | ## -------------------------------------------------------------------------------- /lua/yuhao/yuhao_charset_prioritizer_ubiquitous.lua: -------------------------------------------------------------------------------- 1 | local yuhao_charset_filter = require("yuhao.yuhao_charset_filter") 2 | return yuhao_charset_filter.yuhao_charset_prioritizer_ubiquitous 3 | -------------------------------------------------------------------------------- /yujoy/beta/schema/default.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | schema_list: 3 | - schema: yujoy # 繁简均衡 4 | - schema: yujoy_sc # 以简化汉字字频设置简码 5 | - schema: yujoy_tw # 以臺灣傳統漢字字頻設置簡碼 6 | - schema: yujoy_fluency # 全碼單字無空格連續輸入 7 | -------------------------------------------------------------------------------- /yuming/beta/schema/default.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | schema_list: 3 | - schema: yuming # 大陸簡化字、大陸繁體字、臺灣傳統字、香港傳統字通打 4 | - schema: yuming_tw # 臺灣傳統字、大陸繁體字、香港傳統字、大陸簡化字通打 5 | - schema: yuming_essence # 無 lua 整句輸入 -------------------------------------------------------------------------------- /yujoy/beta/mabiao/baidu/小小配置.txt: -------------------------------------------------------------------------------- 1 | # 将以下行复制到码表前,即可使用于小小输入法 2 | encode=UTF-8 3 | name=卿雲 4 | key=abcdefghijklmnopqrstuvwxyz 5 | len=4 6 | match=0 7 | commit=0 0 0 8 | auto_clear=4 9 | simple=0 10 | assist=z mb/pinyin.txt 11 | [DATA] 12 | -------------------------------------------------------------------------------- /yulight/beta/schema/default.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | schema_list: 3 | - schema: yulight_sc # 繁简通打,以简化汉字为主设置简码,故名为「开来学」 4 | # - schema: yulight_tc # 繁簡通打,以傳統漢字爲主設置簡碼,故名爲「繼往聖」 5 | - schema: yulight_tw # 繁簡通打,以臺灣傳統漢字爲主設置簡碼,故名爲「書同文」 6 | -------------------------------------------------------------------------------- /yustar/beta/schema/default.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | schema_list: 3 | - schema: yustar # 單字全碼 + 重要一級簡碼 + 重要二級簡碼 + 避重三級簡碼 + (可手動載入繁簡簡碼、詞語分字典) 4 | - schema: yustar_sc # 以简化汉字为主设置简码 5 | # - schema: yustar_tc # 以傳統漢字爲主設置簡碼 6 | - schema: yustar_tw # 以臺灣傳統漢字爲主設置簡碼 7 | -------------------------------------------------------------------------------- /yujoy/beta/mabiao/baidu/fcitx配置.txt: -------------------------------------------------------------------------------- 1 | # 将以下行复制到码表前,即可使用于Fcitx输入法 2 | ;fcitx Version 0x03 Table file 3 | KeyCode=abcdefghijklmnopqrstuvwxyz 4 | Length=4 5 | Pinyin=@ 6 | PinyinLength=4 7 | Prompt=& 8 | ConstructPhrase=^ 9 | [Rule] 10 | e2=p11+p12+p21+p22 11 | e3=p11+p21+p22+p31 12 | a4=p11+p21+p31+n11 13 | [Data] -------------------------------------------------------------------------------- /yulight/beta/mabiao/baidu/fcitx配置.txt: -------------------------------------------------------------------------------- 1 | # 将以下行复制到码表前,即可使用于Fcitx输入法 2 | ;fcitx Version 0x03 Table file 3 | KeyCode=abcdefghijklmnopqrstuvwxy 4 | Length=4 5 | Pinyin=@ 6 | PinyinLength=4 7 | Prompt=& 8 | ConstructPhrase=^ 9 | [Rule] 10 | e2=p11+p12+p21+p22 11 | e3=p11+p21+p22+p31 12 | a4=p11+p21+p31+n11 13 | [Data] -------------------------------------------------------------------------------- /yujoy/beta/schema/yujoy_chaifen.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yujoy_chaifen 6 | name: 卿雲爛兮·拆分表·大陸字形 7 | version: 20231001 8 | author: 9 | - 發明人 朱宇浩 10 | description: | 11 | 輔助方案,不能打字。 12 | 配合 lua_filter 實現三重注解功能。 13 | 14 | translator: 15 | dictionary: yujoy_chaifen 16 | enable_user_dict: false 17 | -------------------------------------------------------------------------------- /committee/proposals/〔宇委2023地字〕關於認定「干口」爲「舌」字根的提案.txt: -------------------------------------------------------------------------------- 1 | 關於認定「干口」爲「舌」字根的提案 2 | 〔宇委2023地字〕 3 | 4 | 委員會: 5 | 6 | 因爲「舌」臺灣字形中爲「干口」。爲了保證字根一致不二拆,故而將「干口」也視爲「舌」字根。 7 | 8 | 「舍」及相關字,現拆爲「人舌」。 9 | 10 | 不影响重码数据。 11 | 12 | 2023年8月16日 13 | forFudan 14 | 15 | ==================== 16 | 17 | 委員會意見: 18 | 19 | 麥:同意,合理的变形思路 20 | 吉:挺好,就是多了一个二根字 21 | 餅:(雖然没有明確表態,但似乎是同意的) 22 | 山:同意 23 | 打:同意 24 | 25 | 其他委員未表態 -------------------------------------------------------------------------------- /yujoy/beta/schema/yujoy_chaifen_tw.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yujoy_chaifen_tw 6 | name: 卿雲爛兮·拆分表·臺灣字形 7 | version: 20231001 8 | author: 9 | - 發明人 朱宇浩 10 | description: | 11 | 輔助方案,不能打字。 12 | 配合 lua_filter 實現三重注解功能。 13 | 14 | translator: 15 | dictionary: yujoy_chaifen_tw 16 | enable_user_dict: false 17 | -------------------------------------------------------------------------------- /yulight/beta/schema/yulight_chaifen.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yulight_chaifen 6 | name: 宇浩·繁簡通·拆分表 7 | version: 20230430 8 | author: 9 | - 發明人 朱宇浩 10 | description: | 11 | 輔助方案,不能打字。 12 | 配合 lua_filter 實現三重注解功能。 13 | 14 | translator: 15 | dictionary: yulight_chaifen 16 | enable_user_dict: false 17 | -------------------------------------------------------------------------------- /yuling/beta/schema/yuling_chaifen.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yuling_chaifen 6 | name: 宇浩·靈明·全漢字拆分表·大陸字形 7 | version: 20250504 8 | author: 9 | - 發明人 朱宇浩 10 | description: | 11 | 輔助方案,不能打字。 12 | 配合 lua_filter 實現三重注解功能。 13 | 14 | translator: 15 | dictionary: yuling_chaifen 16 | enable_user_dict: false 17 | -------------------------------------------------------------------------------- /yuming/beta/schema/yuming_chaifen.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yuming_chaifen 6 | name: 宇浩·日月·全漢字拆分表·大陸字形 7 | version: 20250504 8 | author: 9 | - 發明人 朱宇浩 10 | description: | 11 | 輔助方案,不能打字。 12 | 配合 lua_filter 實現三重注解功能。 13 | 14 | translator: 15 | dictionary: yuming_chaifen 16 | enable_user_dict: false 17 | -------------------------------------------------------------------------------- /yustar/beta/schema/yustar_chaifen.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yustar_chaifen 6 | name: 宇浩·星陳·拆分表·大陸字形 7 | version: 20231001 8 | author: 9 | - 發明人 朱宇浩 10 | description: | 11 | 輔助方案,不能打字。 12 | 配合 lua_filter 實現三重注解功能。 13 | 14 | translator: 15 | dictionary: yustar_chaifen 16 | enable_user_dict: false 17 | -------------------------------------------------------------------------------- /yustar/beta/schema/yustar_chaifen_tw.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yustar_chaifen_tw 6 | name: 宇浩·星陳·拆分表·臺灣字形 7 | version: 20231001 8 | author: 9 | - 發明人 朱宇浩 10 | description: | 11 | 輔助方案,不能打字。 12 | 配合 lua_filter 實現三重注解功能。 13 | 14 | translator: 15 | dictionary: yustar_chaifen_tw 16 | enable_user_dict: false 17 | -------------------------------------------------------------------------------- /yulight/beta/schema/yulight_chaifen_tw.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yulight_chaifen_tw 6 | name: 宇浩·繁簡通·拆分表·臺灣字形 7 | version: 20230801 8 | author: 9 | - 發明人 朱宇浩 10 | description: | 11 | 輔助方案,不能打字。 12 | 配合 lua_filter 實現三重注解功能。 13 | 14 | translator: 15 | dictionary: yulight_chaifen_tw 16 | enable_user_dict: false 17 | -------------------------------------------------------------------------------- /yuling/beta/schema/yuling_chaifen_tw.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yuling_chaifen_tw 6 | name: 宇浩·靈明·全漢字拆分表·臺灣字形 7 | version: 20250504 8 | author: 9 | - 發明人 朱宇浩 10 | description: | 11 | 輔助方案,不能打字。 12 | 配合 lua_filter 實現三重注解功能。 13 | 14 | translator: 15 | dictionary: yuling_chaifen_tw 16 | enable_user_dict: false 17 | -------------------------------------------------------------------------------- /yuming/beta/schema/yuming_chaifen_tw.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yuming_chaifen_tw 6 | name: 宇浩·日月·全漢字拆分表·臺灣字形 7 | version: 20250504 8 | author: 9 | - 發明人 朱宇浩 10 | description: | 11 | 輔助方案,不能打字。 12 | 配合 lua_filter 實現三重注解功能。 13 | 14 | translator: 15 | dictionary: yuming_chaifen_tw 16 | enable_user_dict: false 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # 宇浩输入法方案發佈仓库 3 | 4 | ```txt 5 | 宇浩輸入法·傳統漢字简化汉字通打混輸·兼容大陸台灣字形標準·全漢字覆蓋·八萬詞庫·科學高效 6 | ``` 7 | 8 | 方案下載:[GitHub 發佈頁](https://github.com/forFudan/yuhao/releases) · 9 | [永硕网盘](http://zhuyuhao.ysepan.com) 10 | 11 | 官方網站: [https://shurufa.app](https://shurufa.app) 12 | 13 | 官方 QQ 群: [735728797](https://jq.qq.com/?_wv=1027&k=2OYDP4Tk) 14 | 官方 TG 群: [yuhaoim](https://t.me/yuhaoim) 15 | -------------------------------------------------------------------------------- /committee/proposals/〔宇委2023玄字〕關於增加「壴」字根的提案.txt: -------------------------------------------------------------------------------- 1 | 關於增加「壴」字根的提案 2 | 〔宇委 2023 玄字〕 3 | 4 | 委員會: 5 | 6 | 因「壴」部首十分常見,對其分散拆分會造成「GLUL」編碼集中了18個漢字。故請考慮增加「壴」字根,碼位「Dd」。 7 | 8 | GB0中,「喜嘉」不再重碼,「涛澍」重碼。 9 | 10 | 國字中,「喜嘉膨彫」不再重碼。 11 | 12 | 更改後: 13 | 14 | GB0: 320 15 | 國: 198 16 | GBK: 5164 17 | 簡動: 4.3‱ (-0.6‱) 18 | 繁動: 14.3‱ (-0.8‱) 19 | 20 | 請委員會審議。 21 | 22 | 2023年8月16日 23 | forFudan 24 | 25 | ==================== 26 | 27 | 委員會意見: 28 | 29 | 雲:加加加 30 | 山:同意 31 | 打:同意 32 | 麥:我附議 -------------------------------------------------------------------------------- /yulight/beta/mabiao/baidu/小小配置.txt: -------------------------------------------------------------------------------- 1 | # 将以下行复制到码表前,即可使用于小小输入法(大陆简体优先) 2 | encode=UTF-8 3 | name=宇浩·大陆简体优先 4 | key=abcdefghijklmnopqrstuvwxyz 5 | wildcard=z 6 | len=4 7 | match=0 8 | commit=0 0 0 9 | auto_clear=4 10 | simple=0 11 | assist=z mb/pinyin.txt 12 | [DATA] 13 | 14 | # 将以下行复制到码表前,即可使用于小小输入法(大陆简体优先) 15 | encode=UTF-8 16 | name=宇浩·大陸繁體優先 17 | key=abcdefghijklmnopqrstuvwxyz 18 | wildcard=z 19 | len=4 20 | match=0 21 | commit=0 0 0 22 | auto_clear=4 23 | simple=0 24 | assist=z mb/pinyin.txt 25 | [DATA] -------------------------------------------------------------------------------- /yuling/beta/readme.md: -------------------------------------------------------------------------------- 1 | # 宇浩·靈明 2 | 3 | ## schema 4 | 5 | /scheme 中的文件爲 Rime 輸入法各平臺(小狼毫、鼠鬚管、同文)通用碼表。 6 | 7 | 複製所有文件到設備中的 /Rime 文件夾。 8 | 9 | 重新部署後即可使用。 10 | 11 | *注意* 12 | 如果你不想拷貝 default.custom.yaml 文件,請在其中手動添加本方案名如下: 13 | 14 | ```yaml 15 | patch: 16 | schema_list: 17 | - schema: yuling # 大陸簡化字、大陸繁體字、臺灣傳統字、香港傳統字通打 18 | ``` 19 | 20 | ## trime 21 | 22 | /trime 中的文件,用於 Android 平臺的「同文輸入法」。使用時,直接將文件覆蓋 /Rime 文件夾下的原文件即可。 23 | 24 | ## custom 25 | 26 | /custom 中的文件爲 Rime 輸入法各平臺(小狼毫、鼠鬚管)方案的自定義設定。 27 | 28 | ## mabiao 29 | 30 | /mabiao 中的文件是其他平臺的碼表。 31 | -------------------------------------------------------------------------------- /yustar/beta/readme.md: -------------------------------------------------------------------------------- 1 | # 宇浩·星陳 2 | 3 | ## schema 4 | 5 | /scheme 中的文件爲 Rime 輸入法各平臺(小狼毫、鼠鬚管)碼表。 6 | 7 | 複製所有文件至機器上的 /Rime 文件夾。 8 | 9 | 請在 default.custom.yaml 文件的 patch/schema_list 列表中手動添加本方案名如下: 10 | 11 | patch: 12 | schema_list: 13 | - schema: yustar 14 | - schema: yustar_sc 15 | - schema: yustar_tw 16 | 17 | 重新部署后即可使用。 18 | 19 | ## custom 20 | 21 | /custom 中的文件爲 Rime 輸入法各平臺(小狼毫、鼠鬚管)方案的自定義設定。 22 | 23 | ## trime 24 | 25 | /trime 中的文件,用於 Android 平臺的「同文輸入法」。使用時,直接將文件覆蓋 /Rime 文件夾下的原文件即可。 26 | 27 | ## mabiao 28 | 29 | /mabiao 中的文件是其他平臺的碼表。 30 | -------------------------------------------------------------------------------- /yulight/beta/readme.md: -------------------------------------------------------------------------------- 1 | # 宇浩 2 | 3 | ## schema 4 | 5 | /scheme 中的文件爲 Rime 輸入法各平臺(小狼毫、鼠鬚管)碼表。 6 | 7 | 複製所有文件至機器上的 /Rime 文件夾。 8 | 9 | 請在 default.custom.yaml 文件的 patch/schema_list 列表中手動添加本方案名如下: 10 | 11 | patch: 12 | schema_list: 13 | - schema: yuhao 14 | - schema: yuhao_tc 15 | - schema: yuhao_tw 16 | 17 | 重新部署后即可使用。 18 | 19 | ## custom 20 | 21 | /custom 中的文件爲 Rime 輸入法各平臺(小狼毫、鼠鬚管)方案的自定義設定。 22 | 23 | ## hotfix 24 | 25 | /hotfix 中的文件,用於 Android 平臺的「中文輸入法」,以及一些 Rime 内核較老的程序。使用時,直接將文件覆蓋 /schema 下的原文件即可。 26 | 27 | ## mabiao 28 | 29 | /mabiao 中的文件是其他平臺的碼表。 30 | -------------------------------------------------------------------------------- /yujoy/beta/readme.md: -------------------------------------------------------------------------------- 1 | # 宇浩·卿雲 2 | 3 | ## schema 4 | 5 | /scheme 中的文件爲 Rime 輸入法各平臺(小狼毫、鼠鬚管)碼表。 6 | 7 | 複製所有文件至機器上的 /Rime 文件夾。 8 | 9 | 請在 default.custom.yaml 文件的 patch/schema_list 列表中手動添加本方案名如下: 10 | 11 | patch: 12 | schema_list: 13 | - schema: yujoy # 以繁簡混合字頻設置簡碼 14 | - schema: yujoy_sc # 以簡化漢字字頻設置簡碼 15 | - schema: yujoy_tw # 以臺灣準傳進行拆分並設置簡碼 16 | - schema: yujoy_fluency # 全碼單字無空格連續輸入 17 | 18 | 重新部署后即可使用。 19 | 20 | ## custom 21 | 22 | /custom 中的文件爲 Rime 輸入法各平臺(小狼毫、鼠鬚管)方案的自定義設定。 23 | 24 | ## trime 25 | 26 | /trime 中的文件,用於 Android 平臺的「同文輸入法」。使用時,直接將文件覆蓋 /Rime 文件夾下的原文件即可。 27 | 28 | ## mabiao 29 | 30 | /mabiao 中的文件是其他平臺的碼表。 31 | -------------------------------------------------------------------------------- /yuming/beta/readme.md: -------------------------------------------------------------------------------- 1 | # 宇浩·日月 2 | 3 | ## schema 4 | 5 | /scheme 中的文件爲 Rime 輸入法各平臺(小狼毫、鼠鬚管、同文)通用碼表。 6 | 7 | 複製所有文件到設備中的 /Rime 文件夾。 8 | 9 | 重新部署後即可使用。 10 | 11 | *注意* 12 | 如果你不想拷貝 default.custom.yaml 文件,請在其中手動添加本方案名如下: 13 | 14 | ```yaml 15 | patch: 16 | schema_list: 17 | - schema: yuming # 大陸簡化字、大陸繁體字、臺灣傳統字、香港傳統字通打 18 | - schema: yuming_tw # 臺灣傳統字、大陸繁體字、香港傳統字、大陸簡化字通打 19 | - schema: yuming_essence # 無 lua 整句輸入 20 | ``` 21 | 22 | ## trime 23 | 24 | /trime 中的文件,用於 Android 平臺的「同文輸入法」。使用時,直接將文件覆蓋 /Rime 文件夾下的原文件即可。 25 | 26 | ## custom 27 | 28 | /custom 中的文件爲 Rime 輸入法各平臺(小狼毫、鼠鬚管)方案的自定義設定。 29 | 30 | ## mabiao 31 | 32 | /mabiao 中的文件是其他平臺的碼表。 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore local settings 2 | /.vscode 3 | .DS_Store 4 | .mypy_cache 5 | 6 | # Ignore locally-generated dictionary files 7 | */beta/mabiao 8 | !*/beta/mabiao/baidu/fcitx* 9 | !*/beta/mabiao/baidu/小小* 10 | !*/beta/mabiao/baidu/小小配置.txt 11 | 12 | */beta/schema/yuhao 13 | !*/beta/schema/yuhao/yuhao.extended.dict.yaml 14 | !*/beta/schema/yuhao/yuhao.priviate.dict.yaml 15 | */beta/schema/*.dict.yaml 16 | */beta/schema/yuhao.essay.txt 17 | 18 | */beta/archived/*.dict.yaml 19 | 20 | # Ignore certin files 21 | *.ttf 22 | *.pdf 23 | *.zip 24 | *.png 25 | *.xlsx 26 | 27 | # Ignore distributions 28 | dist 29 | yulight/dist 30 | yujoy/dist 31 | yustar/dist 32 | yuming/dist 33 | -------------------------------------------------------------------------------- /committee/proposals/〔宇委2023天字〕關於增加「丌(丿改丨)」字根的提案.txt: -------------------------------------------------------------------------------- 1 | 關於增加「丌(丿改丨)」字根的提案 2 | 〔宇委2023天字〕 3 | 4 | 委員會: 5 | 6 | 丌(丿改丨)按規則,應拆作「丅丨」而非「一〢」,不是很直觀。爲了避免修改規則,且達到拆分直觀的目的,爲快的方法就是恢復「丌(丿改丨)」字根。 7 | 8 | GB0中,影響「亚」「严」及相關字共15個。 9 | 10 | 亚:一业 —— 丌䒑 11 | 严:一业丿 —— 丌䒑丿 12 | 13 | GBK中,影響「亜」及相關字3個。 14 | 15 | 亜:丅口上 —— 丌口一 16 | 17 | 更改前: 18 | 19 | GB0: 318 20 | 國: 202 21 | GBK: 5169 22 | 簡動: 0.0489% 23 | 繁動: 0.1507% 24 | 词動: 1.0902% 25 | 26 | 更改後: 27 | 28 | GB0: 318 29 | 國: 202 30 | GBK: 5178 31 | 簡動: 4.9‱ 32 | 繁動: 15.1‱ 33 | 词動: 109.7‱ 34 | 35 | 請委員會審議。 36 | 37 | 2023年7月7日 38 | forFudan 39 | 40 | ==================== 41 | 42 | 委員會意見: 43 | 44 | 錢:同意 45 | 吉:含淚贊成 46 | 餅:不含淚贊成 47 | 宋:OK 48 | 麥:(雖然没有明確表態,但似乎是同意的) 49 | 風:没有意见,同意 50 | 51 | 其他委員未表態 -------------------------------------------------------------------------------- /lua/yuhao/yuhao_autocompletion_filter.lua: -------------------------------------------------------------------------------- 1 | -- Name: yuhao_autocompletion_filter.lua 2 | -- 名稱: 輸入預測開關 3 | -- Version: 20230901 4 | -- Author: forFudan 朱宇浩 5 | -- Github: https://github.com/forFudan/ 6 | -- Purpose: 通過開關打開或關閉輸入預測,從而不需要修改 schema.yaml 7 | -- 版權聲明: 8 | -- 專爲宇浩輸入法製作 9 | -- 轉載請保留作者名和出處 10 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 11 | --------------------------------------- 12 | 13 | local function filter(input, env) 14 | local fil = env.engine.context:get_option("yuhao_autocompletion_filter") 15 | for cand in input:iter() do 16 | if fil and (cand.type == "completion") then 17 | return 18 | else 19 | yield(cand) 20 | end 21 | end 22 | end 23 | 24 | return { func = filter } -------------------------------------------------------------------------------- /lua/yuhao/deprecated/yuhao_pop_candidate.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- Name: yuhao_pop_candidate.lua 3 | -- 名稱: 頂出候選項 4 | -- Version: 20250722 5 | -- Author: forFudan 朱宇浩 6 | -- Github: https://github.com/forFudan/ 7 | -- Purpose: 出現韻碼時,下一碼頂出前序首位候選項. 8 | -- 版權聲明: 9 | -- 專爲宇浩輸入法製作 10 | -- 轉載請保留作者名和出處 11 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 12 | --------------------------------------- 13 | 14 | 版本: 15 | 20250722: 初版. 16 | --------------------------- 17 | --]] 18 | 19 | local function filter(input, env) 20 | 21 | if (env.engine.context.input:match("^%L")) then 22 | for cand in input:iter() do 23 | yield(cand) 24 | end 25 | return 26 | 27 | elseif env.engine.context.input:match("^[z/`^_-]") then 28 | -- If the input starts with 'z', '/', or '`', we yield all candidates. 29 | for cand in input:iter() do 30 | yield(cand) 31 | end 32 | return 33 | 34 | elseif env.engine.context.input:match("[aeiou]%l$") then 35 | -- Any letter following a vowel is considered a new character. 36 | return 37 | 38 | else 39 | for cand in input:iter() do 40 | yield(cand) 41 | end 42 | return 43 | end 44 | end 45 | 46 | return { 47 | func = filter 48 | } 49 | -------------------------------------------------------------------------------- /lua/yuhao/deprecated/yuhao_no_quick_words.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Name: yuhao_no_quick_words.lua 3 | 名稱: 簡碼詞開關 4 | Version: 20240516 5 | Author: forFudan 朱宇浩 6 | Github: https://github.com/forFudan/ 7 | Purpose: 當用户輸入非全碼時,不出簡碼詞語,只出簡碼單字. 8 | ------------------------------------------------------------------------ 9 | 專爲宇浩輸入法製作 10 | 轉載請保留作者名和出處 11 | Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 12 | ------------------------------------------------------------------------ 13 | switches 添加狀態: 14 | - name: yuhao_no_quick_words 15 | reset: 0 16 | states: [有簡碼詞, 無簡碼詞] 17 | engine/filters 添加: 18 | - lua_filter@*yuhao.yuhao_no_quick_words 19 | ------------------------------------------------------------------------ 20 | ]] 21 | 22 | local core = require("yuhao.yuhao_core") 23 | 24 | local function filter(input, env) 25 | local option = env.engine.context:get_option("yuhao_no_quick_words") 26 | local length_of_input = string.len(env.engine.context.input) 27 | for cand in input:iter() do 28 | -- Yield if 29 | -- (1) option is 0 or 30 | -- (2) code length is 4 31 | -- (3) char length is 1 32 | if option or (length_of_input == 4) or (utf8.len(cand.text) == 1) then 33 | yield(cand) 34 | end 35 | end 36 | end 37 | 38 | return filter 39 | -------------------------------------------------------------------------------- /yulight/beta/custom/yulight_tw.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 宇浩·臺灣正體 # 方案名 8 | # menu/page_size: 9 # 每頁候選數量 9 | # style/horizontal: true # 橫排候選欄 10 | # style/inline_preedit: false # 候選欄内置於輸入界面 11 | # style/preedit_type: composition # 候選顯示字母(composition)还是候選(preview) 12 | # style/inline_candidate: false # MacOs 候選顯示字母(false)还是候選(true) 13 | # style/layout/margin_x: -1 # 關閉候選欄 Windows 14 | # style/alpha: 0.01 # 隱藏候選欄 Mac 15 | # speller/auto_select: true # 四碼唯一自動上屏 16 | # 17 | #################### 18 | # 控制開關默認設置 # 19 | #################### 20 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 21 | # 22 | # switches/@0/reset: 2 # [原始排序, 常用字優先, 極常用字優先] 23 | # switches/@1/reset: 1 # [全漢字, 常用字] 24 | # switches/@2/reset: 1 # [字詞同出, 全碼出單] 25 | # switches/@3/reset: 1 # [原始排序, 全碼後置] 26 | # switches/@4/reset: 1 # [隱藏注解, 二重注解, 多重註解] 27 | # switches/@5/reset: 1 # [輸入預測, 精確匹配] 28 | # switches/@6/reset: 1 # [简保持, 简转繁] 29 | # switches/@7/reset: 1 # [繁保持, 繁轉簡] 30 | # switches/@8/reset: 1 # [中文, 西文] 31 | # switches/@9/reset: 1 # [半角, 全角] 32 | # switches/@10/reset: 1 # [。,, .,] 33 | # 34 | ################ 35 | # 全碼後置設定 # 36 | ################ 37 | # 以下列出之漢字,出簡後,於全碼後置之.用户可自定義. 38 | # 39 | # yuhao_postpone_full_code/+: 40 | # selected_chars: "" # 後置漢字 41 | # max_index: 3 # 最大後置位置 42 | -------------------------------------------------------------------------------- /yulight/beta/custom/yulight_sc.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 宇浩·简体 # 方案名 8 | # menu/page_size: 9 # 每頁候選數量 9 | # style/horizontal: true # 橫排候選欄 10 | # style/inline_preedit: false # 候選欄内置於輸入界面 11 | # style/preedit_type: composition # 候選顯示字母(composition)还是候選(preview) 12 | # style/inline_candidate: false # MacOs 候選顯示字母(false)还是候選(true) 13 | # style/layout/margin_x: -1 # 關閉候選欄 Windows 14 | # style/alpha: 0.01 # 隱藏候選欄 Mac 15 | # speller/auto_select: true # 四碼唯一自動上屏 16 | # 17 | #################### 18 | # 控制開關默認設置 # 19 | #################### 20 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 21 | # 22 | # switches/@0/reset: 2 # [原始排序, 常用字優先, 極常用字優先] 23 | # switches/@1/reset: 1 # [全漢字, 常用字, 通规字] 24 | # switches/@2/reset: 1 # [字詞同出, 全碼出單] 25 | # switches/@3/reset: 1 # [原始排序, 全碼後置] 26 | # switches/@4/reset: 1 # [隱藏注解, 二重注解, 多重註解] 27 | # switches/@5/reset: 1 # [輸入預測, 精確匹配] 28 | # switches/@6/reset: 1 # [简保持, 简转繁] 29 | # switches/@7/reset: 1 # [繁保持, 繁轉簡] 30 | # switches/@8/reset: 1 # [中文, 西文] 31 | # switches/@9/reset: 1 # [半角, 全角] 32 | # switches/@10/reset: 1 # [。,, .,] 33 | # 34 | ################ 35 | # 全碼後置設定 # 36 | ################ 37 | # 以下列出之漢字,出簡後,於全碼後置之.用户可自定義. 38 | # 39 | # yuhao_postpone_full_code/+: 40 | # selected_chars: "" # 後置漢字 41 | # max_index: 3 # 最大後置位置 42 | -------------------------------------------------------------------------------- /yuling/beta/custom/yuling.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 靈明輸入法 # 方案名 8 | # menu/page_size: 6 # 每頁候選數量 9 | # style/horizontal: true # Windows 橫排候選欄 10 | # style/candidate_list_layout: linear # MacOS 橫排候選欄 11 | # style/inline_preedit: false # 候選欄内置於輸入界面(true)还是独立界面(false) 12 | # style/preedit_type: preview # 候選顯示字母(composition)还是候選(preview) 13 | # style/inline_candidate: true # MacOS 候選顯示字母(false)还是候選(true) 14 | # style/layout/margin_x: -1 # Windows 關閉候選欄 15 | # style/alpha: 0.01 # MacOS 隱藏候選欄 16 | # font_face: Yuniversus, Arial, TH-Tshyn-P0, TH-Tshyn-P1, TH-Tshyn-P2 # 字體 17 | # 18 | # speller/auto_select: false # 自動選擇唯一候選項(true)或否(false) 19 | # 20 | #################### 21 | # 控制開關默認設置 # 22 | #################### 23 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 24 | # 25 | # switches/@0/reset: 0 # [原始排序, 常用字先, 簡化字先, 傳統字先] 26 | # switches/@1/reset: 1 # [全部漢字, 僅常用字, 僅簡化字, 僅傳統字] 27 | # switches/@2/reset: 1 # [字詞同出, 全碼出單] 28 | # switches/@3/reset: 2 # [隱藏注解, 二重注解, 多重註解] 29 | # switches/@4/reset: 1 # [預測提示, 精確匹配] 30 | # switches/@5/reset: 1 # [有空格簡, 無空格簡] 31 | # switches/@6/reset: 1 # [陸標拆分, 臺標拆分] 32 | # switches/@7/reset: 1 # [简保持, 简转繁] 33 | # switches/@8/reset: 1 # [繁保持, 繁轉簡] 34 | # switches/@9/reset: 1 # [中文, 西文] 35 | # switches/@10/reset: 1 # [半角, 全角] 36 | # switches/@11/reset: 1 # [。,, .,] -------------------------------------------------------------------------------- /yustar/beta/custom/yustar.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 宇浩·星陳 # 方案名 8 | # menu/page_size: 9 # 每頁候選數量 9 | # style/horizontal: true # 橫排候選欄 10 | # style/inline_preedit: false # 候選欄内置於輸入界面 11 | # style/preedit_type: composition # 候選顯示字母(composition)还是候選(preview) 12 | # style/inline_candidate: false # MacOs 候選顯示字母(false)还是候選(true) 13 | # style/layout/margin_x: -1 # 關閉候選欄 Windows 14 | # style/alpha: 0.01 # 隱藏候選欄 Mac 15 | # speller/auto_select: true # 四碼唯一自動上屏 16 | # 17 | #################### 18 | # 控制開關默認設置 # 19 | #################### 20 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 21 | # 22 | # switches/@0/reset: 2 # [原始排序, 常用字先, 簡化字先, 傳統字先] 23 | # switches/@1/reset: 1 # [全漢字, 常用字, 簡化字, 傳統字] 24 | # switches/@2/reset: 1 # [字詞同出, 全碼出單] 25 | # switches/@3/reset: 1 # [原始排序, 全碼後置] 26 | # switches/@4/reset: 1 # [隱藏注解, 二重注解, 多重註解] 27 | # switches/@5/reset: 1 # [輸入預測, 精確匹配] 28 | # switches/@6/reset: 1 # [简保持, 简转繁] 29 | # switches/@7/reset: 1 # [繁保持, 繁轉簡] 30 | # switches/@8/reset: 1 # [中文, 西文] 31 | # switches/@9/reset: 1 # [半角, 全角] 32 | # switches/@10/reset: 1 # [。,, .,] 33 | # 34 | ################ 35 | # 全碼後置設定 # 36 | ################ 37 | # 以下列出之漢字,出簡後,於全碼後置之.用户可自定義. 38 | # 39 | # yuhao_postpone_full_code/+: 40 | # selected_chars: "束嫌存猪炸暑睹睛只另乘津糊袍饱書諸后掏眨壓緒" # 後置漢字 41 | # max_index: 3 # 最大後置位置 42 | -------------------------------------------------------------------------------- /yustar/beta/custom/yustar_sc.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 宇浩·星陈·大陆简体 # 方案名 8 | # menu/page_size: 9 # 每頁候選數量 9 | # style/horizontal: true # 橫排候選欄 10 | # style/inline_preedit: false # 候選欄内置於輸入界面 11 | # style/preedit_type: composition # 候選顯示字母(composition)还是候選(preview) 12 | # style/inline_candidate: false # MacOs 候選顯示字母(false)还是候選(true) 13 | # style/layout/margin_x: -1 # 關閉候選欄 Windows 14 | # style/alpha: 0.01 # 隱藏候選欄 Mac 15 | # speller/auto_select: true # 四碼唯一自動上屏 16 | # 17 | #################### 18 | # 控制開關默認設置 # 19 | #################### 20 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 21 | # 22 | # switches/@0/reset: 2 # [原始排序, 常用字先, 簡化字先] 23 | # switches/@1/reset: 1 # [全漢字, 常用字, 簡化字] 24 | # switches/@2/reset: 1 # [字詞同出, 全碼出單] 25 | # switches/@3/reset: 1 # [原始排序, 全碼後置] 26 | # switches/@4/reset: 1 # [隱藏注解, 二重注解, 多重註解] 27 | # switches/@5/reset: 1 # [輸入預測, 精確匹配] 28 | # switches/@6/reset: 1 # [简保持, 简转繁] 29 | # switches/@7/reset: 1 # [繁保持, 繁轉簡] 30 | # switches/@8/reset: 1 # [中文, 西文] 31 | # switches/@9/reset: 1 # [半角, 全角] 32 | # switches/@10/reset: 1 # [。,, .,] 33 | # 34 | ################ 35 | # 全碼後置設定 # 36 | ################ 37 | # 以下列出之漢字,出簡後,於全碼後置之.用户可自定義. 38 | # 39 | # yuhao_postpone_full_code/+: 40 | # selected_chars: "束嫌存猪炸暑睹睛只另乘津糊袍饱書諸后掏眨壓緒" # 後置漢字 41 | # max_index: 3 # 最大後置位置 42 | -------------------------------------------------------------------------------- /yujoy/beta/trime/default.yaml: -------------------------------------------------------------------------------- 1 | # Rime default settings 2 | # encoding: utf-8 3 | 4 | config_version: '0.40' 5 | 6 | schema_list: 7 | 8 | switcher: 9 | caption: 〔方案選單〕 10 | hotkeys: 11 | - Control+grave 12 | - Control+Shift+grave 13 | - F4 14 | save_options: 15 | - full_shape 16 | - ascii_punct 17 | - simplification 18 | - extended_charset 19 | - zh_hant 20 | - zh_hans 21 | - zh_hant_tw 22 | fold_options: true 23 | abbreviate_options: true 24 | option_list_separator: '/' 25 | 26 | menu: 27 | page_size: 9 28 | 29 | punctuator: 30 | full_shape: 31 | __include: punctuation:/full_shape 32 | half_shape: 33 | __include: punctuation:/half_shape 34 | 35 | key_binder: 36 | bindings: 37 | __patch: 38 | - key_bindings:/emacs_editing 39 | - key_bindings:/move_by_word_with_tab 40 | - key_bindings:/paging_with_minus_equal 41 | - key_bindings:/paging_with_comma_period 42 | - key_bindings:/numbered_mode_switch 43 | 44 | recognizer: 45 | patterns: 46 | email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$" 47 | uppercase: "[A-Z][-_+.'0-9A-Za-z]*$" 48 | url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$" 49 | 50 | ascii_composer: 51 | good_old_caps_lock: true 52 | switch_key: 53 | Shift_L: inline_ascii 54 | Shift_R: commit_text 55 | Control_L: noop 56 | Control_R: noop 57 | Caps_Lock: clear 58 | Eisu_toggle: clear 59 | -------------------------------------------------------------------------------- /yulight/beta/trime/default.yaml: -------------------------------------------------------------------------------- 1 | # Rime default settings 2 | # encoding: utf-8 3 | 4 | config_version: '0.40' 5 | 6 | schema_list: 7 | 8 | switcher: 9 | caption: 〔方案選單〕 10 | hotkeys: 11 | - Control+grave 12 | - Control+Shift+grave 13 | - F4 14 | save_options: 15 | - full_shape 16 | - ascii_punct 17 | - simplification 18 | - extended_charset 19 | - zh_hant 20 | - zh_hans 21 | - zh_hant_tw 22 | fold_options: true 23 | abbreviate_options: true 24 | option_list_separator: '/' 25 | 26 | menu: 27 | page_size: 5 28 | 29 | punctuator: 30 | full_shape: 31 | __include: punctuation:/full_shape 32 | half_shape: 33 | __include: punctuation:/half_shape 34 | 35 | key_binder: 36 | bindings: 37 | __patch: 38 | - key_bindings:/emacs_editing 39 | - key_bindings:/move_by_word_with_tab 40 | - key_bindings:/paging_with_minus_equal 41 | - key_bindings:/paging_with_comma_period 42 | - key_bindings:/numbered_mode_switch 43 | 44 | recognizer: 45 | patterns: 46 | email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$" 47 | uppercase: "[A-Z][-_+.'0-9A-Za-z]*$" 48 | url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$" 49 | 50 | ascii_composer: 51 | good_old_caps_lock: true 52 | switch_key: 53 | Shift_L: inline_ascii 54 | Shift_R: commit_text 55 | Control_L: noop 56 | Control_R: noop 57 | Caps_Lock: clear 58 | Eisu_toggle: clear 59 | -------------------------------------------------------------------------------- /yuling/beta/trime/default.yaml: -------------------------------------------------------------------------------- 1 | # Rime default settings 2 | # encoding: utf-8 3 | 4 | config_version: '0.40' 5 | 6 | schema_list: 7 | 8 | switcher: 9 | caption: 〔方案選單〕 10 | hotkeys: 11 | - Control+grave 12 | - Control+Shift+grave 13 | - F4 14 | save_options: 15 | - full_shape 16 | - ascii_punct 17 | - simplification 18 | - extended_charset 19 | - zh_hant 20 | - zh_hans 21 | - zh_hant_tw 22 | fold_options: true 23 | abbreviate_options: true 24 | option_list_separator: '/' 25 | 26 | menu: 27 | page_size: 9 28 | 29 | punctuator: 30 | full_shape: 31 | __include: punctuation:/full_shape 32 | half_shape: 33 | __include: punctuation:/half_shape 34 | 35 | key_binder: 36 | bindings: 37 | __patch: 38 | - key_bindings:/emacs_editing 39 | - key_bindings:/move_by_word_with_tab 40 | - key_bindings:/paging_with_minus_equal 41 | - key_bindings:/paging_with_comma_period 42 | - key_bindings:/numbered_mode_switch 43 | 44 | recognizer: 45 | patterns: 46 | email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$" 47 | uppercase: "[A-Z][-_+.'0-9A-Za-z]*$" 48 | url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$" 49 | 50 | ascii_composer: 51 | good_old_caps_lock: true 52 | switch_key: 53 | Shift_L: inline_ascii 54 | Shift_R: commit_text 55 | Control_L: noop 56 | Control_R: noop 57 | Caps_Lock: clear 58 | Eisu_toggle: clear 59 | -------------------------------------------------------------------------------- /yuming/beta/trime/default.yaml: -------------------------------------------------------------------------------- 1 | # Rime default settings 2 | # encoding: utf-8 3 | 4 | config_version: '0.40' 5 | 6 | schema_list: 7 | 8 | switcher: 9 | caption: 〔方案選單〕 10 | hotkeys: 11 | - Control+grave 12 | - Control+Shift+grave 13 | - F4 14 | save_options: 15 | - full_shape 16 | - ascii_punct 17 | - simplification 18 | - extended_charset 19 | - zh_hant 20 | - zh_hans 21 | - zh_hant_tw 22 | fold_options: true 23 | abbreviate_options: true 24 | option_list_separator: '/' 25 | 26 | menu: 27 | page_size: 9 28 | 29 | punctuator: 30 | full_shape: 31 | __include: punctuation:/full_shape 32 | half_shape: 33 | __include: punctuation:/half_shape 34 | 35 | key_binder: 36 | bindings: 37 | __patch: 38 | - key_bindings:/emacs_editing 39 | - key_bindings:/move_by_word_with_tab 40 | - key_bindings:/paging_with_minus_equal 41 | - key_bindings:/paging_with_comma_period 42 | - key_bindings:/numbered_mode_switch 43 | 44 | recognizer: 45 | patterns: 46 | email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$" 47 | uppercase: "[A-Z][-_+.'0-9A-Za-z]*$" 48 | url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$" 49 | 50 | ascii_composer: 51 | good_old_caps_lock: true 52 | switch_key: 53 | Shift_L: inline_ascii 54 | Shift_R: commit_text 55 | Control_L: noop 56 | Control_R: noop 57 | Caps_Lock: clear 58 | Eisu_toggle: clear 59 | -------------------------------------------------------------------------------- /yustar/beta/trime/default.yaml: -------------------------------------------------------------------------------- 1 | # Rime default settings 2 | # encoding: utf-8 3 | 4 | config_version: '0.40' 5 | 6 | schema_list: 7 | 8 | switcher: 9 | caption: 〔方案選單〕 10 | hotkeys: 11 | - Control+grave 12 | - Control+Shift+grave 13 | - F4 14 | save_options: 15 | - full_shape 16 | - ascii_punct 17 | - simplification 18 | - extended_charset 19 | - zh_hant 20 | - zh_hans 21 | - zh_hant_tw 22 | fold_options: true 23 | abbreviate_options: true 24 | option_list_separator: '/' 25 | 26 | menu: 27 | page_size: 5 28 | 29 | punctuator: 30 | full_shape: 31 | __include: punctuation:/full_shape 32 | half_shape: 33 | __include: punctuation:/half_shape 34 | 35 | key_binder: 36 | bindings: 37 | __patch: 38 | - key_bindings:/emacs_editing 39 | - key_bindings:/move_by_word_with_tab 40 | - key_bindings:/paging_with_minus_equal 41 | - key_bindings:/paging_with_comma_period 42 | - key_bindings:/numbered_mode_switch 43 | 44 | recognizer: 45 | patterns: 46 | email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$" 47 | uppercase: "[A-Z][-_+.'0-9A-Za-z]*$" 48 | url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$" 49 | 50 | ascii_composer: 51 | good_old_caps_lock: true 52 | switch_key: 53 | Shift_L: inline_ascii 54 | Shift_R: commit_text 55 | Control_L: noop 56 | Control_R: noop 57 | Caps_Lock: clear 58 | Eisu_toggle: clear 59 | -------------------------------------------------------------------------------- /yustar/beta/custom/yustar_tw.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 宇浩·星陳·臺灣正體 # 方案名 8 | # menu/page_size: 9 # 每頁候選數量 9 | # style/horizontal: true # 橫排候選欄 10 | # style/inline_preedit: false # 候選欄内置於輸入界面 11 | # style/preedit_type: composition # 候選顯示字母(composition)还是候選(preview) 12 | # style/inline_candidate: false # MacOs 候選顯示字母(false)还是候選(true) 13 | # style/layout/margin_x: -1 # 關閉候選欄 Windows 14 | # style/alpha: 0.01 # 隱藏候選欄 Mac 15 | # speller/auto_select: true # 四碼唯一自動上屏 16 | # 17 | #################### 18 | # 控制開關默認設置 # 19 | #################### 20 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 21 | # 22 | # switches/@0/reset: 2 # [原始排序, 常用字優先, 極常用字優先] 23 | # switches/@1/reset: 1 # [全漢字, 常用字, 通规字, 傳統字] 24 | # switches/@2/reset: 1 # [字詞同出, 全碼出單] 25 | # switches/@3/reset: 1 # [原始排序, 全碼後置] 26 | # switches/@4/reset: 1 # [隱藏注解, 二重注解, 多重註解] 27 | # switches/@5/reset: 1 # [輸入預測, 精確匹配] 28 | # switches/@6/reset: 1 # [简保持, 简转繁] 29 | # switches/@7/reset: 1 # [繁保持, 繁轉簡] 30 | # switches/@8/reset: 1 # [中文, 西文] 31 | # switches/@9/reset: 1 # [半角, 全角] 32 | # switches/@10/reset: 1 # [。,, .,] 33 | # switches/@11/reset: 1 # [繁簡混頻, 正體優先] 34 | # 35 | ################ 36 | # 全碼後置設定 # 37 | ################ 38 | # 以下列出之漢字,出簡後,於全碼後置之.用户可自定義. 39 | # 40 | # yuhao_postpone_full_code/+: 41 | # selected_chars: "束嫌存猪炸暑睹睛只另乘津糊袍饱書諸后掏眨壓緒" # 後置漢字 42 | # max_index: 3 # 最大後置位置 43 | -------------------------------------------------------------------------------- /yujoy/beta/custom/yujoy_tw.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 卿雲爛兮·臺灣正體 # 方案名 8 | # menu/page_size: 9 # 每頁候選數量 9 | # style/horizontal: true # 橫排候選欄 10 | # style/inline_preedit: false # 候選欄内置於輸入界面 11 | # style/preedit_type: composition # 候選顯示字母(composition)还是候選(preview) 12 | # style/inline_candidate: false # MacOs 候選顯示字母(false)还是候選(true) 13 | # style/layout/margin_x: -1 # 關閉候選欄 Windows 14 | # style/alpha: 0.01 # 隱藏候選欄 Mac 15 | # font_face: Yuniversus, WenJinMinchoP0-Regular, WenJinMinchoP2-Regular, WenJinMinchoP3-Regular, TH-Tshyn-P0, TH-Tshyn-P1, TH-Tshyn-P2 # 字體 16 | # speller/auto_select: true # 四碼唯一自動上屏 17 | # 18 | #################### 19 | # 控制開關默認設置 # 20 | #################### 21 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 22 | # 23 | # switches/@0/reset: 1 # [原始排序, 常用字優先, 極常用字優先] 24 | # switches/@1/reset: 1 # [全漢字, 常用字] 25 | # switches/@2/reset: 1 # [字詞同出, 全碼出單] 26 | # switches/@3/reset: 1 # [原始排序, 全碼後置] 27 | # switches/@4/reset: 1 # [隱藏注解, 二重注解, 多重註解] 28 | # switches/@5/reset: 1 # [輸入預測, 精確匹配] 29 | # switches/@6/reset: 1 # [简保持, 简转繁] 30 | # switches/@7/reset: 1 # [繁保持, 繁轉簡] 31 | # switches/@8/reset: 1 # [中文, 西文] 32 | # switches/@9/reset: 1 # [半角, 全角] 33 | # switches/@10/reset: 1 # [。,, .,] 34 | # 35 | ################ 36 | # 全碼後置設定 # 37 | ################ 38 | ## 以下列出之漢字,出簡後,於全碼後置之.用户可自定義. 39 | ## 需要全碼後置的漢字列表,缺省時默認後置所有. 40 | # yuhao_postpone_full_code/+: 41 | # selected_chars: "束員员冻近寒凍准" # 後置漢字 42 | # max_index: 3 # 最大後置位置 43 | -------------------------------------------------------------------------------- /yujoy/beta/custom/yujoy_sc.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 卿雲爛兮·大陆简体 # 方案名 8 | # menu/page_size: 9 # 每頁候選數量 9 | # style/horizontal: true # 橫排候選欄 10 | # style/inline_preedit: false # 候選欄内置於輸入界面 11 | # style/preedit_type: composition # 候選顯示字母(composition)还是候選(preview) 12 | # style/inline_candidate: false # MacOs 候選顯示字母(false)还是候選(true) 13 | # style/layout/margin_x: -1 # 關閉候選欄 Windows 14 | # style/alpha: 0.01 # 隱藏候選欄 Mac 15 | # font_face: Yuniversus, WenJinMinchoP0-Regular, WenJinMinchoP2-Regular, WenJinMinchoP3-Regular, TH-Tshyn-P0, TH-Tshyn-P1, TH-Tshyn-P2 # 字體 16 | # speller/auto_select: true # 四碼唯一自動上屏 17 | # 18 | #################### 19 | # 控制開關默認設置 # 20 | #################### 21 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 22 | # 23 | # switches/@0/reset: 1 # [原始排序, 常用字優先, 極常用字優先] 24 | # switches/@1/reset: 1 # [全漢字, 常用字, 通规字] 25 | # switches/@2/reset: 1 # [字詞同出, 全碼出單] 26 | # switches/@3/reset: 1 # [原始排序, 全碼後置] 27 | # switches/@4/reset: 1 # [隱藏注解, 二重注解, 多重註解] 28 | # switches/@5/reset: 1 # [輸入預測, 精確匹配] 29 | # switches/@6/reset: 1 # [简保持, 简转繁] 30 | # switches/@7/reset: 1 # [繁保持, 繁轉簡] 31 | # switches/@8/reset: 1 # [中文, 西文] 32 | # switches/@9/reset: 1 # [半角, 全角] 33 | # switches/@10/reset: 1 # [。,, .,] 34 | # 35 | ################ 36 | # 全碼後置設定 # 37 | ################ 38 | ## 以下列出之漢字,出簡後,於全碼後置之.用户可自定義. 39 | ## 需要全碼後置的漢字列表,缺省時默認後置所有. 40 | # yuhao_postpone_full_code/+: 41 | # selected_chars: "束員员冻近寒凍准" # 後置漢字 42 | # max_index: 3 # 最大後置位置 43 | -------------------------------------------------------------------------------- /yujoy/beta/custom/yujoy.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 卿雲爛兮 # 方案名 8 | # menu/page_size: 9 # 每頁候選數量 9 | # style/horizontal: true # 橫排候選欄 10 | # style/inline_preedit: false # 候選欄内置於輸入界面 11 | # style/preedit_type: composition # 候選顯示字母(composition)还是候選(preview) 12 | # style/inline_candidate: false # MacOs 候選顯示字母(false)还是候選(true) 13 | # style/layout/margin_x: -1 # 關閉候選欄 Windows 14 | # style/alpha: 0.01 # 隱藏候選欄 Mac 15 | # font_face: Yuniversus, WenJinMinchoP0-Regular, WenJinMinchoP2-Regular, WenJinMinchoP3-Regular, TH-Tshyn-P0, TH-Tshyn-P1, TH-Tshyn-P2 # 字體 16 | # speller/auto_select: true # 四碼唯一自動上屏 17 | # 18 | #################### 19 | # 控制開關默認設置 # 20 | #################### 21 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 22 | # 23 | # switches/@0/reset: 1 # [平衡字頻, 簡體優先] 24 | # switches/@1/reset: 1 # [原始排序, 常用字優先, 極常用字優先] 25 | # switches/@2/reset: 1 # [全漢字, 常用字, 通规字, 陸繁字] 26 | # switches/@3/reset: 1 # [字詞同出, 全碼出單] 27 | # switches/@4/reset: 1 # [原始排序, 全碼後置] 28 | # switches/@5/reset: 1 # [隱藏注解, 二重注解, 多重註解] 29 | # switches/@6/reset: 1 # [輸入預測, 精確匹配] 30 | # switches/@7/reset: 1 # [简保持, 简转繁] 31 | # switches/@8/reset: 1 # [繁保持, 繁轉簡] 32 | # switches/@9/reset: 1 # [中文, 西文] 33 | # switches/@10/reset: 1 # [半角, 全角] 34 | # switches/@11/reset: 1 # [。,, .,] 35 | # 36 | ################ 37 | # 全碼後置設定 # 38 | ################ 39 | ## 以下列出之漢字,出簡後,於全碼後置之.用户可自定義. 40 | ## 需要全碼後置的漢字列表,缺省時默認後置所有. 41 | # yuhao_postpone_full_code/+: 42 | # selected_chars: "束員员冻凍准" # 後置漢字 43 | # max_index: 3 # 最大後置位置 44 | -------------------------------------------------------------------------------- /yuming/beta/custom/yuming_tw.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 日月·傳統 # 方案名 8 | # menu/page_size: 6 # 每頁候選數量 9 | # style/horizontal: true # Windows 橫排候選欄 10 | # style/candidate_list_layout: linear # MacOS 橫排候選欄 11 | # style/inline_preedit: false # 候選欄内置於輸入界面(true)还是独立界面(false) 12 | # style/preedit_type: preview # 候選顯示字母(composition)还是候選(preview) 13 | # style/inline_candidate: true # MacOS 候選顯示字母(false)还是候選(true) 14 | # style/layout/margin_x: -1 # Windows 關閉候選欄 15 | # style/alpha: 0.01 # MacOS 隱藏候選欄 16 | # font_face: Yuniversus, WenJinMinchoP0-Regular, WenJinMinchoP2-Regular, WenJinMinchoP3-Regular, TH-Tshyn-P0, TH-Tshyn-P1, TH-Tshyn-P2 # 字體 17 | # 18 | # speller/auto_select: false # 自動選擇唯一候選項(true)或否(false) 19 | # 20 | #################### 21 | # 控制開關默認設置 # 22 | #################### 23 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 24 | # 25 | # switches/@0/reset: 1 # [原始排序, 常用字優先] 26 | # switches/@1/reset: 1 # [全部漢字, 僅常用字, 僅傳統字] 27 | # switches/@2/reset: 1 # [字詞同出, 全碼出單] 28 | # switches/@3/reset: 2 # [隱藏注解, 二重注解, 多重註解] 29 | # switches/@4/reset: 1 # [預測提示, 精確匹配] 30 | # switches/@5/reset: 1 # [有空格簡, 無空格簡] 31 | # switches/@6/reset: 1 # [陸標拆分, 臺標拆分] 32 | # switches/@7/reset: 1 # [简保持, 简转繁] 33 | # switches/@8/reset: 1 # [繁保持, 繁轉簡] 34 | # switches/@9/reset: 1 # [中文, 西文] 35 | # switches/@10/reset: 1 # [半角, 全角] 36 | # switches/@11/reset: 1 # [。,, .,] 37 | # 38 | ################ 39 | # 全碼長度設置 # 40 | ################ 41 | ## 改成全碼六碼, 提高全局精確度 42 | # speller/algebra: 43 | # - xform/^([a-z]{1,6})[a-z]*$/$1/ -------------------------------------------------------------------------------- /yuming/beta/custom/yuming.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 大明輸入法 # 方案名 8 | # menu/page_size: 6 # 每頁候選數量 9 | # style/horizontal: true # Windows 橫排候選欄 10 | # style/candidate_list_layout: linear # MacOS 橫排候選欄 11 | # style/inline_preedit: false # 候選欄内置於輸入界面(true)还是独立界面(false) 12 | # style/preedit_type: preview # 候選顯示字母(composition)还是候選(preview) 13 | # style/inline_candidate: true # MacOS 候選顯示字母(false)还是候選(true) 14 | # style/layout/margin_x: -1 # Windows 關閉候選欄 15 | # style/alpha: 0.01 # MacOS 隱藏候選欄 16 | # font_face: Yuniversus, WenJinMinchoP0-Regular, WenJinMinchoP2-Regular, WenJinMinchoP3-Regular, TH-Tshyn-P0, TH-Tshyn-P1, TH-Tshyn-P2 # 字體 17 | # 18 | # speller/auto_select: false # 自動選擇唯一候選項(true)或否(false) 19 | # 20 | #################### 21 | # 控制開關默認設置 # 22 | #################### 23 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 24 | # 25 | # switches/@0/reset: 1 # [原始排序, 常用字優先] 26 | # switches/@1/reset: 1 # [全部漢字, 僅常用字, 僅簡化字, 僅傳統字] 27 | # switches/@2/reset: 1 # [字詞同出, 全碼出單] 28 | # switches/@3/reset: 2 # [隱藏注解, 二重注解, 多重註解] 29 | # switches/@4/reset: 1 # [預測提示, 精確匹配] 30 | # switches/@5/reset: 1 # [有空格簡, 無空格簡] 31 | # switches/@6/reset: 1 # [陸標拆分, 臺標拆分] 32 | # switches/@7/reset: 1 # [简保持, 简转繁] 33 | # switches/@8/reset: 1 # [繁保持, 繁轉簡] 34 | # switches/@9/reset: 1 # [中文, 西文] 35 | # switches/@10/reset: 1 # [半角, 全角] 36 | # switches/@11/reset: 1 # [。,, .,] 37 | # 38 | ################ 39 | # 全碼長度設置 # 40 | ################ 41 | ## 改成全碼六碼, 提高全局精確度 42 | # speller/algebra: 43 | # - xform/^([a-z]{1,6})[a-z]*$/$1/ -------------------------------------------------------------------------------- /yulight/beta/mabiao/baidu/宇浩简体简码版.conf: -------------------------------------------------------------------------------- 1 | [InputMethod] 2 | Name=宇浩输入法 3 | Icon=fcitx-yuhao 4 | Label=宇浩输入法 5 | LangCode=zh_CN 6 | Addon=table 7 | Configurable=True 8 | 9 | [Table] 10 | File=/usr/share/libime/yuhao.dict 11 | # 页大小 12 | PageSize=5 13 | # 自动选择候选词之后提交 14 | CommitAfterSelect=True 15 | # 取消激活输入法时提交输入缓冲区 16 | CommitWhenDeactivate=True 17 | # 提交无效分段 18 | CommitInvalidSegment=False 19 | # 使用全角字符 20 | UseFullWidth=False 21 | # 忽略内置标点 22 | IgnorePunc=False 23 | # 将第一个候选词作为预编辑文本 24 | FirstCandidateAsPreedit=False 25 | # 快速输入的触发键 26 | QuickPhraseKey= 27 | # 触发快速输入的文本 28 | QuickPhraseText=ABCDEFGHIJLKLMNOPQRSTUVWXY 29 | # 不对短于...的词排序 30 | NoSortInputLength=2 31 | # 排序规则 32 | OrderPolicy=No 33 | # 使用系统语言模型 34 | UseSystemLanguageModel=False 35 | # 根据当前上下文排序候选词 36 | UseContextRelatedOrder=False 37 | # 模糊键 38 | MatchingKey= 39 | # 触发拼音的前缀键 40 | PinyinKey=z 41 | # 自动选择候选词 42 | AutoSelect=True 43 | # 选择唯一候选词的长度限制 44 | AutoSelectLength=-1 45 | # 选择唯一候选词的正则表达式 46 | AutoSelectRegex= 47 | # 没有匹配时自动选择 48 | NoMatchAutoSelectLength=-1 49 | # 没有匹配时自动选择的正则表达式 50 | NoMatchAutoSelectRegex= 51 | # 自动词组长度 52 | AutoPhraseLength=0 53 | # 在输入...次后保存自动组词 54 | SaveAutoPhraseAfter=-8 55 | # 精确匹配 56 | ExactMatch=True 57 | # 学习 58 | Learning=False 59 | # 显示词的提示 60 | Hint=False 61 | # 显示自定义提示 62 | DisplayCustomHint=False 63 | # 提示和候选词之间的分隔符文本 64 | HintSeparator= 65 | # 候选词列表方向 66 | CandidateLayoutHint=Horizontal 67 | 68 | [Table/PrevPage] 69 | 0=Up 70 | 1=minus 71 | 72 | [Table/NextPage] 73 | 0=Down 74 | 1=equal 75 | 76 | [Table/PrevCandidate] 77 | 0=Left 78 | 79 | [Table/NextCandidate] 80 | 0=Right 81 | 82 | [Table/SecondCandidate] 83 | 0=semicolon 84 | 85 | [Table/ThirdCandidate] 86 | 0=apostrophe 87 | -------------------------------------------------------------------------------- /yulight/beta/mabiao/baidu/宇浩繁體簡碼版.conf: -------------------------------------------------------------------------------- 1 | [InputMethod] 2 | Name=宇浩輸入法·傳統漢字簡碼 3 | Icon=fcitx-yuhao 4 | Label=宇浩輸入法·傳統漢字簡碼 5 | LangCode=zh_CN 6 | Addon=table 7 | Configurable=True 8 | 9 | [Table] 10 | File=/usr/share/libime/yuhao_tradition.dict 11 | # 页大小 12 | PageSize=5 13 | # 自动选择候选词之后提交 14 | CommitAfterSelect=True 15 | # 取消激活输入法时提交输入缓冲区 16 | CommitWhenDeactivate=True 17 | # 提交无效分段 18 | CommitInvalidSegment=False 19 | # 使用全角字符 20 | UseFullWidth=False 21 | # 忽略内置标点 22 | IgnorePunc=False 23 | # 将第一个候选词作为预编辑文本 24 | FirstCandidateAsPreedit=False 25 | # 快速输入的触发键 26 | QuickPhraseKey= 27 | # 触发快速输入的文本 28 | QuickPhraseText=ABCDEFGHIJLKLMNOPQRSTUVWXY 29 | # 不对短于...的词排序 30 | NoSortInputLength=2 31 | # 排序规则 32 | OrderPolicy=No 33 | # 使用系统语言模型 34 | UseSystemLanguageModel=False 35 | # 根据当前上下文排序候选词 36 | UseContextRelatedOrder=False 37 | # 模糊键 38 | MatchingKey= 39 | # 触发拼音的前缀键 40 | PinyinKey=z 41 | # 自动选择候选词 42 | AutoSelect=True 43 | # 选择唯一候选词的长度限制 44 | AutoSelectLength=-1 45 | # 选择唯一候选词的正则表达式 46 | AutoSelectRegex= 47 | # 没有匹配时自动选择 48 | NoMatchAutoSelectLength=-1 49 | # 没有匹配时自动选择的正则表达式 50 | NoMatchAutoSelectRegex= 51 | # 自动词组长度 52 | AutoPhraseLength=0 53 | # 在输入...次后保存自动组词 54 | SaveAutoPhraseAfter=-8 55 | # 精确匹配 56 | ExactMatch=True 57 | # 学习 58 | Learning=False 59 | # 显示词的提示 60 | Hint=False 61 | # 显示自定义提示 62 | DisplayCustomHint=False 63 | # 提示和候选词之间的分隔符文本 64 | HintSeparator= 65 | # 候选词列表方向 66 | CandidateLayoutHint=Horizontal 67 | 68 | [Table/PrevPage] 69 | 0=Up 70 | 1=minus 71 | 72 | [Table/NextPage] 73 | 0=Down 74 | 1=equal 75 | 76 | [Table/PrevCandidate] 77 | 0=Left 78 | 79 | [Table/NextCandidate] 80 | 0=Right 81 | 82 | [Table/SecondCandidate] 83 | 0=semicolon 84 | 85 | [Table/ThirdCandidate] 86 | 0=apostrophe 87 | -------------------------------------------------------------------------------- /yulight/build_release.py: -------------------------------------------------------------------------------- 1 | # %% 2 | 3 | from datetime import datetime 4 | import time 5 | 6 | # version = datetime.today().strftime('%Y%m%d') 7 | import shutil 8 | from shutil import copyfile, make_archive 9 | import os 10 | from distutils.dir_util import copy_tree 11 | from distutils.dir_util import remove_tree 12 | import re 13 | 14 | version = "v3.10.3-beta.20251218" 15 | 16 | # %% 17 | try: 18 | remove_tree("./dist/yulight") 19 | except: 20 | print("Cannot remove dist/yulight folder!") 21 | 22 | try: 23 | os.makedirs("./dist/yulight") 24 | except: 25 | print("Cannot create dist/yulight folder!") 26 | 27 | if re.match(r"^v\d+.\d+.\d+$", version): 28 | shutil.copyfile( 29 | "./beta/schema/yuhao/yulight.full.dict.yaml", f"./dist/yulight.full.dict.yaml" 30 | ) 31 | 32 | # %% 33 | os.makedirs("./dist/yulight/schema/yuhao") 34 | # copyfile("./yulight.png", f"./dist/yulight/yulight_{version}.png") 35 | copyfile("./beta/readme.md", "./dist/yulight/readme.txt") 36 | copyfile("../yujoy/beta/schema/yuhao.essay.txt", "./beta/schema/yuhao.essay.txt") 37 | 38 | copy_tree("./beta/mabiao", "./dist/yulight/mabiao") 39 | copy_tree("./beta/schema", "./dist/yulight/schema") 40 | copy_tree("./beta/trime", "./dist/yulight/trime") 41 | copy_tree("./beta/custom", "./dist/yulight/custom") 42 | 43 | copy_tree("../lua/", "./dist/yulight/schema/lua/") 44 | 45 | # %% 46 | # Hamster IME 47 | make_archive(f"../dist/hamster/光華輸入法_{version}", "zip", "./dist/yulight/schema") 48 | 49 | # %% 50 | # Make zip 51 | make_archive(f"../dist/光華輸入法_{version}", "zip", "./dist/yulight") 52 | # copyfile(f"../dist/宇浩光華_{version}.zip", f"../dist/yuhao_light_{version}.zip") 53 | 54 | print(f"成功發佈光華輸入法 {version}!") 55 | # %% 56 | -------------------------------------------------------------------------------- /yujoy/beta/custom/yujoy_fluency.custom.yaml: -------------------------------------------------------------------------------- 1 | # 功能開關一鍵配置 2 | 3 | patch: 4 | ################ 5 | # 外觀默認設置 # 6 | ################ 7 | # schema/name: 卿雲·全碼連打 # 方案名 8 | # menu/page_size: 9 # 每頁候選數量 9 | # style/horizontal: true # 橫排候選欄 10 | # style/inline_preedit: false # 候選欄内置於輸入界面 11 | # style/preedit_type: composition # 候選顯示字母(composition)还是候選(preview) 12 | # style/inline_candidate: false # MacOs 候選顯示字母(false)还是候選(true) 13 | # style/layout/margin_x: -1 # 關閉候選欄 Windows 14 | # style/alpha: 0.01 # 隱藏候選欄 Mac 15 | # font_face: Yuniversus, WenJinMinchoP0-Regular, WenJinMinchoP2-Regular, WenJinMinchoP3-Regular, TH-Tshyn-P0, TH-Tshyn-P1, TH-Tshyn-P2 # 字體 16 | # yujoy_full/enable_completion: false # 關閉詞語預測 17 | # yuhao_auto_select_in_fluency_mode/max_chars: 8 # 候選區最大字數(自動上屏) 18 | # 19 | #################### 20 | # 控制開關默認設置 # 21 | #################### 22 | # 以下開關,0爲第一個,1爲第二個,2爲第三個 23 | # 24 | # switches/@0/reset: 1 # [隱藏注解, 二重注解, 多重註解] 25 | # switches/@1/reset: 1 # [全漢字, 常用字, 通规字, 陸標繁] 26 | # switches/@2/reset: 1 # [简保持, 简转繁] 27 | # switches/@3/reset: 1 # [繁保持, 繁轉簡] 28 | # switches/@4/reset: 1 # [輸入預測, 精確匹配] 29 | # switches/@5/reset: 1 # [中文, 西文] 30 | # switches/@6/reset: 1 # [半角, 全角] 31 | # switches/@7/reset: 1 # [。,, .,] 32 | # 33 | ################ 34 | # 允許空格分詞 # 35 | ################ 36 | # engine/processors/+: 37 | # - fluency_editor 38 | # 39 | ############## 40 | # 翻譯器開關 # 41 | ############## 42 | # engine/translators: 43 | # - punct_translator 44 | # - table_translator@yujoy # 四碼定長主方案 45 | # - script_translator # 常用字連續輸入 46 | # - script_translator@translator_extended # 全字集連續輸入 47 | # - script_translator@pinyin # 全拼 48 | # - table_translator@yujoy_full # 長詞聯想預測輸入 49 | # - lua_translator@*yuhao.yuhao_switch_tr@yuhao_macro # 控制臺 50 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_hide_space_candidates.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- Name: yuhao_hide_space_candidates.lua 3 | -- 名稱: 過濾空格上屏簡碼字 4 | -- Version: 20251217 5 | -- Author: 朱宇浩 6 | -- Github: https://github.com/forFudan/ 7 | -- 版權聲明: 8 | -- 專爲宇浩系列輸入法製作 9 | -- 轉載請保留作者名和出處 10 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 11 | --------------------------------------- 12 | 13 | 介紹: 14 | 本開關開啟後,所有的空格上屏簡碼字將全部被屏蔽. 15 | 16 | 版本: 17 | 20250810: 初版. 18 | 20251217: 可以指定最大碼長,默認5碼. 19 | --------------------------- 20 | --]] 21 | 22 | local this = {} 23 | 24 | function this.init(env) 25 | local config = env.engine.schema.config 26 | env.max_code_length = config:get_int("schema_name/max_code_length") or 5 27 | end 28 | 29 | function this.func(input, env) 30 | local context = env.engine.context 31 | if not context:get_option("yuhao_hide_space_candidates") then 32 | for cand in input:iter() do 33 | yield(cand) 34 | end 35 | elseif env.engine.context.input:match("^[z/`]") then 36 | for cand in input:iter() do 37 | yield(cand) 38 | end 39 | else 40 | if string.len(env.engine.context.input) < env.max_code_length then 41 | for cand in input:iter() do 42 | if cand.type == "punct" then 43 | yield(cand) 44 | elseif cand.type ~= "completion" then 45 | if env.engine.context.input:match("[aeiou]$") then 46 | yield(cand) 47 | end 48 | else 49 | yield(cand) 50 | end 51 | end 52 | else 53 | for cand in input:iter() do 54 | yield(cand) 55 | end 56 | end 57 | end 58 | end 59 | 60 | return this -------------------------------------------------------------------------------- /lua/yuhao/yuhao_unicode_input.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- Name: yuhao_unicode_input.lua 3 | -- 名稱: Unicode 輸入 4 | -- Version: 20250716 5 | -- Author: forFudan 朱宇浩 6 | -- Github: https://github.com/forFudan/ 7 | -- Purpose: 處理 Unicode 輸入 8 | -- 版權聲明: 9 | -- 專爲宇浩輸入法製作 10 | -- 轉載請保留作者名和出處 11 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 12 | --------------------------------------- 13 | 14 | 介紹: 15 | 這個 lua 腳本處理 Unicode 輸入,允許用戶輸入 Unicode 字符的十六進制編碼. 16 | 引導符號是 '='. 用户可以輸入鍵盤上兩排字母來輸入 Unicode 字符. 17 | 例如,輸入 'q' 將輸入 '1', 輸入 'w' 將輸入 '2', 輸入 'a' 將輸入 'a', 依此類推. 18 | 19 | 版本: 20 | 20250716: 初版. 21 | --------------------------- 22 | --]] 23 | 24 | local function filter(input, env) 25 | local input_text = env.engine.context.input 26 | if input_text:match("^%=$") then 27 | yield(Candidate("unicode", 1, 5, "=", "等於號")) 28 | elseif input_text:match("^%=[qwertyuiopasdfgh]+") then 29 | local mapping = { 30 | q = "1", w = "2", e = "3", r = "4", t = "5", 31 | y = "6", u = "7", i = "8", o = "9", p = "0", 32 | a = "a", s = "b", d = "c", f = "d", g = "e", h = "f" 33 | } 34 | local raw_unicode = input_text:sub(2) 35 | local valid_unicode = raw_unicode:gsub(".", function(char) 36 | return mapping[char] or char 37 | end) 38 | local unicode_str = string.format("0x%s", valid_unicode) 39 | local code = tonumber(unicode_str or "") 40 | local space = utf8.codepoint(" ") 41 | local character = utf8.char(code or space) 42 | yield(Candidate("unicode", 1, 5, character, "Unicode 輸入")) 43 | yield(Candidate("unicode", 1, 5, unicode_str, "Unicode 十六進制")) 44 | yield(Candidate("unicode", 1, 5, code, "Unicode 十進制")) 45 | else 46 | -- If the input is not a valid unicode code point, we yield all candidates. 47 | for cand in input:iter() do 48 | yield(cand) 49 | end 50 | end 51 | end 52 | 53 | return filter -------------------------------------------------------------------------------- /lua/yuhao/yuhao_auto_select_postponed.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- Name: yuhao_auto_select_postponed.lua 3 | -- 名稱: 前綴碼延遲自動上屏候選項 4 | -- Version: 20251217 5 | -- Author: 朱宇浩 6 | -- Github: https://github.com/forFudan/ 7 | -- 版權聲明: 8 | -- 專爲宇浩系列輸入法製作 9 | -- 轉載請保留作者名和出處 10 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 11 | --------------------------------------- 12 | 13 | 介紹: 14 | 實現延遲自動頂字上屏功能. 15 | 當前編碼達到最大碼長或以韻碼(aeiou)結尾時,下一碼自動頂出首選項. 16 | 17 | 版本: 18 | 20250820: 初版,實現延遲自動頂字上屏功能. 19 | 20251217: 可以指定最大碼長,默認5碼. 20 | --------------------------- 21 | --]] 22 | 23 | local this = {} 24 | 25 | function this.init(env) 26 | local config = env.engine.schema.config 27 | env.max_code_length = config:get_int("schema_name/max_code_length") or 5 28 | end 29 | 30 | local kRejected = 0 -- 字符不上屏,結束 processors 流程 31 | local kAccepted = 1 -- 字符上屏,結束 processors 流程 32 | local kNoop = 2 -- 字符不上屏,交給下一個 processor 33 | 34 | 35 | ---@param key_event KeyEvent 36 | ---@param env Env 37 | function this.func(key_event, env) 38 | local context = env.engine.context 39 | -- 只接受單個字母鍵按下事件,忽略修飾鍵 40 | if key_event:release() or key_event:alt() or key_event:ctrl() or key_event:shift() or key_event:caps() then 41 | return kNoop 42 | end 43 | 44 | -- 只處理字母鍵 45 | if key_event.keycode < ('a'):byte() or key_event.keycode > ('z'):byte() then 46 | return kNoop 47 | end 48 | 49 | local input = context.input 50 | 51 | -- 檢查當前輸入是否為空 52 | if input == "" then 53 | return kNoop 54 | end 55 | 56 | -- 檢查編碼區是否達到最大碼長或者尾碼是否為韻碼(aeiou) 57 | local last_char = input:sub(-1) 58 | if (string.len(input) == env.max_code_length) or last_char:match("[aeiou]") then 59 | -- 取出輸入中當前正在翻譯的一部分 60 | local segment = context.composition:toSegmentation():back() 61 | if not segment then 62 | return kNoop 63 | end 64 | 65 | -- 獲取首選候選項 66 | local first_candidate = segment:get_candidate_at(0) 67 | if first_candidate then 68 | -- 自動選擇首選項 (模擬按下數字鍵 '1') 69 | env.engine:process_key(KeyEvent('1')) 70 | return kNoop 71 | end 72 | end 73 | 74 | return 2 75 | end 76 | 77 | return this -------------------------------------------------------------------------------- /yustar/build_release.py: -------------------------------------------------------------------------------- 1 | # %% 2 | 3 | from datetime import datetime 4 | import time 5 | 6 | # version = datetime.today().strftime('%Y%m%d') 7 | import shutil 8 | import os 9 | from distutils.dir_util import copy_tree 10 | from distutils.dir_util import remove_tree 11 | from shutil import copyfile 12 | import re 13 | 14 | version = "v3.10.3-beta.20251218" 15 | 16 | # %% 17 | try: 18 | remove_tree("./dist/yustar") 19 | except: 20 | print("Cannot remove dist/yustar folder!") 21 | 22 | try: 23 | os.makedirs("./dist/yustar") 24 | except: 25 | print("Cannot create dist/yustar folder!") 26 | 27 | if re.match(r"^v\d+.\d+.\d+$", version): 28 | shutil.copyfile( 29 | "./beta/schema/yuhao/yustar.full.dict.yaml", f"./dist/yustar.full.dict.yaml" 30 | ) 31 | 32 | # %% 33 | # Copy yustar 34 | # shutil.copyfile("./星陳字根表.pdf", f"./dist/yustar/星陳字根表_{version}.pdf") 35 | # shutil.copyfile("./星陳字根簡表.pdf", f"./dist/yustar/星陳字根簡表_{version}.pdf") 36 | # shutil.copyfile( 37 | # "./星陳字根按鍵聚類讀音字例表.pdf", 38 | # f"./dist/yustar/星陳字根按鍵聚類讀音字例表_{version}.pdf", 39 | # ) 40 | shutil.copyfile("./beta/readme.md", "./dist/yustar/readme.txt") 41 | shutil.copyfile( 42 | "../../assets/fonts/Yuniversus.ttf", 43 | "./beta/fonts/Yuniversus.ttf", 44 | ) 45 | shutil.copyfile("../yujoy/beta/schema/yuhao.essay.txt", "./beta/schema/yuhao.essay.txt") 46 | 47 | copy_tree("./beta/mabiao/", "./dist/yustar/mabiao/") 48 | copy_tree("./beta/schema/", "./dist/yustar/schema/") 49 | copy_tree("./beta/custom/", "./dist/yustar/custom/") 50 | copy_tree("./beta/trime/", "./dist/yustar/trime/") 51 | copy_tree("./beta/fonts/", "./dist/yustar/fonts/") 52 | 53 | # %% 54 | # copy yuhao 55 | copy_tree("../lua/", "./dist/yustar/schema/lua/") 56 | for file_name in [ 57 | "yuhao_pinyin.dict.yaml", 58 | "yuhao_pinyin.schema.yaml", 59 | "yuhao/yuhao.extended.dict.yaml", 60 | "yuhao/yuhao.private.dict.yaml", 61 | "yuhao/yuhao.symbols.dict.yaml", 62 | "yuhao/yuhao.symbols_inline.dict.yaml", 63 | ]: 64 | copyfile(f"../yulight/beta/schema/{file_name}", f"./dist/yustar/schema/{file_name}") 65 | 66 | # %% 67 | shutil.make_archive(f"../dist/星陳輸入法_{version}", "zip", "./dist/yustar") 68 | # copyfile(f"../dist/宇浩星陳_{version}.zip", f"../dist/yuhao_star_{version}.zip") 69 | 70 | shutil.make_archive( 71 | f"../dist/hamster/星陳輸入法_{version}", "zip", "./dist/yustar/schema" 72 | ) 73 | 74 | print(f"成功發佈星陳輸入法 {version}!") 75 | # %% 76 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_auto_select_in_fluency_mode.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Name: yuhao_auto_select_in_fluency_mode.lua 3 | 名稱: 自動選擇候選項 4 | Version: 20240510 5 | Author: 譚淞宸 6 | Purpose: 對於過長的整句輸入,當字數超過一定數量時,下一擊自動選擇第二候選 7 | 項.這個插件可使得第一候選項的字數不超過一定數量(默認爲8). 8 | 版權聲明: 9 | 專爲宇浩輸入法製作 10 | 轉載請保留作者名和出處 11 | Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 12 | 版本: 13 | 20240510, 譚淞宸: 當字數超過一定數量時,下一擊自動選擇第二候選項. 14 | 20240514, 朱宇浩: 注意到有時第二選項並不是第一選項的頭幾個字,用户可能在 15 | 不覺中上屏了其他的字.因此進行一個判斷,只有當第二選項是第一個選項的 16 | 頭幾個字的時候纔會選擇上屏.用户可以指定候選區最多顯示的漢字數. 17 | 20240517, 朱宇浩: 續上.第一選項有時是第三候選,因此加一個判斷上屏之. 18 | --------------------------------------- 19 | ]] 20 | 21 | local core = require("yuhao.yuhao_core") 22 | 23 | local this = {} 24 | 25 | function this.init(env) 26 | local config = env.engine.schema.config 27 | env.max_chars = config:get_int('yuhao_auto_select_in_fluency_mode/max_chars') or 8 28 | end 29 | 30 | local kNoop = 2 31 | 32 | function startswith(text, start) 33 | return text:sub(1, #start) == start 34 | end 35 | 36 | ---@param key_event KeyEvent 37 | ---@param env Env 38 | function this.func(key_event, env) 39 | local context = env.engine.context 40 | -- 只接受单个字母键 41 | if key_event:release() or key_event:alt() or key_event:ctrl() or key_event:shift() or key_event:caps() then 42 | return kNoop 43 | end 44 | if key_event.keycode < ('a'):byte() or key_event.keycode > ('z'):byte() then 45 | return kNoop 46 | end 47 | -- 取出输入中当前正在翻译的一部分 48 | local segment = context.composition:toSegmentation():back(); 49 | if not segment then 50 | return kNoop 51 | end 52 | local first_candidate = segment:get_candidate_at(0) 53 | local second_candidate = segment:get_candidate_at(1) 54 | local third_candidate = segment:get_candidate_at(2) 55 | if not first_candidate or not second_candidate then 56 | return kNoop 57 | end 58 | if utf8.len(first_candidate.text) < env.max_chars then 59 | return kNoop 60 | end 61 | if core.string_starts_with(first_candidate.text, second_candidate.text) then 62 | env.engine:process_key(KeyEvent('2')) 63 | return kNoop 64 | end 65 | if core.string_starts_with(first_candidate.text, third_candidate.text) then 66 | env.engine:process_key(KeyEvent('3')) 67 | return kNoop 68 | end 69 | return kNoop 70 | end 71 | 72 | return this 73 | -------------------------------------------------------------------------------- /yujoy/beta/trime/punctuation.yaml: -------------------------------------------------------------------------------- 1 | # Rime basic symbols 2 | # encoding: utf-8 3 | 4 | full_shape: 5 | ' ' : { commit: ' ' } 6 | ',' : { commit: , } 7 | '.' : { commit: 。 } 8 | '<' : [ 《, 〈, «, ‹ ] 9 | '>' : [ 》, 〉, », › ] 10 | '/' : [ /, ÷ ] 11 | '?' : { commit: ? } 12 | ';' : { commit: ; } 13 | ':' : { commit: : } 14 | '''' : { pair: [ '‘', '’' ] } 15 | '"' : { pair: [ '“', '”' ] } 16 | '\' : [ 、, \ ] 17 | '|' : [ ·, |, '§', '¦' ] 18 | '`' : ` 19 | '~' : ~ 20 | '!' : { commit: ! } 21 | '@' : [ @, ☯ ] 22 | '#' : [ #, ⌘ ] 23 | '%' : [ %, '°', '℃' ] 24 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] 25 | '^' : { commit: …… } 26 | '&' : & 27 | '*' : [ *, ·, ・, ×, ※, ❂ ] 28 | '(' : ( 29 | ')' : ) 30 | '-' : - 31 | '_' : —— 32 | '+' : + 33 | '=' : = 34 | '[' : [ 「, 【, 〔, [ ] 35 | ']' : [ 」, 】, 〕, ] ] 36 | '{' : [ 『, 〖, { ] 37 | '}' : [ 』, 〗, } ] 38 | 39 | half_shape: 40 | ',' : { commit: , } 41 | '.' : { commit: 。 } 42 | '<' : [ 《, 〈, «, ‹ ] 43 | '>' : [ 》, 〉, », › ] 44 | '/' : [ 、, '/', /, ÷ ] 45 | '?' : { commit: ? } 46 | ';' : { commit: ; } 47 | ':' : { commit: : } 48 | '''' : { pair: [ '‘', '’' ] } 49 | '"' : { pair: [ '“', '”' ] } 50 | '\' : [ 、, '\', \ ] 51 | '|' : [ ·, '|', |, '§', '¦' ] 52 | '`' : '`' 53 | '~' : [ '~', ~ ] 54 | '!' : { commit: ! } 55 | '@' : '@' 56 | '#' : '#' 57 | '%' : [ '%', %, '°', '℃' ] 58 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] 59 | '^' : { commit: …… } 60 | '&' : '&' 61 | '*' : [ '*', *, ·, ・, ×, ※, ❂ ] 62 | '(' : ( 63 | ')' : ) 64 | '-' : '-' 65 | '_' : —— 66 | '+' : '+' 67 | '=' : '=' 68 | '[' : [ 「, 【, 〔, [ ] 69 | ']' : [ 」, 】, 〕, ] ] 70 | '{' : [ 『, 〖, { ] 71 | '}' : [ 』, 〗, } ] 72 | 73 | ascii_style: 74 | ',' : { commit: ',' } 75 | '.' : { commit: '.' } 76 | '<' : '<' 77 | '>' : '>' 78 | '/' : '/' 79 | '?' : { commit: '?' } 80 | ';' : { commit: ';' } 81 | ':' : { commit: ':' } 82 | "'" : "'" 83 | '"' : '"' 84 | '\' : '\' 85 | '|' : '|' 86 | '`' : '`' 87 | '~' : '~' 88 | '!' : { commit: '!' } 89 | '@' : '@' 90 | '#' : '#' 91 | '%' : '%' 92 | '$' : '$' 93 | '^' : '^' 94 | '&' : '&' 95 | '*' : '*' 96 | '(' : '(' 97 | ')' : ')' 98 | '-' : '-' 99 | '_' : '_' 100 | '+' : '+' 101 | '=' : '=' 102 | '[' : '[' 103 | ']' : ']' 104 | '{' : '{' 105 | '}' : '}' 106 | -------------------------------------------------------------------------------- /yulight/beta/trime/punctuation.yaml: -------------------------------------------------------------------------------- 1 | # Rime basic symbols 2 | # encoding: utf-8 3 | 4 | full_shape: 5 | ' ' : { commit: ' ' } 6 | ',' : { commit: , } 7 | '.' : { commit: 。 } 8 | '<' : [ 《, 〈, «, ‹ ] 9 | '>' : [ 》, 〉, », › ] 10 | '/' : [ /, ÷ ] 11 | '?' : { commit: ? } 12 | ';' : { commit: ; } 13 | ':' : { commit: : } 14 | '''' : { pair: [ '‘', '’' ] } 15 | '"' : { pair: [ '“', '”' ] } 16 | '\' : [ 、, \ ] 17 | '|' : [ ·, |, '§', '¦' ] 18 | '`' : ` 19 | '~' : ~ 20 | '!' : { commit: ! } 21 | '@' : [ @, ☯ ] 22 | '#' : [ #, ⌘ ] 23 | '%' : [ %, '°', '℃' ] 24 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] 25 | '^' : { commit: …… } 26 | '&' : & 27 | '*' : [ *, ·, ・, ×, ※, ❂ ] 28 | '(' : ( 29 | ')' : ) 30 | '-' : - 31 | '_' : —— 32 | '+' : + 33 | '=' : = 34 | '[' : [ 「, 【, 〔, [ ] 35 | ']' : [ 」, 】, 〕, ] ] 36 | '{' : [ 『, 〖, { ] 37 | '}' : [ 』, 〗, } ] 38 | 39 | half_shape: 40 | ',' : { commit: , } 41 | '.' : { commit: 。 } 42 | '<' : [ 《, 〈, «, ‹ ] 43 | '>' : [ 》, 〉, », › ] 44 | '/' : [ 、, '/', /, ÷ ] 45 | '?' : { commit: ? } 46 | ';' : { commit: ; } 47 | ':' : { commit: : } 48 | '''' : { pair: [ '‘', '’' ] } 49 | '"' : { pair: [ '“', '”' ] } 50 | '\' : [ 、, '\', \ ] 51 | '|' : [ ·, '|', |, '§', '¦' ] 52 | '`' : '`' 53 | '~' : [ '~', ~ ] 54 | '!' : { commit: ! } 55 | '@' : '@' 56 | '#' : '#' 57 | '%' : [ '%', %, '°', '℃' ] 58 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] 59 | '^' : { commit: …… } 60 | '&' : '&' 61 | '*' : [ '*', *, ·, ・, ×, ※, ❂ ] 62 | '(' : ( 63 | ')' : ) 64 | '-' : '-' 65 | '_' : —— 66 | '+' : '+' 67 | '=' : '=' 68 | '[' : [ 「, 【, 〔, [ ] 69 | ']' : [ 」, 】, 〕, ] ] 70 | '{' : [ 『, 〖, { ] 71 | '}' : [ 』, 〗, } ] 72 | 73 | ascii_style: 74 | ',' : { commit: ',' } 75 | '.' : { commit: '.' } 76 | '<' : '<' 77 | '>' : '>' 78 | '/' : '/' 79 | '?' : { commit: '?' } 80 | ';' : { commit: ';' } 81 | ':' : { commit: ':' } 82 | "'" : "'" 83 | '"' : '"' 84 | '\' : '\' 85 | '|' : '|' 86 | '`' : '`' 87 | '~' : '~' 88 | '!' : { commit: '!' } 89 | '@' : '@' 90 | '#' : '#' 91 | '%' : '%' 92 | '$' : '$' 93 | '^' : '^' 94 | '&' : '&' 95 | '*' : '*' 96 | '(' : '(' 97 | ')' : ')' 98 | '-' : '-' 99 | '_' : '_' 100 | '+' : '+' 101 | '=' : '=' 102 | '[' : '[' 103 | ']' : ']' 104 | '{' : '{' 105 | '}' : '}' 106 | -------------------------------------------------------------------------------- /yuling/beta/trime/punctuation.yaml: -------------------------------------------------------------------------------- 1 | # Rime basic symbols 2 | # encoding: utf-8 3 | 4 | full_shape: 5 | ' ' : { commit: ' ' } 6 | ',' : { commit: , } 7 | '.' : { commit: 。 } 8 | '<' : [ 《, 〈, «, ‹ ] 9 | '>' : [ 》, 〉, », › ] 10 | '/' : [ /, ÷ ] 11 | '?' : { commit: ? } 12 | ';' : { commit: ; } 13 | ':' : { commit: : } 14 | '''' : { pair: [ '‘', '’' ] } 15 | '"' : { pair: [ '“', '”' ] } 16 | '\' : [ 、, \ ] 17 | '|' : [ ·, |, '§', '¦' ] 18 | '`' : ` 19 | '~' : ~ 20 | '!' : { commit: ! } 21 | '@' : [ @, ☯ ] 22 | '#' : [ #, ⌘ ] 23 | '%' : [ %, '°', '℃' ] 24 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] 25 | '^' : { commit: …… } 26 | '&' : & 27 | '*' : [ *, ·, ・, ×, ※, ❂ ] 28 | '(' : ( 29 | ')' : ) 30 | '-' : - 31 | '_' : —— 32 | '+' : + 33 | '=' : = 34 | '[' : [ 「, 【, 〔, [ ] 35 | ']' : [ 」, 】, 〕, ] ] 36 | '{' : [ 『, 〖, { ] 37 | '}' : [ 』, 〗, } ] 38 | 39 | half_shape: 40 | ',' : { commit: , } 41 | '.' : { commit: 。 } 42 | '<' : [ 《, 〈, «, ‹ ] 43 | '>' : [ 》, 〉, », › ] 44 | '/' : [ 、, '/', /, ÷ ] 45 | '?' : { commit: ? } 46 | ';' : { commit: ; } 47 | ':' : { commit: : } 48 | '''' : { pair: [ '‘', '’' ] } 49 | '"' : { pair: [ '“', '”' ] } 50 | '\' : [ 、, '\', \ ] 51 | '|' : [ ·, '|', |, '§', '¦' ] 52 | '`' : '`' 53 | '~' : [ '~', ~ ] 54 | '!' : { commit: ! } 55 | '@' : '@' 56 | '#' : '#' 57 | '%' : [ '%', %, '°', '℃' ] 58 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] 59 | '^' : { commit: …… } 60 | '&' : '&' 61 | '*' : [ '*', *, ·, ・, ×, ※, ❂ ] 62 | '(' : ( 63 | ')' : ) 64 | '-' : '-' 65 | '_' : —— 66 | '+' : '+' 67 | '=' : '=' 68 | '[' : [ 「, 【, 〔, [ ] 69 | ']' : [ 」, 】, 〕, ] ] 70 | '{' : [ 『, 〖, { ] 71 | '}' : [ 』, 〗, } ] 72 | 73 | ascii_style: 74 | ',' : { commit: ',' } 75 | '.' : { commit: '.' } 76 | '<' : '<' 77 | '>' : '>' 78 | '/' : '/' 79 | '?' : { commit: '?' } 80 | ';' : { commit: ';' } 81 | ':' : { commit: ':' } 82 | "'" : "'" 83 | '"' : '"' 84 | '\' : '\' 85 | '|' : '|' 86 | '`' : '`' 87 | '~' : '~' 88 | '!' : { commit: '!' } 89 | '@' : '@' 90 | '#' : '#' 91 | '%' : '%' 92 | '$' : '$' 93 | '^' : '^' 94 | '&' : '&' 95 | '*' : '*' 96 | '(' : '(' 97 | ')' : ')' 98 | '-' : '-' 99 | '_' : '_' 100 | '+' : '+' 101 | '=' : '=' 102 | '[' : '[' 103 | ']' : ']' 104 | '{' : '{' 105 | '}' : '}' 106 | -------------------------------------------------------------------------------- /yuming/beta/trime/punctuation.yaml: -------------------------------------------------------------------------------- 1 | # Rime basic symbols 2 | # encoding: utf-8 3 | 4 | full_shape: 5 | ' ' : { commit: ' ' } 6 | ',' : { commit: , } 7 | '.' : { commit: 。 } 8 | '<' : [ 《, 〈, «, ‹ ] 9 | '>' : [ 》, 〉, », › ] 10 | '/' : [ /, ÷ ] 11 | '?' : { commit: ? } 12 | ';' : { commit: ; } 13 | ':' : { commit: : } 14 | '''' : { pair: [ '‘', '’' ] } 15 | '"' : { pair: [ '“', '”' ] } 16 | '\' : [ 、, \ ] 17 | '|' : [ ·, |, '§', '¦' ] 18 | '`' : ` 19 | '~' : ~ 20 | '!' : { commit: ! } 21 | '@' : [ @, ☯ ] 22 | '#' : [ #, ⌘ ] 23 | '%' : [ %, '°', '℃' ] 24 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] 25 | '^' : { commit: …… } 26 | '&' : & 27 | '*' : [ *, ·, ・, ×, ※, ❂ ] 28 | '(' : ( 29 | ')' : ) 30 | '-' : - 31 | '_' : —— 32 | '+' : + 33 | '=' : = 34 | '[' : [ 「, 【, 〔, [ ] 35 | ']' : [ 」, 】, 〕, ] ] 36 | '{' : [ 『, 〖, { ] 37 | '}' : [ 』, 〗, } ] 38 | 39 | half_shape: 40 | ',' : { commit: , } 41 | '.' : { commit: 。 } 42 | '<' : [ 《, 〈, «, ‹ ] 43 | '>' : [ 》, 〉, », › ] 44 | '/' : [ 、, '/', /, ÷ ] 45 | '?' : { commit: ? } 46 | ';' : { commit: ; } 47 | ':' : { commit: : } 48 | '''' : { pair: [ '‘', '’' ] } 49 | '"' : { pair: [ '“', '”' ] } 50 | '\' : [ 、, '\', \ ] 51 | '|' : [ ·, '|', |, '§', '¦' ] 52 | '`' : '`' 53 | '~' : [ '~', ~ ] 54 | '!' : { commit: ! } 55 | '@' : '@' 56 | '#' : '#' 57 | '%' : [ '%', %, '°', '℃' ] 58 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] 59 | '^' : { commit: …… } 60 | '&' : '&' 61 | '*' : [ '*', *, ·, ・, ×, ※, ❂ ] 62 | '(' : ( 63 | ')' : ) 64 | '-' : '-' 65 | '_' : —— 66 | '+' : '+' 67 | '=' : '=' 68 | '[' : [ 「, 【, 〔, [ ] 69 | ']' : [ 」, 】, 〕, ] ] 70 | '{' : [ 『, 〖, { ] 71 | '}' : [ 』, 〗, } ] 72 | 73 | ascii_style: 74 | ',' : { commit: ',' } 75 | '.' : { commit: '.' } 76 | '<' : '<' 77 | '>' : '>' 78 | '/' : '/' 79 | '?' : { commit: '?' } 80 | ';' : { commit: ';' } 81 | ':' : { commit: ':' } 82 | "'" : "'" 83 | '"' : '"' 84 | '\' : '\' 85 | '|' : '|' 86 | '`' : '`' 87 | '~' : '~' 88 | '!' : { commit: '!' } 89 | '@' : '@' 90 | '#' : '#' 91 | '%' : '%' 92 | '$' : '$' 93 | '^' : '^' 94 | '&' : '&' 95 | '*' : '*' 96 | '(' : '(' 97 | ')' : ')' 98 | '-' : '-' 99 | '_' : '_' 100 | '+' : '+' 101 | '=' : '=' 102 | '[' : '[' 103 | ']' : ']' 104 | '{' : '{' 105 | '}' : '}' 106 | -------------------------------------------------------------------------------- /yustar/beta/trime/punctuation.yaml: -------------------------------------------------------------------------------- 1 | # Rime basic symbols 2 | # encoding: utf-8 3 | 4 | full_shape: 5 | ' ' : { commit: ' ' } 6 | ',' : { commit: , } 7 | '.' : { commit: 。 } 8 | '<' : [ 《, 〈, «, ‹ ] 9 | '>' : [ 》, 〉, », › ] 10 | '/' : [ /, ÷ ] 11 | '?' : { commit: ? } 12 | ';' : { commit: ; } 13 | ':' : { commit: : } 14 | '''' : { pair: [ '‘', '’' ] } 15 | '"' : { pair: [ '“', '”' ] } 16 | '\' : [ 、, \ ] 17 | '|' : [ ·, |, '§', '¦' ] 18 | '`' : ` 19 | '~' : ~ 20 | '!' : { commit: ! } 21 | '@' : [ @, ☯ ] 22 | '#' : [ #, ⌘ ] 23 | '%' : [ %, '°', '℃' ] 24 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] 25 | '^' : { commit: …… } 26 | '&' : & 27 | '*' : [ *, ·, ・, ×, ※, ❂ ] 28 | '(' : ( 29 | ')' : ) 30 | '-' : - 31 | '_' : —— 32 | '+' : + 33 | '=' : = 34 | '[' : [ 「, 【, 〔, [ ] 35 | ']' : [ 」, 】, 〕, ] ] 36 | '{' : [ 『, 〖, { ] 37 | '}' : [ 』, 〗, } ] 38 | 39 | half_shape: 40 | ',' : { commit: , } 41 | '.' : { commit: 。 } 42 | '<' : [ 《, 〈, «, ‹ ] 43 | '>' : [ 》, 〉, », › ] 44 | '/' : [ 、, '/', /, ÷ ] 45 | '?' : { commit: ? } 46 | ';' : { commit: ; } 47 | ':' : { commit: : } 48 | '''' : { pair: [ '‘', '’' ] } 49 | '"' : { pair: [ '“', '”' ] } 50 | '\' : [ 、, '\', \ ] 51 | '|' : [ ·, '|', |, '§', '¦' ] 52 | '`' : '`' 53 | '~' : [ '~', ~ ] 54 | '!' : { commit: ! } 55 | '@' : '@' 56 | '#' : '#' 57 | '%' : [ '%', %, '°', '℃' ] 58 | '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] 59 | '^' : { commit: …… } 60 | '&' : '&' 61 | '*' : [ '*', *, ·, ・, ×, ※, ❂ ] 62 | '(' : ( 63 | ')' : ) 64 | '-' : '-' 65 | '_' : —— 66 | '+' : '+' 67 | '=' : '=' 68 | '[' : [ 「, 【, 〔, [ ] 69 | ']' : [ 」, 】, 〕, ] ] 70 | '{' : [ 『, 〖, { ] 71 | '}' : [ 』, 〗, } ] 72 | 73 | ascii_style: 74 | ',' : { commit: ',' } 75 | '.' : { commit: '.' } 76 | '<' : '<' 77 | '>' : '>' 78 | '/' : '/' 79 | '?' : { commit: '?' } 80 | ';' : { commit: ';' } 81 | ':' : { commit: ':' } 82 | "'" : "'" 83 | '"' : '"' 84 | '\' : '\' 85 | '|' : '|' 86 | '`' : '`' 87 | '~' : '~' 88 | '!' : { commit: '!' } 89 | '@' : '@' 90 | '#' : '#' 91 | '%' : '%' 92 | '$' : '$' 93 | '^' : '^' 94 | '&' : '&' 95 | '*' : '*' 96 | '(' : '(' 97 | ')' : ')' 98 | '-' : '-' 99 | '_' : '_' 100 | '+' : '+' 101 | '=' : '=' 102 | '[' : '[' 103 | ']' : ']' 104 | '{' : '{' 105 | '}' : '}' 106 | -------------------------------------------------------------------------------- /yuling/build_release.py: -------------------------------------------------------------------------------- 1 | # %% 2 | import os 3 | import re 4 | import shutil 5 | from distutils.dir_util import copy_tree, remove_tree 6 | from shutil import copyfile 7 | 8 | version = "v3.10.3-beta.20251222" 9 | 10 | # %% 11 | try: 12 | remove_tree("./dist/yuling") 13 | except: 14 | print("Cannot remove dist/yuling folder!") 15 | 16 | try: 17 | os.makedirs("./dist/yuling") 18 | except: 19 | print("Cannot create dist/yuling folder!") 20 | 21 | if re.match(r"^v\d+.\d+.\d+$", version): 22 | shutil.copyfile("./dist/宇浩靈明單字全碼.txt", "./dist/yuling.full.dict.yaml") 23 | 24 | # %% 25 | # shutil.copyfile("./yuling.pdf", f"./dist/yuling/yuling_{version}.pdf") 26 | # shutil.copyfile( 27 | # "./changelog.md", 28 | # "./dist/yuling/changelog.md", 29 | # ) 30 | # shutil.copyfile("./beta/readme.md", f"./dist/yuling/readme.txt") 31 | shutil.copyfile( 32 | "../../assets/fonts/Yuniversus.ttf", 33 | "./beta/fonts/Yuniversus.ttf", 34 | ) 35 | 36 | copy_tree("./beta/mabiao/", "./dist/yuling/mabiao/") 37 | copy_tree("./beta/schema/", "./dist/yuling/schema/") 38 | copy_tree("./beta/custom/", "./dist/yuling/custom/") 39 | copy_tree("./beta/trime/", "./dist/yuling/trime/") 40 | copy_tree("./beta/fonts/", "./dist/yuling/fonts/") 41 | 42 | # %% 43 | # copy yuhao 44 | copy_tree("../lua/", "./dist/yuling/schema/lua/") 45 | for file_name in [ 46 | "yuhao_pinyin.dict.yaml", 47 | "yuhao_pinyin.schema.yaml", 48 | "yuhao/yuhao.extended.dict.yaml", 49 | "yuhao/yuhao.private.dict.yaml", 50 | "yuhao/yuhao.symbols.dict.yaml", 51 | "yuhao/yuhao.symbols_inline.dict.yaml", 52 | ]: 53 | copyfile(f"../yulight/beta/schema/{file_name}", f"./dist/yuling/schema/{file_name}") 54 | 55 | for file_name in [ 56 | # "yuhao/yuling_sc.words_tbtu.dict.yaml" 57 | # "yuling_tc.schema.yaml", 58 | # "yuling_tc.dict.yaml", 59 | # "yuhao/yuling_tc.quick.dict.yaml", 60 | # "yuhao/yuling_tc.words_literature.dict.yaml", 61 | # "yuhao/yuling_tc.words.dict.yaml", 62 | ]: 63 | try: 64 | os.remove(f"./dist/yuling/schema/{file_name}") 65 | except: 66 | print(f"{file_name} does not exist. It is not deleted.") 67 | 68 | # for file_name in [ 69 | # "yuling_tc.schema.yaml", 70 | # ]: 71 | # os.remove(f"./dist/yuling/hotfix/{file_name}") 72 | 73 | # %% 74 | shutil.make_archive(f"../dist/靈明輸入法_{version}", "zip", "./dist/yuling") 75 | shutil.make_archive( 76 | f"../dist/hamster/靈明輸入法_{version}", "zip", "./dist/yuling/schema" 77 | ) 78 | 79 | # %% 80 | print(f"成功發佈靈明輸入法 {version}!") 81 | 82 | # %% 83 | -------------------------------------------------------------------------------- /yulight/beta/schema/yuhao_pinyin.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yuhao_pinyin 6 | name: 宇浩·繁簡通·拼音 7 | version: 20230418 8 | author: 9 | - 佛振 10 | - 佚名 11 | description: | 12 | 基於朙月拼音和袖珍簡化拼音詞庫製作 13 | 用於宇浩輸入法的拼音反查 14 | 兼容大陸簡體、大陸古籍繁體、臺灣繁體、香港繁體 15 | 繁簡漢字相同權重 16 | 17 | switches: 18 | - name: ascii_mode 19 | reset: 0 20 | states: [中文, 西文] 21 | - name: full_shape 22 | states: [半角, 全角] 23 | - name: ascii_punct 24 | states: [。,, .,] 25 | 26 | engine: 27 | processors: 28 | - ascii_composer 29 | - recognizer 30 | - key_binder 31 | - speller 32 | - punctuator 33 | - selector 34 | - navigator 35 | - express_editor 36 | segmentors: 37 | - ascii_segmentor 38 | - matcher 39 | - abc_segmentor 40 | - punct_segmentor 41 | - fallback_segmentor 42 | translators: 43 | - punct_translator 44 | - script_translator 45 | 46 | speller: 47 | alphabet: zyxwvutsrqponmlkjihgfedcba 48 | delimiter: " '" 49 | algebra: 50 | - abbrev/^([a-z]).+$/$1/ 51 | - abbrev/^([zcs]h).+$/$1/ 52 | - derive/^([nl])ue$/$1ve/ 53 | - derive/^([jqxy])u/$1v/ 54 | 55 | translator: 56 | dictionary: yuhao_pinyin 57 | preedit_format: 58 | - xform/([nl])v/$1ü/ 59 | - xform/([nl])ue/$1üe/ 60 | - xform/([jqxy])v/$1u/ 61 | 62 | punctuator: 63 | import_preset: symbols 64 | half_shape: 65 | "`": "`" 66 | "#": "#" 67 | "%": "%" 68 | "*": "*" 69 | "\\": "、" 70 | "[": "「" 71 | "]": "」" 72 | "{": "『" 73 | "}": "』" 74 | "/": "/" 75 | "|": "|" 76 | 77 | key_binder: 78 | bindings: 79 | - { when: always, accept: "Control+period", toggle: ascii_punct } 80 | - { when: always, accept: "Control+Shift+period", toggle: ascii_punct } 81 | - { when: always, accept: "Control+Shift+J", toggle: simplification } 82 | - { when: always, accept: "Control+Shift+F", toggle: traditionalization } 83 | - { when: has_menu, accept: semicolon, send: 2 } # 分号次选 84 | - { when: has_menu, accept: apostrophe, send: 3 } # 引号三选 85 | - { when: has_menu, accept: minus, send: Page_Up } # 減號上翻頁 86 | - { when: has_menu, accept: equal, send: Page_Down } # 等號下翻頁 87 | - { when: has_menu, accept: Tab, send: Page_Down } # Tab 下翻頁 88 | - { when: composing, accept: Escape, send: "Shift+BackSpace" } # 逐字删除 89 | 90 | recognizer: 91 | # import_preset: default 92 | patterns: 93 | # hack: to enable "/fh" style symbols, '/' must be mapped to a [list]. 94 | # so those who have customized '/' for direct commit won't be affected by 95 | # this change. 96 | punct: "^/([0-9]+[a-z]*|[a-z]+)$" 97 | -------------------------------------------------------------------------------- /yuming/build_release.py: -------------------------------------------------------------------------------- 1 | # %% 2 | import os 3 | import re 4 | import shutil 5 | from distutils.dir_util import copy_tree, remove_tree 6 | from shutil import copyfile 7 | 8 | version = "v3.10.3-beta.20251218" 9 | 10 | # %% 11 | try: 12 | remove_tree("./dist/yuming") 13 | except: 14 | print("Cannot remove dist/yuming folder!") 15 | 16 | try: 17 | os.makedirs("./dist/yuming") 18 | except: 19 | print("Cannot create dist/yuming folder!") 20 | 21 | if re.match(r"^v\d+.\d+.\d+$", version): 22 | shutil.copyfile("./dist/宇浩日月單字全碼.txt", "./dist/yuming.full.dict.yaml") 23 | 24 | # %% 25 | # shutil.copyfile("./yuming.pdf", f"./dist/yuming/yuming_{version}.pdf") 26 | # shutil.copyfile( 27 | # "./changelog.md", 28 | # "./dist/yuming/changelog.md", 29 | # ) 30 | # shutil.copyfile("./beta/readme.md", f"./dist/yuming/readme.txt") 31 | shutil.copyfile( 32 | "../../assets/fonts/Yuniversus.ttf", 33 | "./beta/fonts/Yuniversus.ttf", 34 | ) 35 | 36 | copy_tree("./beta/mabiao/", "./dist/yuming/mabiao/") 37 | copy_tree("./beta/schema/", "./dist/yuming/schema/") 38 | copy_tree("./beta/custom/", "./dist/yuming/custom/") 39 | copy_tree("./beta/trime/", "./dist/yuming/trime/") 40 | copy_tree("./beta/fonts/", "./dist/yuming/fonts/") 41 | 42 | # %% 43 | # copy yuhao 44 | copy_tree("../lua/", "./dist/yuming/schema/lua/") 45 | for file_name in [ 46 | "yuhao_pinyin.dict.yaml", 47 | "yuhao_pinyin.schema.yaml", 48 | "yuhao/yuhao.extended.dict.yaml", 49 | "yuhao/yuhao.private.dict.yaml", 50 | "yuhao/yuhao.symbols.dict.yaml", 51 | "yuhao/yuhao.symbols_inline.dict.yaml", 52 | ]: 53 | copyfile(f"../yulight/beta/schema/{file_name}", f"./dist/yuming/schema/{file_name}") 54 | 55 | # copyfile( 56 | # "../yulight/beta/schema/yuhao/yulight.roots.dict.yaml", 57 | # "./dist/yuming/schema/yuhao/yulight.roots.dict.yaml", 58 | # ) 59 | # copyfile( 60 | # "../yustar/beta/schema/yuhao/yustar.roots.dict.yaml", 61 | # "./dist/yuming/schema/yuhao/yustar.roots.dict.yaml", 62 | # ) 63 | 64 | for file_name in [ 65 | "yuhao/yuming_sc.words_tbtu.dict.yaml" 66 | # "yuming_tc.schema.yaml", 67 | # "yuming_tc.dict.yaml", 68 | # "yuhao/yuming_tc.quick.dict.yaml", 69 | # "yuhao/yuming_tc.words_literature.dict.yaml", 70 | # "yuhao/yuming_tc.words.dict.yaml", 71 | ]: 72 | try: 73 | os.remove(f"./dist/yuming/schema/{file_name}") 74 | except: 75 | print(f"{file_name} does not exist. It is not deleted.") 76 | 77 | # for file_name in [ 78 | # "yuming_tc.schema.yaml", 79 | # ]: 80 | # os.remove(f"./dist/yuming/hotfix/{file_name}") 81 | 82 | # %% 83 | shutil.make_archive(f"../dist/日月輸入法_{version}", "zip", "./dist/yuming") 84 | shutil.make_archive( 85 | f"../dist/hamster/日月輸入法_{version}", "zip", "./dist/yuming/schema" 86 | ) 87 | 88 | # %% 89 | print(f"成功發佈日月輸入法 {version}!") 90 | 91 | # %% 92 | -------------------------------------------------------------------------------- /yujoy/build_release.py: -------------------------------------------------------------------------------- 1 | # %% 2 | 3 | import shutil 4 | import os 5 | from distutils.dir_util import copy_tree 6 | from distutils.dir_util import remove_tree 7 | from shutil import copyfile 8 | import re 9 | 10 | version = "v3.10.3-beta.20251220" 11 | 12 | # %% 13 | try: 14 | remove_tree("./dist/yujoy") 15 | except: 16 | print("Cannot remove dist/yujoy folder!") 17 | 18 | try: 19 | os.makedirs("./dist/yujoy") 20 | except: 21 | print("Cannot create dist/yujoy folder!") 22 | 23 | if re.match(r"^v\d+.\d+.\d+$", version): 24 | shutil.copyfile( 25 | "./beta/schema/yuhao/yujoy.full.dict.yaml", "./dist/yujoy.full.dict.yaml" 26 | ) 27 | 28 | # %% 29 | # shutil.copyfile("./卿雲字根表.pdf", f"./dist/yujoy/卿雲字根表_{version}.pdf") 30 | # shutil.copyfile( 31 | # "./卿雲字根按鍵讀音字例表.pdf", 32 | # f"./dist/yujoy/卿雲字根按鍵讀音字例表_{version}.pdf", 33 | # ) 34 | shutil.copyfile("./beta/readme.md", "./dist/yujoy/readme.txt") 35 | shutil.copyfile( 36 | "../../assets/fonts/Yuniversus.ttf", 37 | "./beta/fonts/Yuniversus.ttf", 38 | ) 39 | 40 | copy_tree("./beta/mabiao/", "./dist/yujoy/mabiao/") 41 | copy_tree("./beta/schema/", "./dist/yujoy/schema/") 42 | copy_tree("./beta/custom/", "./dist/yujoy/custom/") 43 | copy_tree("./beta/trime/", "./dist/yujoy/trime/") 44 | copy_tree("./beta/fonts/", "./dist/yujoy/fonts/") 45 | 46 | # %% 47 | # copy yuhao 48 | copy_tree("../lua/", "./dist/yujoy/schema/lua/") 49 | for file_name in [ 50 | # "yuhao.symbols.yaml", 51 | "yuhao_pinyin.dict.yaml", 52 | "yuhao_pinyin.schema.yaml", 53 | "yuhao/yuhao.symbols.dict.yaml", 54 | "yuhao/yuhao.symbols_inline.dict.yaml", 55 | "yuhao/yuhao.extended.dict.yaml", 56 | "yuhao/yuhao.private.dict.yaml", 57 | ]: 58 | copyfile(f"../yulight/beta/schema/{file_name}", f"./dist/yujoy/schema/{file_name}") 59 | 60 | copyfile( 61 | "../yulight/beta/schema/yuhao/yulight.roots.dict.yaml", 62 | "./dist/yujoy/schema/yuhao/yulight.roots.dict.yaml", 63 | ) 64 | copyfile( 65 | "../yustar/beta/schema/yuhao/yustar.roots.dict.yaml", 66 | "./dist/yujoy/schema/yuhao/yustar.roots.dict.yaml", 67 | ) 68 | 69 | for file_name in [ 70 | # "yujoy_tc.schema.yaml", 71 | # "yujoy_tc.dict.yaml", 72 | # "yuhao/yujoy_tc.quick.dict.yaml", 73 | # "yuhao/yujoy_tc.words_literature.dict.yaml", 74 | # "yuhao/yujoy_tc.words.dict.yaml", 75 | ]: 76 | try: 77 | os.remove(f"./dist/yujoy/schema/{file_name}") 78 | except: 79 | print(f"{file_name} does not exist. It is not deleted.") 80 | 81 | # for file_name in [ 82 | # "yujoy_tc.schema.yaml", 83 | # ]: 84 | # os.remove(f"./dist/yujoy/hotfix/{file_name}") 85 | 86 | # %% 87 | shutil.make_archive(f"../dist/卿雲輸入法_{version}", "zip", "./dist/yujoy") 88 | shutil.make_archive( 89 | f"../dist/hamster/卿雲輸入法_{version}", "zip", "./dist/yujoy/schema" 90 | ) 91 | 92 | # %% 93 | print(f"成功發佈卿雲 {version}!") 94 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_single_char_only_for_full_code.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Name: yuhao_single_char_only_for_full_code.lua 3 | 名稱: 全碼詞語過濾器 4 | Version: 20250819 5 | Author: 朱宇浩 6 | Github: https://github.com/forFudan/ 7 | Purpose: 屏蔽全碼詞語,但保留簡碼詞 8 | 版權聲明: 9 | 專爲宇浩輸入法製作 10 | 轉載請保留作者名和出處 11 | Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 12 | ------------------------------------- 13 | 14 | 介紹: 15 | 對於單字黨而言,有時候也希望能够通過輸入簡碼詞語提高打字速度. 16 | 這個過濾器會過濾掉全碼詞語,只保留單字和簡碼詞. 17 | 18 | 使用方法: 19 | (1) 需要將此 lua 文件放在 lua 文件夾下. 20 | (2) 需要在 rime.lua 中添加以下代码激活本腳本: 21 | yuhao_single_char_only_for_full_code = require("yuhao_single_char_only_for_full_code") 22 | (3) 需要在 switches 添加狀態: 23 | - name: yuhao_single_char_only_for_full_code 24 | reset: 1 25 | states: [字词同出, 全码出单] 26 | (4) 需要在 engine/filters 添加: 27 | - lua_filter@yuhao_single_char_only_for_full_code 28 | 29 | 版本: 30 | 20221108: 初版. 31 | 20250602: 將四碼改爲四碼及以上. 32 | 20250819: 重構代碼.用户每次輸入編碼時,都會搜索碼表,確認是否是簡碼詞. 33 | 20251220: 使用 core.is_single_char 函數處理單字判斷,正確支持變體選擇器. 34 | --------------------------- 35 | ]] 36 | 37 | local core = require("yuhao.yuhao_core") 38 | 39 | local function init(env) 40 | local config = env.engine.schema.config 41 | local code_rvdb = config:get_string("schema_name/code") 42 | env.code_rvdb = ReverseDb("build/" .. code_rvdb .. ".reverse.bin") 43 | env.mem = Memory(env.engine, Schema(code_rvdb)) 44 | end 45 | 46 | -- 檢查候選項是否是簡碼 47 | -- 如果該候選項存在一個更長的碼,則認爲它是簡碼 48 | local function is_short_code(cand, env) 49 | local length_of_input = string.len(env.engine.context.input) 50 | local codes_of_candidates = env.code_rvdb:lookup(cand.text) 51 | local is_short = false 52 | for code in codes_of_candidates:gmatch("%S+") do 53 | if string.len(code) > length_of_input then 54 | is_short = true 55 | break 56 | end 57 | end 58 | return is_short 59 | end 60 | 61 | local function filter(input, env) 62 | local option = env.engine.context:get_option("yuhao_single_char_only_for_full_code") 63 | if not option then 64 | for cand in input:iter() do 65 | yield(cand) 66 | end 67 | elseif env.engine.context.input:match("^[z/`]") then 68 | -- If the input starts with 'z', '/', or '`', we yield all candidates. 69 | for cand in input:iter() do 70 | yield(cand) 71 | end 72 | else 73 | for cand in input:iter() do 74 | local cand_genuine = cand:get_genuine() 75 | if cand_genuine.type == 'completion' then 76 | -- 預測候選項不顯示詞語 77 | if core.is_single_char(cand.text) then 78 | yield(cand) 79 | end 80 | else 81 | -- 精確匹配顯示簡詞 82 | if core.is_single_char(cand.text) or is_short_code(cand, env) then 83 | yield(cand) 84 | end 85 | end 86 | end 87 | end 88 | end 89 | 90 | return { init = init, func = filter } 91 | -------------------------------------------------------------------------------- /yujoy/beta/trime/key_bindings.yaml: -------------------------------------------------------------------------------- 1 | # Rime key bindings 2 | # encoding: utf-8 3 | 4 | emacs_editing: 5 | __append: 6 | - { when: composing, accept: Control+p, send: Up } 7 | - { when: composing, accept: Control+n, send: Down } 8 | - { when: composing, accept: Control+b, send: Left } 9 | - { when: composing, accept: Control+f, send: Right } 10 | - { when: composing, accept: Control+a, send: Home } 11 | - { when: composing, accept: Control+e, send: End } 12 | - { when: composing, accept: Control+d, send: Delete } 13 | - { when: composing, accept: Control+k, send: Shift+Delete } 14 | - { when: composing, accept: Control+h, send: BackSpace } 15 | - { when: composing, accept: Control+g, send: Escape } 16 | - { when: composing, accept: Control+bracketleft, send: Escape } 17 | - { when: composing, accept: Control+y, send: Page_Up } 18 | - { when: composing, accept: Alt+v, send: Page_Up } 19 | - { when: composing, accept: Control+v, send: Page_Down } 20 | 21 | move_by_word_with_tab: 22 | __append: 23 | - { when: composing, accept: ISO_Left_Tab, send: Shift+Left } 24 | - { when: composing, accept: Shift+Tab, send: Shift+Left } 25 | - { when: composing, accept: Tab, send: Shift+Right } 26 | 27 | paging_with_minus_equal: 28 | __append: 29 | - { when: has_menu, accept: minus, send: Page_Up } 30 | - { when: has_menu, accept: equal, send: Page_Down } 31 | 32 | paging_with_comma_period: 33 | __append: 34 | - { when: paging, accept: comma, send: Page_Up } 35 | - { when: has_menu, accept: period, send: Page_Down } 36 | 37 | paging_with_brackets: 38 | __append: 39 | - { when: paging, accept: bracketleft, send: Page_Up } 40 | - { when: has_menu, accept: bracketright, send: Page_Down } 41 | 42 | numbered_mode_switch: 43 | __append: 44 | - { when: always, accept: Control+Shift+1, select: .next } 45 | - { when: always, accept: Control+Shift+2, toggle: ascii_mode } 46 | - { when: always, accept: Control+Shift+3, toggle: full_shape } 47 | - { when: always, accept: Control+Shift+4, toggle: simplification } 48 | - { when: always, accept: Control+Shift+5, toggle: extended_charset } 49 | - { when: always, accept: Control+Shift+exclam, select: .next } 50 | - { when: always, accept: Control+Shift+at, toggle: ascii_mode } 51 | - { when: always, accept: Control+Shift+numbersign, toggle: full_shape } 52 | - { when: always, accept: Control+Shift+dollar, toggle: simplification } 53 | - { when: always, accept: Control+Shift+percent, toggle: extended_charset } 54 | 55 | windows_compatible_mode_switch: 56 | __append: 57 | - { when: always, accept: Shift+space, toggle: full_shape } 58 | - { when: always, accept: Control+period, toggle: ascii_punct } 59 | 60 | optimized_mode_switch: 61 | __append: 62 | - { when: always, accept: Control+Shift+space, select: .next } 63 | - { when: always, accept: Shift+space, toggle: ascii_mode } 64 | - { when: always, accept: Control+comma, toggle: full_shape } 65 | - { when: always, accept: Control+period, toggle: ascii_punct } 66 | - { when: always, accept: Control+slash, toggle: simplification } 67 | - { when: always, accept: Control+backslash, toggle: extended_charset } 68 | -------------------------------------------------------------------------------- /yulight/beta/trime/key_bindings.yaml: -------------------------------------------------------------------------------- 1 | # Rime key bindings 2 | # encoding: utf-8 3 | 4 | emacs_editing: 5 | __append: 6 | - { when: composing, accept: Control+p, send: Up } 7 | - { when: composing, accept: Control+n, send: Down } 8 | - { when: composing, accept: Control+b, send: Left } 9 | - { when: composing, accept: Control+f, send: Right } 10 | - { when: composing, accept: Control+a, send: Home } 11 | - { when: composing, accept: Control+e, send: End } 12 | - { when: composing, accept: Control+d, send: Delete } 13 | - { when: composing, accept: Control+k, send: Shift+Delete } 14 | - { when: composing, accept: Control+h, send: BackSpace } 15 | - { when: composing, accept: Control+g, send: Escape } 16 | - { when: composing, accept: Control+bracketleft, send: Escape } 17 | - { when: composing, accept: Control+y, send: Page_Up } 18 | - { when: composing, accept: Alt+v, send: Page_Up } 19 | - { when: composing, accept: Control+v, send: Page_Down } 20 | 21 | move_by_word_with_tab: 22 | __append: 23 | - { when: composing, accept: ISO_Left_Tab, send: Shift+Left } 24 | - { when: composing, accept: Shift+Tab, send: Shift+Left } 25 | - { when: composing, accept: Tab, send: Shift+Right } 26 | 27 | paging_with_minus_equal: 28 | __append: 29 | - { when: has_menu, accept: minus, send: Page_Up } 30 | - { when: has_menu, accept: equal, send: Page_Down } 31 | 32 | paging_with_comma_period: 33 | __append: 34 | - { when: paging, accept: comma, send: Page_Up } 35 | - { when: has_menu, accept: period, send: Page_Down } 36 | 37 | paging_with_brackets: 38 | __append: 39 | - { when: paging, accept: bracketleft, send: Page_Up } 40 | - { when: has_menu, accept: bracketright, send: Page_Down } 41 | 42 | numbered_mode_switch: 43 | __append: 44 | - { when: always, accept: Control+Shift+1, select: .next } 45 | - { when: always, accept: Control+Shift+2, toggle: ascii_mode } 46 | - { when: always, accept: Control+Shift+3, toggle: full_shape } 47 | - { when: always, accept: Control+Shift+4, toggle: simplification } 48 | - { when: always, accept: Control+Shift+5, toggle: extended_charset } 49 | - { when: always, accept: Control+Shift+exclam, select: .next } 50 | - { when: always, accept: Control+Shift+at, toggle: ascii_mode } 51 | - { when: always, accept: Control+Shift+numbersign, toggle: full_shape } 52 | - { when: always, accept: Control+Shift+dollar, toggle: simplification } 53 | - { when: always, accept: Control+Shift+percent, toggle: extended_charset } 54 | 55 | windows_compatible_mode_switch: 56 | __append: 57 | - { when: always, accept: Shift+space, toggle: full_shape } 58 | - { when: always, accept: Control+period, toggle: ascii_punct } 59 | 60 | optimized_mode_switch: 61 | __append: 62 | - { when: always, accept: Control+Shift+space, select: .next } 63 | - { when: always, accept: Shift+space, toggle: ascii_mode } 64 | - { when: always, accept: Control+comma, toggle: full_shape } 65 | - { when: always, accept: Control+period, toggle: ascii_punct } 66 | - { when: always, accept: Control+slash, toggle: simplification } 67 | - { when: always, accept: Control+backslash, toggle: extended_charset } 68 | -------------------------------------------------------------------------------- /yuling/beta/trime/key_bindings.yaml: -------------------------------------------------------------------------------- 1 | # Rime key bindings 2 | # encoding: utf-8 3 | 4 | emacs_editing: 5 | __append: 6 | - { when: composing, accept: Control+p, send: Up } 7 | - { when: composing, accept: Control+n, send: Down } 8 | - { when: composing, accept: Control+b, send: Left } 9 | - { when: composing, accept: Control+f, send: Right } 10 | - { when: composing, accept: Control+a, send: Home } 11 | - { when: composing, accept: Control+e, send: End } 12 | - { when: composing, accept: Control+d, send: Delete } 13 | - { when: composing, accept: Control+k, send: Shift+Delete } 14 | - { when: composing, accept: Control+h, send: BackSpace } 15 | - { when: composing, accept: Control+g, send: Escape } 16 | - { when: composing, accept: Control+bracketleft, send: Escape } 17 | - { when: composing, accept: Control+y, send: Page_Up } 18 | - { when: composing, accept: Alt+v, send: Page_Up } 19 | - { when: composing, accept: Control+v, send: Page_Down } 20 | 21 | move_by_word_with_tab: 22 | __append: 23 | - { when: composing, accept: ISO_Left_Tab, send: Shift+Left } 24 | - { when: composing, accept: Shift+Tab, send: Shift+Left } 25 | - { when: composing, accept: Tab, send: Shift+Right } 26 | 27 | paging_with_minus_equal: 28 | __append: 29 | - { when: has_menu, accept: minus, send: Page_Up } 30 | - { when: has_menu, accept: equal, send: Page_Down } 31 | 32 | paging_with_comma_period: 33 | __append: 34 | - { when: paging, accept: comma, send: Page_Up } 35 | - { when: has_menu, accept: period, send: Page_Down } 36 | 37 | paging_with_brackets: 38 | __append: 39 | - { when: paging, accept: bracketleft, send: Page_Up } 40 | - { when: has_menu, accept: bracketright, send: Page_Down } 41 | 42 | numbered_mode_switch: 43 | __append: 44 | - { when: always, accept: Control+Shift+1, select: .next } 45 | - { when: always, accept: Control+Shift+2, toggle: ascii_mode } 46 | - { when: always, accept: Control+Shift+3, toggle: full_shape } 47 | - { when: always, accept: Control+Shift+4, toggle: simplification } 48 | - { when: always, accept: Control+Shift+5, toggle: extended_charset } 49 | - { when: always, accept: Control+Shift+exclam, select: .next } 50 | - { when: always, accept: Control+Shift+at, toggle: ascii_mode } 51 | - { when: always, accept: Control+Shift+numbersign, toggle: full_shape } 52 | - { when: always, accept: Control+Shift+dollar, toggle: simplification } 53 | - { when: always, accept: Control+Shift+percent, toggle: extended_charset } 54 | 55 | windows_compatible_mode_switch: 56 | __append: 57 | - { when: always, accept: Shift+space, toggle: full_shape } 58 | - { when: always, accept: Control+period, toggle: ascii_punct } 59 | 60 | optimized_mode_switch: 61 | __append: 62 | - { when: always, accept: Control+Shift+space, select: .next } 63 | - { when: always, accept: Shift+space, toggle: ascii_mode } 64 | - { when: always, accept: Control+comma, toggle: full_shape } 65 | - { when: always, accept: Control+period, toggle: ascii_punct } 66 | - { when: always, accept: Control+slash, toggle: simplification } 67 | - { when: always, accept: Control+backslash, toggle: extended_charset } 68 | -------------------------------------------------------------------------------- /yuming/beta/trime/key_bindings.yaml: -------------------------------------------------------------------------------- 1 | # Rime key bindings 2 | # encoding: utf-8 3 | 4 | emacs_editing: 5 | __append: 6 | - { when: composing, accept: Control+p, send: Up } 7 | - { when: composing, accept: Control+n, send: Down } 8 | - { when: composing, accept: Control+b, send: Left } 9 | - { when: composing, accept: Control+f, send: Right } 10 | - { when: composing, accept: Control+a, send: Home } 11 | - { when: composing, accept: Control+e, send: End } 12 | - { when: composing, accept: Control+d, send: Delete } 13 | - { when: composing, accept: Control+k, send: Shift+Delete } 14 | - { when: composing, accept: Control+h, send: BackSpace } 15 | - { when: composing, accept: Control+g, send: Escape } 16 | - { when: composing, accept: Control+bracketleft, send: Escape } 17 | - { when: composing, accept: Control+y, send: Page_Up } 18 | - { when: composing, accept: Alt+v, send: Page_Up } 19 | - { when: composing, accept: Control+v, send: Page_Down } 20 | 21 | move_by_word_with_tab: 22 | __append: 23 | - { when: composing, accept: ISO_Left_Tab, send: Shift+Left } 24 | - { when: composing, accept: Shift+Tab, send: Shift+Left } 25 | - { when: composing, accept: Tab, send: Shift+Right } 26 | 27 | paging_with_minus_equal: 28 | __append: 29 | - { when: has_menu, accept: minus, send: Page_Up } 30 | - { when: has_menu, accept: equal, send: Page_Down } 31 | 32 | paging_with_comma_period: 33 | __append: 34 | - { when: paging, accept: comma, send: Page_Up } 35 | - { when: has_menu, accept: period, send: Page_Down } 36 | 37 | paging_with_brackets: 38 | __append: 39 | - { when: paging, accept: bracketleft, send: Page_Up } 40 | - { when: has_menu, accept: bracketright, send: Page_Down } 41 | 42 | numbered_mode_switch: 43 | __append: 44 | - { when: always, accept: Control+Shift+1, select: .next } 45 | - { when: always, accept: Control+Shift+2, toggle: ascii_mode } 46 | - { when: always, accept: Control+Shift+3, toggle: full_shape } 47 | - { when: always, accept: Control+Shift+4, toggle: simplification } 48 | - { when: always, accept: Control+Shift+5, toggle: extended_charset } 49 | - { when: always, accept: Control+Shift+exclam, select: .next } 50 | - { when: always, accept: Control+Shift+at, toggle: ascii_mode } 51 | - { when: always, accept: Control+Shift+numbersign, toggle: full_shape } 52 | - { when: always, accept: Control+Shift+dollar, toggle: simplification } 53 | - { when: always, accept: Control+Shift+percent, toggle: extended_charset } 54 | 55 | windows_compatible_mode_switch: 56 | __append: 57 | - { when: always, accept: Shift+space, toggle: full_shape } 58 | - { when: always, accept: Control+period, toggle: ascii_punct } 59 | 60 | optimized_mode_switch: 61 | __append: 62 | - { when: always, accept: Control+Shift+space, select: .next } 63 | - { when: always, accept: Shift+space, toggle: ascii_mode } 64 | - { when: always, accept: Control+comma, toggle: full_shape } 65 | - { when: always, accept: Control+period, toggle: ascii_punct } 66 | - { when: always, accept: Control+slash, toggle: simplification } 67 | - { when: always, accept: Control+backslash, toggle: extended_charset } 68 | -------------------------------------------------------------------------------- /yustar/beta/trime/key_bindings.yaml: -------------------------------------------------------------------------------- 1 | # Rime key bindings 2 | # encoding: utf-8 3 | 4 | emacs_editing: 5 | __append: 6 | - { when: composing, accept: Control+p, send: Up } 7 | - { when: composing, accept: Control+n, send: Down } 8 | - { when: composing, accept: Control+b, send: Left } 9 | - { when: composing, accept: Control+f, send: Right } 10 | - { when: composing, accept: Control+a, send: Home } 11 | - { when: composing, accept: Control+e, send: End } 12 | - { when: composing, accept: Control+d, send: Delete } 13 | - { when: composing, accept: Control+k, send: Shift+Delete } 14 | - { when: composing, accept: Control+h, send: BackSpace } 15 | - { when: composing, accept: Control+g, send: Escape } 16 | - { when: composing, accept: Control+bracketleft, send: Escape } 17 | - { when: composing, accept: Control+y, send: Page_Up } 18 | - { when: composing, accept: Alt+v, send: Page_Up } 19 | - { when: composing, accept: Control+v, send: Page_Down } 20 | 21 | move_by_word_with_tab: 22 | __append: 23 | - { when: composing, accept: ISO_Left_Tab, send: Shift+Left } 24 | - { when: composing, accept: Shift+Tab, send: Shift+Left } 25 | - { when: composing, accept: Tab, send: Shift+Right } 26 | 27 | paging_with_minus_equal: 28 | __append: 29 | - { when: has_menu, accept: minus, send: Page_Up } 30 | - { when: has_menu, accept: equal, send: Page_Down } 31 | 32 | paging_with_comma_period: 33 | __append: 34 | - { when: paging, accept: comma, send: Page_Up } 35 | - { when: has_menu, accept: period, send: Page_Down } 36 | 37 | paging_with_brackets: 38 | __append: 39 | - { when: paging, accept: bracketleft, send: Page_Up } 40 | - { when: has_menu, accept: bracketright, send: Page_Down } 41 | 42 | numbered_mode_switch: 43 | __append: 44 | - { when: always, accept: Control+Shift+1, select: .next } 45 | - { when: always, accept: Control+Shift+2, toggle: ascii_mode } 46 | - { when: always, accept: Control+Shift+3, toggle: full_shape } 47 | - { when: always, accept: Control+Shift+4, toggle: simplification } 48 | - { when: always, accept: Control+Shift+5, toggle: extended_charset } 49 | - { when: always, accept: Control+Shift+exclam, select: .next } 50 | - { when: always, accept: Control+Shift+at, toggle: ascii_mode } 51 | - { when: always, accept: Control+Shift+numbersign, toggle: full_shape } 52 | - { when: always, accept: Control+Shift+dollar, toggle: simplification } 53 | - { when: always, accept: Control+Shift+percent, toggle: extended_charset } 54 | 55 | windows_compatible_mode_switch: 56 | __append: 57 | - { when: always, accept: Shift+space, toggle: full_shape } 58 | - { when: always, accept: Control+period, toggle: ascii_punct } 59 | 60 | optimized_mode_switch: 61 | __append: 62 | - { when: always, accept: Control+Shift+space, select: .next } 63 | - { when: always, accept: Shift+space, toggle: ascii_mode } 64 | - { when: always, accept: Control+comma, toggle: full_shape } 65 | - { when: always, accept: Control+period, toggle: ascii_punct } 66 | - { when: always, accept: Control+slash, toggle: simplification } 67 | - { when: always, accept: Control+backslash, toggle: extended_charset } 68 | -------------------------------------------------------------------------------- /yuming/beta/schema/yuming_essence.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yuming_essence 6 | name: 日月·整句 7 | version: 乙巳立夏 8 | author: 9 | - 作者 朱宇浩 10 | - Rime方案 11 | - 官方QQ群 735728797 12 | description: | 13 | 日月輸入法之簡約版,不使用任何腳本,无字詞過濾,无拆分提示,不自動上屏. 14 | 適用於終端編輯器配合 rime-ls 使用. 15 | dependencies: 16 | - yuhao_pinyin 17 | 18 | switches: 19 | - options: [ gb2312, gbk, utf8 ] 20 | states: [ gb2312, GBK, UTF-8 ] 21 | reset: 1 22 | - name: ascii_mode 23 | states: [中文, 西文] 24 | reset: 0 25 | - name: full_shape 26 | states: ["半角", "全角"] 27 | reset: 0 28 | - name: ascii_punct 29 | states: [。,, .,] 30 | reset: 0 31 | 32 | engine: 33 | processors: 34 | - ascii_composer 35 | - recognizer 36 | - key_binder 37 | - speller 38 | - punctuator 39 | - selector 40 | - navigator 41 | - express_editor 42 | segmentors: 43 | - ascii_segmentor 44 | - matcher 45 | - abc_segmentor 46 | - punct_segmentor 47 | - fallback_segmentor 48 | translators: 49 | - punct_translator 50 | - history_translator@history 51 | - reverse_lookup_translator 52 | - script_translator 53 | # - script_translator@pinyin 54 | filters: 55 | - charset_filter@gb2312 56 | - charset_filter@gbk 57 | - uniquifier 58 | 59 | speller: 60 | alphabet: zyxwvutsrqponmlkjihgfedcba/ 61 | initials: zyxwvutsrqponmlkjihgfedcba/ 62 | delimiter: "`" 63 | auto_select: true 64 | 65 | translator: 66 | dictionary: yuming_essence 67 | prism: yuming_essence 68 | db_class: tabledb 69 | enable_completion: true 70 | enable_sentence: false 71 | enable_user_dict: false 72 | enable_encoder: false 73 | encode_commit_history: false # 对连续上屏的词自动成词 74 | max_phrase_length: 4 # 自动成词的最大词长 75 | preedit_format: 76 | # - "xlit|abcdefghijklmnopqrstuvwxyz|ㄚ卜女金ㄜ一目田〡日戈小耳月ㄛ大几文木火ㄨ土人羊竹ㄗ|" 77 | - "xlit|`|·|" 78 | comment_format: 79 | - "xform/^~/ /" 80 | disable_user_dict_for_patterns: 81 | - "^z.*$" 82 | initial_quality: 1000 83 | 84 | pinyin: 85 | dictionary: yuhao_pinyin 86 | enable_completion: false 87 | preedit_format: 88 | - xform/([nl])v/$1ü/ 89 | - xform/([nl])ue/$1üe/ 90 | - xform/([jqxy])v/$1u/ 91 | initial_quality: 1 92 | 93 | history: 94 | input: z 95 | size: 9 96 | initial_quality: 10 97 | 98 | reverse_lookup: 99 | dictionary: yuhao_pinyin 100 | prefix: "z" 101 | preedit_format: 102 | - xform/([nl])v/$1ü/ 103 | - xform/([nl])ue/$1üe/ 104 | - xform/([jqxy])v/$1u/ 105 | 106 | punctuator: 107 | import_preset: symbols 108 | half_shape: 109 | "`": "`" 110 | "@": "@" 111 | "#": "#" 112 | "%": "%" 113 | "*": "*" 114 | "\\": "、" 115 | "[": "「" 116 | "]": "」" 117 | "{": "『" 118 | "}": "』" 119 | "/": "/" 120 | "|": "|" 121 | 122 | key_binder: 123 | bindings: 124 | - { when: always, accept: "Control+period", toggle: ascii_punct } 125 | - { when: always, accept: "Control+Shift+period", toggle: ascii_punct } 126 | - { when: has_menu, accept: "0", toggle: utf8 } 127 | - { when: has_menu, accept: semicolon, send: 2 } # 分号次选 128 | - { when: has_menu, accept: apostrophe, send: 3 } # 引号三选 129 | - { when: has_menu, accept: minus, send: Page_Up } # 減號上翻頁 130 | - { when: has_menu, accept: equal, send: Page_Down } # 等號下翻頁 131 | - { when: has_menu, accept: Tab, send: Escape } # Tab 下翻頁 132 | - { when: composing, accept: Escape, send: "Shift+BackSpace" } # 逐字删除 133 | 134 | recognizer: 135 | import_preset: default 136 | patterns: 137 | uppercase: "^(?![`;]).*[A-Z][-_+.'0-9A-Za-z]*$" 138 | reverse_lookup: "^z([a-z]+?)*$" 139 | punct: "^/([0-9]0?|[A-Za-z]+)?$" 140 | # number: "^[-+]?[0-9][,.:0-9]*[%]?$" 141 | -------------------------------------------------------------------------------- /lua/yuhao/deprecated/yuhao_add_placeholder_candidate.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- Name: yuhao_add_placeholder_candidate.lua 3 | -- 名稱: 添加佔位符候選項 4 | -- Version: 20250712 5 | -- Author: forFudan 朱宇浩 6 | -- Github: https://github.com/forFudan/ 7 | -- Purpose: 非五碼時,爲單一候選項添加一個佔位符候選項,防止自動上屏 8 | -- 版權聲明: 9 | -- 專爲宇浩輸入法製作 10 | -- 轉載請保留作者名和出處 11 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 12 | --------------------------------------- 13 | 14 | 介紹: 15 | 滿足一下情況時,添加一個佔位符候選項: 16 | 1. 當前候選欄中的候選項數量爲 0 或 1. 17 | 2. 當前唯一候選項不以 aeiou 結尾且輸入編碼低於五. 18 | 19 | 版本: 20 | 20250712: 初版. 21 | 20250810: 如果沒有空格上屏的簡碼字,則不需要添加佔位符候選項. 22 | 20250820: 如果auto_select爲false,即不自動選擇候選項,則不需要添加佔位符候選項. 23 | --------------------------- 24 | --]] 25 | 26 | local this = {} 27 | 28 | function this.init(env) 29 | local config = env.engine.schema.config 30 | env.auto_select = config:get_string('speller/auto_select') 31 | end 32 | 33 | function this.func(input, env) 34 | 35 | if env.auto_select == "false" then 36 | -- 如果不自動選擇候選項,則不需要添加佔位符候選項. 37 | for cand in input:iter() do 38 | yield(cand) 39 | end 40 | return 41 | end 42 | 43 | if env.engine.context:get_option("yuhao_hide_space_candidates") and env.engine.context:get_option("yuhao_autocompletion_filter") then 44 | -- If there is no space candidates and no autocompletion. 45 | for cand in input:iter() do 46 | yield(cand) 47 | end 48 | return 49 | end 50 | 51 | if (env.engine.context.input:match("^%L")) then 52 | for cand in input:iter() do 53 | yield(cand) 54 | end 55 | return 56 | end 57 | 58 | if env.engine.context.input:match("^[z/`]") then 59 | -- If the input starts with 'z', '/', or '`', we yield all candidates. 60 | for cand in input:iter() do 61 | yield(cand) 62 | end 63 | return 64 | end 65 | 66 | if env.engine.context.input:match("[aeiou]%l$") then 67 | -- Any letter following a vowel is considered a new character. 68 | return 69 | end 70 | 71 | -- Count the number of candidates in the input. 72 | -- If 0, no candidates; if 1, only one candidate; if 2, more than one candidate. 73 | -- The iteration will consume the candidate, so we store the first and second candidates. 74 | local first_cand = nil 75 | local second_cand = nil 76 | local number_of_candidates = 0 77 | for cand in input:iter() do 78 | number_of_candidates = number_of_candidates + 1 79 | if number_of_candidates == 1 then 80 | first_cand = cand 81 | end 82 | if number_of_candidates == 2 then 83 | second_cand = cand 84 | break 85 | end 86 | end 87 | 88 | local input_text = env.engine.context.input 89 | local length_of_input = string.len(input_text) 90 | local placeholder_cand = Candidate("placeholder", 1, 5, "", "宇浩·日月") 91 | 92 | if number_of_candidates == 0 then 93 | --- If there is no candidates. 94 | if env.engine.context.input:match("[aeiou]$") then 95 | -- If the the last letter is a vowel, 96 | -- we do not add a placeholder candidate, 97 | -- Example: `wkk` = 俱 `u` = 不 98 | -- `wkku` should return nothing so that RIME will pop out `wkk` 99 | -- and left `u` in the preedit region 100 | return 101 | elseif length_of_input >= 5 then 102 | -- If the length of input reaches 5, we do not add a placeholder candidate. 103 | -- Example: `wkkgu` = 個 104 | -- 可以直接上屏 105 | return 106 | else 107 | -- If there is no candidates and the input length is less than 5, 108 | -- we need to prevent auto-selection. 109 | -- Example: `hzlll` = 邊 110 | -- `hzl` and `hzll` have no candidates, we should add a placeholder 111 | -- so that `hz` = 自己 will not be auto-selected. 112 | yield(placeholder_cand) 113 | end 114 | elseif number_of_candidates == 1 then 115 | -- If there is only one candidate, first yield it 116 | yield(first_cand) 117 | -- Then, check if the input ends with a vowel or the length of input is 5. 118 | -- If not, add a placeholder candidate. 119 | local ends_with_vowel = input_text:match("[aeiou]$") 120 | if not (ends_with_vowel or (length_of_input == 5)) then 121 | yield(placeholder_cand) 122 | end 123 | else 124 | -- If there are multiple candidates, yield them as usual. 125 | yield(first_cand) 126 | yield(second_cand) 127 | for cand in input:iter() do 128 | yield(cand) 129 | end 130 | end 131 | end 132 | 133 | return this -------------------------------------------------------------------------------- /yujoy/beta/schema/yujoy_full.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yujoy_full 6 | name: 卿雲·全碼單字 7 | version: 20240527 8 | author: 9 | - 項目策劃 錢多多 10 | - 技术支持 forFudan 11 | - Rime方案 12 | - 官方QQ群 374630778 13 | dependencies: 14 | - yuhao_pinyin 15 | - yujoy_chaifen 16 | 17 | switches: 18 | - options: 19 | - yuhao_chaifen.off 20 | - yuhao_chaifen.lv2 21 | - yuhao_chaifen.lv3 22 | states: [隱藏注解, 二重注解, 多重註解] 23 | reset: 0 24 | - name: yuhao_autocompletion_filter 25 | reset: 0 26 | states: [輸入預測, 精確匹配] 27 | # Control+Shift+Y 28 | - name: traditionalization 29 | states: [简保持, 简转繁] 30 | reset: 0 31 | # Control+Shift+F 32 | - name: simplification 33 | states: [繁保持, 繁轉簡] 34 | reset: 0 35 | # Control+Shift+J 36 | - name: ascii_punct 37 | states: [。,, .,] 38 | reset: 0 39 | - name: ascii_mode 40 | states: [中文, 西文] 41 | reset: 0 42 | - name: full_shape 43 | states: ["半角", "全角"] 44 | reset: 0 45 | 46 | engine: 47 | processors: 48 | - ascii_composer 49 | - recognizer 50 | - lua_processor@*yuhao.yuhao_chaifen_processor 51 | - key_binder 52 | - speller 53 | - punctuator 54 | - selector 55 | - navigator 56 | - express_editor 57 | segmentors: 58 | - ascii_segmentor 59 | - matcher 60 | - abc_segmentor 61 | - punct_segmentor 62 | - fallback_segmentor 63 | translators: 64 | - punct_translator 65 | - history_translator@history 66 | - reverse_lookup_translator 67 | - table_translator 68 | filters: 69 | - lua_filter@*yuhao.yuhao_autocompletion_filter 70 | - simplifier@traditionalize 71 | - simplifier@simplify 72 | - lua_filter@*yuhao.yuhao_chaifen_filter 73 | - lua_filter@*yuhao.yuhao_postpone_full_code 74 | - uniquifier 75 | 76 | traditionalize: 77 | tags: [abc, reverse_lookup] 78 | option_name: traditionalization 79 | opencc_config: s2t.json 80 | tips: all 81 | comment_format: 82 | - xform/^/〔/ 83 | - xform/$/〕/ 84 | 85 | simplify: 86 | tags: [abc, reverse_lookup] 87 | option_name: simplification 88 | opencc_config: t2s.json 89 | tips: all 90 | comment_format: 91 | - xform/^/〔/ 92 | - xform/$/〕/ 93 | 94 | schema_name: 95 | code: yujoy_full 96 | chaifen: yujoy_chaifen 97 | 98 | yuhao_chaifen: 99 | lua: 100 | switch_key: "Control+c" 101 | cycle_key: "Shift+Control+C" 102 | 103 | speller: 104 | alphabet: abcdefghijklmnopqrstuvwxyz/ 105 | initials: abcdefghijklmnopqrstuvwxyz/ 106 | delimiter: "`" 107 | max_code_length: 4 108 | auto_select: false 109 | algebra: 110 | 111 | translator: 112 | dictionary: yujoy_full 113 | prism: yujoy_full 114 | # db_class: tabledb 115 | enable_completion: true 116 | enable_sentence: false 117 | enable_user_dict: false 118 | enable_encoder: false 119 | encode_commit_history: false # 对连续上屏的词自动成词 120 | max_phrase_length: 4 # 自动成词的最大词长 121 | preedit_format: [] 122 | comment_format: 123 | - "xform/^~/ /" 124 | disable_user_dict_for_patterns: 125 | - "^z.*$" 126 | 127 | history: 128 | input: z 129 | size: 1 130 | initial_quality: 1 131 | 132 | reverse_lookup: 133 | dictionary: yuhao_pinyin 134 | prefix: "z" 135 | tips: 〔全拼反查〕 136 | closing_tips: 〔反查关闭〕 137 | preedit_format: 138 | - xform/([nl])v/$1ü/ 139 | - xform/([nl])ue/$1üe/ 140 | - xform/([jqxy])v/$1u/ 141 | 142 | punctuator: 143 | import_preset: symbols 144 | half_shape: 145 | "`": "`" 146 | "#": "#" 147 | "%": "%" 148 | "*": "*" 149 | "\\": "、" 150 | "[": "「" 151 | "]": "」" 152 | "{": "『" 153 | "}": "』" 154 | "/": "/" 155 | "|": "|" 156 | 157 | key_binder: 158 | bindings: 159 | - { when: always, accept: "Control+period", toggle: ascii_punct } 160 | - { when: always, accept: "Control+Shift+period", toggle: ascii_punct } 161 | - { when: always, accept: "Control+Shift+J", toggle: simplification } 162 | - { when: always, accept: "Control+Shift+F", toggle: traditionalization } 163 | - { when: has_menu, accept: "/", toggle: yuhao_chaifen.off } # 拆分 164 | - { 165 | when: always, 166 | accept: "Control+Shift+Y", 167 | toggle: yuhao_autocompletion_filter, 168 | } # 輸入預測 169 | - { when: has_menu, accept: semicolon, send: 2 } # 分号次选 170 | - { when: has_menu, accept: apostrophe, send: 3 } # 引号三选 171 | - { when: has_menu, accept: Tab, send: 2 } # 製表符次选 172 | - { when: has_menu, accept: minus, send: Page_Up } #減號上翻頁 173 | - { when: has_menu, accept: equal, send: Page_Down } #等號下翻頁 174 | 175 | recognizer: 176 | import_preset: default 177 | patterns: 178 | uppercase: "^(?![`;]).*[A-Z][-_+.'0-9A-Za-z]*$" 179 | reverse_lookup: "^z([a-z]+?)*$" 180 | punct: "^/([0-9]0?|[A-Za-z]+)?$" 181 | number: "^[-+]?[0-9][,.:0-9]*[%]?$" 182 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_embeded_cands_archived.lua: -------------------------------------------------------------------------------- 1 | -- 作者:王牌餅乾 2 | -- https://github.com/lost-melody/ 3 | -- 转载请保留作者名 4 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 5 | --------------------------------------- 6 | 7 | -- 將要被返回的過濾器對象 8 | local embeded_cands_filter = {} 9 | 10 | -- 導入外部模块變量 11 | local yuhao_switch_vars = require("yuhao.yuhao_switch").var 12 | 13 | --[[ 14 | # xxx.schema.yaml 15 | switches: 16 | - name: embeded_cands 17 | states: [ 普通, 嵌入 ] 18 | reset: 1 19 | engine: 20 | filters: 21 | - lua_filter@*smyh.embeded_cands 22 | key_binder: 23 | bindings: 24 | - { when: always, accept: "Control+Shift+E", toggle: embeded_cands } 25 | --]] 26 | 27 | -- 候選序號標記 28 | local index_indicators = {"¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹", "⁰"} 29 | 30 | -- 首選/非首選格式定義 31 | -- seq: 候選序號; code: 編碼; 候選: 候選文本; comment: 候選提示 32 | local first_format = "候選commentseq" 33 | local next_format = " 候選commentseq" 34 | local separator = "" 35 | 36 | -- 讀取 schema.yaml 開關設置: 37 | local option_name = "embeded_cands" 38 | 39 | function embeded_cands_filter.init(env) 40 | -- 初始化局部表變量, 並裝入env 41 | local embeded = {} 42 | env.embeded = embeded 43 | local handler = function(ctx, name) 44 | -- 通知回調, 當改變選項值時更新暫存的值 45 | if name == option_name then 46 | embeded.embeded_cands = ctx:get_option(name) 47 | if embeded.embeded_cands == nil then 48 | -- 當選項不存在時默認爲啓用狀態 49 | embeded.embeded_cands = true 50 | end 51 | end 52 | end 53 | -- 初始化爲選項實際值, 如果設置了 reset, 則會再次觸發 handler 54 | handler(env.engine.context, option_name) 55 | -- 注册通知回調 56 | env.engine.context.option_update_notifier:connect(handler) 57 | end 58 | 59 | -- 渲染提示, 因爲提示經常有可能爲空, 抽取爲函數更昜操作 60 | local function render_comment(comment) 61 | if string.match(comment, "^[ ~]") then 62 | -- 丟棄以空格和"~"開頭的提示串, 這通常是補全提示 63 | comment = "" 64 | elseif string.len(comment) ~= 0 then 65 | comment = "["..comment.."]" 66 | end 67 | return comment 68 | end 69 | 70 | -- 轉義符號 `%`, 因爲該符號是 string.gsub() 後兩個參數的轉義字符 71 | local function escape_percent(text) 72 | text = string.gsub(text, "%%", "%%%%") 73 | return text 74 | end 75 | 76 | -- 渲染單個候選項 77 | local function render_cand(seq, code, text, comment) 78 | local cand = "" 79 | -- 選擇渲染格式 80 | if seq == 1 then 81 | cand = first_format 82 | else 83 | cand = next_format 84 | end 85 | -- 渲染提示串 86 | comment = render_comment(comment) 87 | cand = string.gsub(cand, "seq", index_indicators[seq]) 88 | cand = string.gsub(cand, "code", escape_percent(code)) 89 | cand = string.gsub(cand, "候選", escape_percent(text)) 90 | cand = string.gsub(cand, "comment", escape_percent(comment)) 91 | return cand 92 | end 93 | 94 | -- 過濾器 95 | function embeded_cands_filter.func(input, env) 96 | if not env.embeded.embeded_cands and not yuhao_switch_vars.is_zhelp then 97 | for cand in input:iter() do 98 | yield(cand) 99 | end 100 | return 101 | end 102 | 103 | -- 要顯示的候選數量 104 | local page_size = env.engine.schema.page_size 105 | -- 暫存當前頁候選, 然后批次送出 106 | local page_cands, page_rendered = {}, {} 107 | -- 暫存索引, 首選和預編輯文本 108 | local index, first_cand, preedit = 0, nil, "" 109 | 110 | local function refresh_preedit() 111 | if first_cand then 112 | first_cand.preedit = table.concat(page_rendered, separator) 113 | -- 將暫存的一頁候選批次送出 114 | for _, c in ipairs(page_cands) do 115 | yield(c) 116 | end 117 | end 118 | -- 清空暫存 119 | first_cand, preedit = nil, "" 120 | page_cands, page_rendered = {}, {} 121 | end 122 | 123 | local hash = {} 124 | local rank = 0 125 | -- 迭代器 126 | local iter, obj = input:iter() 127 | -- 迭代由翻譯器輸入的候選列表 128 | local next = iter(obj) 129 | while next do 130 | -- 頁索引自增, 滿足 1 <= index <= page_size 131 | index = index + 1 132 | 133 | -- 當前遍歷候選項 134 | local cand = next 135 | 136 | -- 去除重複項 137 | if (not hash[cand.text]) then 138 | hash[cand.text] = true 139 | 140 | if not first_cand then 141 | -- 把首選捉出來 142 | first_cand = cand 143 | end 144 | 145 | rank = rank + 1 146 | 147 | -- 修改首選的預编輯文本, 這会作爲内嵌編碼顯示到輸入處 148 | preedit = render_cand(rank, first_cand.preedit, cand.text, cand.comment) 149 | 150 | -- 存入候選 151 | table.insert(page_cands, cand) 152 | table.insert(page_rendered, preedit) 153 | end 154 | -- 遍歷完一頁候選後, 刷新預編輯文本 155 | if index == page_size then 156 | refresh_preedit() 157 | rank = 0 158 | end 159 | 160 | -- 當前候選處理完畢, 查詢下一個 161 | next = iter(obj) 162 | 163 | -- 如果當前暫存候選不足page_size但没有更多候選, 則需要刷新預編輯並送出 164 | if not next and index < page_size then 165 | refresh_preedit() 166 | end 167 | 168 | -- 下一頁, index歸零 169 | index = index % page_size 170 | end 171 | end 172 | 173 | function embeded_cands_filter.fini(env) 174 | end 175 | 176 | return embeded_cands_filter 177 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_postpone_full_code.lua: -------------------------------------------------------------------------------- 1 | -- 名稱: yuhao_postpone_full_code.lua 2 | -- 3 | -- 原作者: Ace-Who 4 | -- 原代碼介紹: 5 | -- 出现重码时,将全码匹配且有简码的「单字」「适当」后置。 6 | -- 目前的实现方式,原理适用于所有使用规则简码的形码方案。 7 | -- 8 | -- 修改者: forFudan 9 | -- 目的:條件後置已出簡的全碼單字 10 | -- 版本: 20240430 11 | -- 修改介紹: 12 | -- 1. 根據宇浩輸入法更新字根列表 13 | -- 2. 只後置位於候選欄第一項的全碼單字 14 | -- 3. 只後置選定漢字的全碼 15 | -- 使用方法: 16 | -- 1. 默認情况下,只有當次選爲高頻字時方後置其對應首選. 17 | -- 2. schema 文件的 yuhao_postpone_full_code/selected_chars 18 | -- 列出了有需要後置的高頻字列表. 19 | -- 3. 此列表缺省或爲空字符串時,無條件全碼後置. 20 | -- 4. 可增添字符更改後置的範圍. 21 | -- 參見: 22 | -- 關於條件後置請參見宇浩輸入法官網 23 | 24 | local radstr = 25 | "也不亡尚穴韋甲屮丌鬼巛丶户用爪石非僉巳儿酉雨乃生马电豸馬囗禺了尸丅面食寸幺瓦壬足麻齒乙骨又米冊爿末西王古讠人毛世丨止母丰自艮士合禾曰广见上灬〇𬺰𠂤缶七牛卯刀文千扌瓜阝斤風气魚衤工厶龰欠攴宀彡見丂竹罒烏目至艹𠂇二丬已方兀一木之八且臣矢乚卩鸟犬牙弓疒糸向山匚戊廴夕土田黽丷凡貝饣鱼刂大豕弋亦门巾長示片車犭耳夫羽𧘇水飛亠黑未戈小礻火㗊虎爾三车𡗗辛鬥鹵冖口手氵辰言白虫尤心入高龶臼殳舟卜走立來鹿子辶彐纟丿身贝申皿其匕乌亍皮早十日而〢歹甫羊革夂予干亥隹月己丁彳咼钅力門女川长亻乂巴夭舌九几冂金厂由鳥𫝀⺄㇂丩⺶𠕁龴⻟𫩏𠂒〣冎髟ソ𠂎㇞⼌マ釒⼓丄𣥂𡈼𡿨⻍⺂ッ卄乀丆戶⻎訁⼹𫠠⺧𠃌コ䒑𰃦⺮氺卝戸匸𰁜⼁𩙿𠃊习乜忄𭕄㇍兀㐄𠂊𠥓勹冫丱乁𰀁𤣩爫⼅㇇⼂廾㇣㇈⺈𠘧𠀎𥫗㔾㇕㇀龷⺆凵Γ𠂉𫶧㇜耂ス㇒𦥑糹𡭔⺼攵⼃𰆊飠𠃎ユ⺊𥝌㇏⺍⾻乛⻗虍卅ュ㐅⻞⼶㇝卌𠁼⺬𠆢尢⺌⺁𠃍𠃋龵⺥㇉𧰨𠄌朩𠤎镸⼢牜亅㇅癶𠂆⻊巜𠄎𠃑𱼀𠃜⾅覀䶹キヰ⺋⺝𠘨⼫⺕夊𰀪⺩𠂭𧾷⺀" 26 | 27 | local function init(env) 28 | local config = env.engine.schema.config 29 | local code_rvdb = config:get_string('schema_name/code') 30 | env.code_rvdb = ReverseDb('build/' .. code_rvdb .. '.reverse.bin') 31 | env.mem = Memory(env.engine, Schema(code_rvdb)) 32 | env.his_inp = config:get_string('history/input') 33 | env.delimiter = config:get_string('speller/delimiter') 34 | env.freqchr = config:get_string('yuhao_postpone_full_code/selected_chars') 35 | env.max_index = config:get_int('yuhao_postpone_full_code/lua/max_index') 36 | or 3 37 | end 38 | 39 | local function get_short(codestr) 40 | local s = ' ' .. codestr 41 | for code in s:gmatch('%l+') do 42 | if s:find(' ' .. code .. '%l+') then 43 | return code 44 | end 45 | end 46 | end 47 | 48 | local function has_short_and_is_full(cand, env) 49 | -- completion 和 sentence 类型不属于精确匹配,但要通过 cand:get_genuine() 判 50 | -- 断,因为 simplifier 会覆盖类型为 simplified。先行判断 type 并非必要,只是 51 | -- 为了轻微的性能优势。 52 | local cand_gen = cand:get_genuine() 53 | if cand_gen.type == 'completion' or cand_gen.type == 'sentence' then 54 | return false, true 55 | end 56 | local input = env.engine.context.input 57 | local cand_input = input:sub(cand.start + 1, cand._end) 58 | -- 去掉可能含有的 delimiter。 59 | cand_input = cand_input:gsub('[' .. env.delimiter .. ']', '') 60 | -- 字根可能设置了特殊扩展码,不视作全码,不予后置。 61 | if cand_input:len() > 2 and radstr:find(cand_gen.text, 1, true) then 62 | return 63 | end 64 | -- history_translator 不后置。 65 | if cand_input == env.his_inp then return end 66 | local codestr = env.code_rvdb:lookup(cand_gen.text) 67 | local is_first = true 68 | if env.mem:dict_lookup(string.sub(codestr, 1, 3), false, 1) then 69 | local count = 0 70 | for entry in env.mem:iter_dict() do 71 | count = count + 1 72 | if entry.text == cand_gen.text then 73 | break 74 | end 75 | end 76 | if count > 1 then 77 | is_first = false 78 | end 79 | end 80 | local not_full = not 81 | string.find(' ' .. codestr .. ' ', ' ' .. cand_input .. ' ', 1, true) 82 | local short = not not_full and get_short(codestr) 83 | -- 注意排除有简码但是输入的是不规则编码的情况 84 | 85 | if (env.freqchr == "") or (env.freqchr == nil) then 86 | return short and is_first and cand_input:find('^' .. short .. '%l+'), 87 | not_full 88 | else 89 | -- 只後置選定的漢字 90 | return short and is_first and cand_input:find('^' .. short .. '%l+') and env.freqchr:find(cand_gen.text, 1, true), 91 | not_full 92 | end 93 | end 94 | 95 | local function filter(input, env) 96 | local context = env.engine.context 97 | if not context:get_option("yuhao_postpone_full_code") then 98 | for cand in input:iter() do yield(cand) end 99 | else 100 | -- 具体实现不是后置目标候选,而是前置非目标候选 101 | local dropped_cands = {} 102 | local done_drop 103 | local pos = 1 104 | -- Todo: 计算 pos 时考虑可能存在的重复候选被 uniquifier 合并的情况。 105 | for cand in input:iter() do 106 | if done_drop then 107 | yield(cand) 108 | else 109 | -- 后置不越过 env.max_index 和以下几类候选: 110 | -- 1) 顶功方案使用 script_translator 导致的匹配部分输入的候选,例如输入 111 | -- otu 且光标在 u 后时会出现编码为 ot 的候选。不过通过填满码表的三码和 112 | -- 四码的位置,能消除这类候选。2) 顶功方案的造词翻译器允许出现的 113 | -- completion 类型候选。3) 顶功方案的补空候选——全角空格( U+3000)。 114 | local is_bad_script_cand = cand._end < context.caret_pos 115 | local drop, not_full = has_short_and_is_full(cand, env) 116 | if pos >= env.max_index 117 | or is_bad_script_cand or not_full or cand.text == ' ' then 118 | for i, cand in ipairs(dropped_cands) do yield(cand) end 119 | done_drop = true 120 | yield(cand) 121 | -- 精确匹配的词组不予后置 122 | elseif not drop or utf8.len(cand.text) > 1 then 123 | yield(cand) 124 | pos = pos + 1 125 | else 126 | table.insert(dropped_cands, cand) 127 | end 128 | end 129 | end 130 | for i, cand in ipairs(dropped_cands) do yield(cand) end 131 | end 132 | end 133 | 134 | return { init = init, func = filter } 135 | -------------------------------------------------------------------------------- /yuling/beta/themes/squirrel.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | style: 3 | color_scheme: mac_light 4 | color_scheme_dark: mac_dark 5 | candidate_list_layout: stacked 6 | alpha: 0.88 # 候选窗口透明度:符点型数据,小数点形式,不然出错无法正常显示皮肤 7 | font_face: Yuniversus, WenJinMinchoP0-Regular, WenJinMinchoP2-Regular, WenJinMinchoP3-Regular, TH-Tshyn-P0, TH-Tshyn-P1, TH-Tshyn-P2 8 | label_font_face: Inconsolata # 字体 - 候选数字 9 | font_point: 20 # 字体大小 - 候选 10 | label_font_point: 16 # 字体大小 - 候选序号 11 | comment_font_point: 12 12 | candidate_format: "%c %@ " # 用 1/6 em 空格 U+2005 来控制编号 %c 和候选词 %@ 前后的空间 13 | inline_preedit: true 14 | preedit_style: preview 15 | 16 | preset_color_schemes: 17 | cosmic: 18 | name: 宇宙Cosmic 19 | author: ZHU Yuhao 朱宇浩 20 | corner_radius: 5 # 窗口圆角 21 | hilited_corner_radius: 5 # 高亮圆角 22 | line_spacing: 10 # 行间距(适用于竖排) 23 | border_height: 4 # 窗口上下高度,大于圆角半径才生效 24 | border_width: 4 # 窗口左右宽度,大于圆角半径才生效 25 | text_color: 0x0c200d # preedit字符颜色 拼音行文字颜色 0x0c200d 瓷器绿 26 | back_color: 0xe7f8ff # 背景颜色 候选条背景色 0xfff8e7 cosmic latte 27 | border_color: 0xc5c8cc # 边框色 28 | label_color: 0x919183 # 预选栏编号颜色 29 | candidate_text_color: 0x0c200d # 预选项文字颜色 候选字颜色 0x0c200d 瓷器緑 30 | comment_text_color: 0x1029de # 拼音等提示文字颜色 候选字注释颜色 0xde2910 国旗紅 31 | hilited_text_color: 0x0c200d # 高亮拼音 (需要开启内嵌编码) 输入码颜色 0x0c200d 瓷器緑 32 | hilited_back_color: 0xe7f8ff # 第一候选项背景背景色 33 | hilited_candidate_text_color: 0xe7f8ff # 第一候选项文字颜色 高亮候选字颜色 0xfff8e7 cosmic latte 34 | hilited_candidate_label_color: 0xe7f8ff # 第一候选项编号颜色 35 | hilited_candidate_back_color: 0x4f4f2f # 高亮候选字背景颜色 36 | hilited_comment_text_color: 0xe7f8ff # 注解文字高亮 高亮候选字注释颜色 0xfff8e7 cosmic latte 37 | 38 | cosmic_dark: 39 | name: 宇宙深邃CosmicDark 40 | author: ZHU Yuhao 朱宇浩 41 | corner_radius: 5 # 窗口圆角 42 | hilited_corner_radius: 5 # 高亮圆角 43 | line_spacing: 10 # 行间距(适用于竖排) 44 | border_height: 4 # 窗口上下高度,大于圆角半径才生效 45 | border_width: 4 # 窗口左右宽度,大于圆角半径才生效 46 | text_color: 0xe7f8ff # preedit字符颜色 拼音行文字颜色 0x0c200d 瓷器绿 47 | back_color: 0x0c200d # 背景颜色 候选条背景色 0xfff8e7 cosmic latte 48 | border_color: 0x0c200d # 边框色 49 | label_color: 0x919183 # 预选栏编号颜色 50 | candidate_text_color: 0xe7f8ff # 预选项文字颜色 候选字颜色 0x0c200d 瓷器緑 51 | comment_text_color: 0x1029de # 拼音等提示文字颜色 候选字注释颜色 0xde2910 国旗紅 52 | hilited_text_color: 0xe7f8ff # 高亮拼音 (需要开启内嵌编码) 输入码颜色 0x0c200d 瓷器緑 53 | hilited_back_color: 0x0c200d # 第一候选项背景背景色 54 | hilited_candidate_text_color: 0x0c200d # 第一候选项文字颜色 高亮候选字颜色 0xfff8e7 cosmic latte 55 | hilited_candidate_label_color: 0x0c200d # 第一候选项编号颜色 56 | hilited_candidate_back_color: 0xe7f8ff # 高亮候选字背景颜色 57 | hilited_comment_text_color: 0x0c200d # 注解文字高亮 高亮候选字注释颜色 0xfff8e7 cosmic latte 58 | 59 | mac_light: 60 | name: Mac浅色 61 | corner_radius: 5 # 窗口圆角 62 | hilited_corner_radius: 5 # 高亮圆角 63 | line_spacing: 10 # 行间距(适用于竖排) 64 | border_height: 4 # 窗口上下高度,大于圆角半径才生效 65 | border_width: 4 # 窗口左右宽度,大于圆角半径才生效 66 | text_color: 0x424242 # 拼音行文字颜色 67 | back_color: 0xFFFFFF # 候选条背景色 68 | border_color: 0xFFFFFF # 边框色 69 | label_color: 0x999999 # 预选栏编号颜色 70 | candidate_text_color: 0x3c3c3c # 预选项文字颜色 71 | comment_text_color: 0x999999 # 拼音等提示文字颜色 72 | hilited_text_color: 0x999999 # 高亮拼音 (需要开启内嵌编码) 73 | hilited_back_color: 0xD75A00 # 第一候选项背景背景色 74 | hilited_candidate_text_color: 0xFFFFFF # 第一候选项文字颜色 75 | hilited_candidate_label_color: 0xFFFFFF # 第一候选项编号颜色 76 | hilited_comment_text_color: 0x999999 # 注解文字高亮 77 | 78 | mac_dark: 79 | name: Mac深色 80 | corner_radius: 5 # 窗口圆角 81 | hilited_corner_radius: 5 # 高亮圆角 82 | line_spacing: 10 # 行间距(适用于竖排) 83 | border_height: 4 # 窗口上下高度,大于圆角半径才生效 84 | border_width: 4 # 窗口左右宽度,大于圆角半径才生效 85 | text_color: 0x424242 # 拼音行文字颜色 86 | back_color: 0x252a2e # 候选条背景色 87 | border_color: 0x050505 # 边框色 88 | label_color: 0x999999 # 预选栏编号颜色 89 | candidate_text_color: 0xe9e9ea # 预选项文字颜色 90 | comment_text_color: 0x999999 # 拼音等提示文字颜色 91 | hilited_text_color: 0x999999 # 高亮拼音 (需要开启内嵌编码) 92 | hilited_back_color: 0xD75A00 # 第一候选项背景背景色 93 | hilited_candidate_text_color: 0xFFFFFF # 第一候选项文字颜色 94 | hilited_candidate_label_color: 0xFFFFFF # 第一候选项编号颜色 95 | hilited_comment_text_color: 0x999999 # 注解文字高亮 96 | 97 | 98 | app_options/+: 99 | net.kovidgoyal.kitty: 100 | ascii_mode: true 101 | vim_mode: true 102 | com.microsoft.VSCode: 103 | ascii_mode: true 104 | vim_mode: true -------------------------------------------------------------------------------- /yuming/beta/custom/squirrel.custom.yaml: -------------------------------------------------------------------------------- 1 | patch: 2 | style: 3 | color_scheme: mac_light 4 | color_scheme_dark: mac_dark 5 | candidate_list_layout: stacked 6 | alpha: 0.88 # 候选窗口透明度:符点型数据,小数点形式,不然出错无法正常显示皮肤 7 | font_face: Yuniversus, WenJinMinchoP0-Regular, WenJinMinchoP2-Regular, WenJinMinchoP3-Regular, TH-Tshyn-P0, TH-Tshyn-P1, TH-Tshyn-P2 8 | label_font_face: Inconsolata # 字体 - 候选数字 9 | font_point: 20 # 字体大小 - 候选 10 | label_font_point: 16 # 字体大小 - 候选序号 11 | comment_font_point: 12 12 | candidate_format: "%c %@ " # 用 1/6 em 空格 U+2005 来控制编号 %c 和候选词 %@ 前后的空间 13 | inline_preedit: true 14 | preedit_style: preview 15 | 16 | preset_color_schemes: 17 | cosmic: 18 | name: 宇宙Cosmic 19 | author: ZHU Yuhao 朱宇浩 20 | corner_radius: 5 # 窗口圆角 21 | hilited_corner_radius: 5 # 高亮圆角 22 | line_spacing: 10 # 行间距(适用于竖排) 23 | border_height: 4 # 窗口上下高度,大于圆角半径才生效 24 | border_width: 4 # 窗口左右宽度,大于圆角半径才生效 25 | text_color: 0x0c200d # preedit字符颜色 拼音行文字颜色 0x0c200d 瓷器绿 26 | back_color: 0xe7f8ff # 背景颜色 候选条背景色 0xfff8e7 cosmic latte 27 | border_color: 0xc5c8cc # 边框色 28 | label_color: 0x919183 # 预选栏编号颜色 29 | candidate_text_color: 0x0c200d # 预选项文字颜色 候选字颜色 0x0c200d 瓷器緑 30 | comment_text_color: 0x1029de # 拼音等提示文字颜色 候选字注释颜色 0xde2910 国旗紅 31 | hilited_text_color: 0x0c200d # 高亮拼音 (需要开启内嵌编码) 输入码颜色 0x0c200d 瓷器緑 32 | hilited_back_color: 0xe7f8ff # 第一候选项背景背景色 33 | hilited_candidate_text_color: 0xe7f8ff # 第一候选项文字颜色 高亮候选字颜色 0xfff8e7 cosmic latte 34 | hilited_candidate_label_color: 0xe7f8ff # 第一候选项编号颜色 35 | hilited_candidate_back_color: 0x4f4f2f # 高亮候选字背景颜色 36 | hilited_comment_text_color: 0xe7f8ff # 注解文字高亮 高亮候选字注释颜色 0xfff8e7 cosmic latte 37 | 38 | cosmic_dark: 39 | name: 宇宙深邃CosmicDark 40 | author: ZHU Yuhao 朱宇浩 41 | corner_radius: 5 # 窗口圆角 42 | hilited_corner_radius: 5 # 高亮圆角 43 | line_spacing: 10 # 行间距(适用于竖排) 44 | border_height: 4 # 窗口上下高度,大于圆角半径才生效 45 | border_width: 4 # 窗口左右宽度,大于圆角半径才生效 46 | text_color: 0xe7f8ff # preedit字符颜色 拼音行文字颜色 0x0c200d 瓷器绿 47 | back_color: 0x0c200d # 背景颜色 候选条背景色 0xfff8e7 cosmic latte 48 | border_color: 0x0c200d # 边框色 49 | label_color: 0x919183 # 预选栏编号颜色 50 | candidate_text_color: 0xe7f8ff # 预选项文字颜色 候选字颜色 0x0c200d 瓷器緑 51 | comment_text_color: 0x1029de # 拼音等提示文字颜色 候选字注释颜色 0xde2910 国旗紅 52 | hilited_text_color: 0xe7f8ff # 高亮拼音 (需要开启内嵌编码) 输入码颜色 0x0c200d 瓷器緑 53 | hilited_back_color: 0x0c200d # 第一候选项背景背景色 54 | hilited_candidate_text_color: 0x0c200d # 第一候选项文字颜色 高亮候选字颜色 0xfff8e7 cosmic latte 55 | hilited_candidate_label_color: 0x0c200d # 第一候选项编号颜色 56 | hilited_candidate_back_color: 0xe7f8ff # 高亮候选字背景颜色 57 | hilited_comment_text_color: 0x0c200d # 注解文字高亮 高亮候选字注释颜色 0xfff8e7 cosmic latte 58 | 59 | mac_light: 60 | name: Mac浅色 61 | corner_radius: 5 # 窗口圆角 62 | hilited_corner_radius: 5 # 高亮圆角 63 | line_spacing: 10 # 行间距(适用于竖排) 64 | border_height: 4 # 窗口上下高度,大于圆角半径才生效 65 | border_width: 4 # 窗口左右宽度,大于圆角半径才生效 66 | text_color: 0x424242 # 拼音行文字颜色 67 | back_color: 0xFFFFFF # 候选条背景色 68 | border_color: 0xFFFFFF # 边框色 69 | label_color: 0x999999 # 预选栏编号颜色 70 | candidate_text_color: 0x3c3c3c # 预选项文字颜色 71 | comment_text_color: 0x999999 # 拼音等提示文字颜色 72 | hilited_text_color: 0x999999 # 高亮拼音 (需要开启内嵌编码) 73 | hilited_back_color: 0xD75A00 # 第一候选项背景背景色 74 | hilited_candidate_text_color: 0xFFFFFF # 第一候选项文字颜色 75 | hilited_candidate_label_color: 0xFFFFFF # 第一候选项编号颜色 76 | hilited_comment_text_color: 0x999999 # 注解文字高亮 77 | 78 | mac_dark: 79 | name: Mac深色 80 | corner_radius: 5 # 窗口圆角 81 | hilited_corner_radius: 5 # 高亮圆角 82 | line_spacing: 10 # 行间距(适用于竖排) 83 | border_height: 4 # 窗口上下高度,大于圆角半径才生效 84 | border_width: 4 # 窗口左右宽度,大于圆角半径才生效 85 | text_color: 0x424242 # 拼音行文字颜色 86 | back_color: 0x252a2e # 候选条背景色 87 | border_color: 0x050505 # 边框色 88 | label_color: 0x999999 # 预选栏编号颜色 89 | candidate_text_color: 0xe9e9ea # 预选项文字颜色 90 | comment_text_color: 0x999999 # 拼音等提示文字颜色 91 | hilited_text_color: 0x999999 # 高亮拼音 (需要开启内嵌编码) 92 | hilited_back_color: 0xD75A00 # 第一候选项背景背景色 93 | hilited_candidate_text_color: 0xFFFFFF # 第一候选项文字颜色 94 | hilited_candidate_label_color: 0xFFFFFF # 第一候选项编号颜色 95 | hilited_comment_text_color: 0x999999 # 注解文字高亮 96 | 97 | 98 | app_options/+: 99 | net.kovidgoyal.kitty: 100 | ascii_mode: true 101 | vim_mode: true 102 | com.microsoft.VSCode: 103 | ascii_mode: true 104 | vim_mode: true -------------------------------------------------------------------------------- /lua/yuhao/deprecated/yuhao_high_freq_first.lua: -------------------------------------------------------------------------------- 1 | -- Name: yuhao_high_freq_first.lua 2 | -- 名称: 繁簡極高頻字前置 3 | -- Version: 20240401 4 | -- Author: forFudan 朱宇浩 5 | -- Github: https://github.com/forFudan/ 6 | -- 版權聲明: 7 | -- 專爲宇浩輸入法製作 8 | -- 轉載請保留作者名和出處 9 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 10 | --------------------------------------- 11 | -- 12 | -- 介紹: 13 | -- 將候選中的繁簡極高頻字前置 14 | -- 簡體、繁體字頻分别排在前 3000 的漢字,約 4500 個 15 | -- 本腳本可以配合全碼後置功能使用,達到以下目的:當次選非高頻字,不後置出簡的字,以減少對簡碼的記憶負擔。 16 | -- 17 | -- Description: 18 | -- Prioritize the most frequent simplified and traditional Chinese characters 19 | -- 20 | -- 版本: 21 | -- 20240401: 初版 22 | 23 | --------------------------- 24 | 25 | local str = 26 | "牢肅曉祸奋妮螺休泼冰扳啥街魚碰贯諷女浴姻驗碟妾效程迹贷崇纹咦脏賺簇整趴來妒沸盼腾拱连妨阳镖靜聯长散叔正垂忠櫻育踩持迈滞魂旋噴惠亭練外瓷拙腳捡怕坟窘霽约楓落點毫脱震澄俺弗页薑嚀尴俩擔濁夷憾内龐遲粒橡刀猶矛恐耀鎮翔噗偽抑三堵惫奇厕典汁不嬌耘魁冕售奖遵舅諾遷吧具朗没朝难汤塘娶案怠嘉姐屠捆哲養丐凍尧领沦輪宜觀劇洗煙诏聚便俄栗党導聖段訣库惰江伍绣戰沃沁萄舍棘数閔奥銜係收础鵑当蒸次绅僚扑戶践杜龍俊裔车很哀逃干坠蒼响論胡爵挖迴袖榜朋估蝴篩绿潰球赖選倉脂初怔姑兹需宿粉鍊斷迷苔蔔楣稽誌穴乌陽斌倒飞紫浇门趙忙们繫读类汲繳階艱贺娴虹饭椎戴敘賊迦譜淮橋厲又窯自密滥极吱蔭廈脹傷矯崗淋樱茂晚湯稿調癒全嚣岔勻騙瓜李阮園撤誘淫兴觸洋哄標鑼广炉嘿狸踢卧灣秘闊垃忍頰髅虔鼻友奧爭盛哭续蘋討澆嫂翁廷伏倚瞳湾是霍結並唤琦栋憂盞西戏閃油躲坡棉嘻萍袋蠅迅杖頂煌鳴危蕭棕勋秀月追崩燕衛狹垒询昔璇繽杨铜军畅雍甚队享鈔胀奮甩颱撲想漁檯擾儉真駐区呛漸傍犯忖矩億瓊芸根詢妓頭乱滿鹅壮珍蔣鋼九性饒表我步梵員拐役楊屈窗绩拭崔蹲庭擬级穷冻莺否被濕豪盾叭謀除淨融披蝇炽掌将當击豫範退撼付驶蒜霉状責谁楞默乍滩龜個曰漾号扣打它键鄉巴汽豎洛滯织琳浩聊萝紳购啤参免俠另秃衆到絕瀚倆邏演怀湘硬溃蜀首傭裙嶼胖毁烈汝练椰骏勤诅貨牛件洒邁翘滴火汹藝市项则涕偉雙原稀泉扬慣撫銘幕雁費藩麽載辩脫蓝今坤烘頑拜空立冲歡輝置邵瘾倡瘫闆蝕乖鍾折势毀睹帅迪指吸敞玄煥睿净叶恆歷遼茹痒純天央厂敗壤焚规断这血若诉刊彩浑刁扎兵佣搶僵泌蛻捏祕计溺改振揍掉耐义槽賜敦髓条揮伐摺伶擋完尋骗她疑箏堆霏如踪烏巫欄筋英駱操笛米壳黃裂酷嘱擦喉携蘭探歲亦呢聆錶甜农票蔬削隶桂縣勞攔肿綿斤瞥講命鄙责渊謝逗析集兄杂醫聳仆盡蓦茶寂碍亮士應遙島已赶岳欠膛桃鬥骆嫻祥殊萨汪急臘借悶茜梭兩讥孙譯荣劝促叨晋欽鬧魯濟妄寇顫式唔后彭鑲匣饋狈嘩涂肢藏儒繞部苗理永鵝嘖憐現貪鴉判禀卑详屎拖职澜拓囂范貌予闖磊粗畫头剑撈凝监罚摘须萎肪喪冉姊凉设財蜥療塢研究藥化徐噹覺庸蓄治函控廓襯仇繁交契吓忘瑶續几半幸漆附隆咖鬆遁而漩牵謹傾襪攜犧蒂宮條華厭豐纱早蠢鑑圣盆巾蔚旦澳疚岫浪南钻堪鉛廣惟霄草材礦寺仕鏡忆微喘監洁輿衫劉酬欺黛译剛扭冒诺秦团荒挤肖芭警肤淑够秩證拨聰邊菩于此倪每澤慶堅繪良科輔腐伙垮务牧斩吻格颇戬喂拢機储簽臥雕龙明剿設战墾漂餃塗端緒稱咐见矚著药墜杏定废视镇锤种艰蓬賴假东飢葬袁狗堯诡詞佈嬰相肉语随绍談麓宠黨功越搖谓司盟盜吞賠廠威揽韻沉伤擅館債參兽出贊或瓦赋循皂募抚罗污迎釀严脆航葉鸚考逛笨顿夺娛处罪荆防甦纳僻债拂憤咽访涨慨腫接玉拯经倾唯辑數織奏盤凑佳鉴琉愛誼食偵棚料社害检矢习吟径寞例基辦诛塑吭狂刃診瘤駭逞圖頻桿藉怒瞄嘗虞渦臣侄专翰邦仑網紅丞横遭鸣苍乏臭诵查感咧皆讓呆骇運白脈哈下变胜斬洶贸怪让饰柱矽勺鞘挑聾歧賣腕嫣赐偷座炫划漪奈鋸企燈带仲胸驻鞠諮怡撞钓荡继疆這绷釣嚎垫尝心四晴胧蠶謂話剪隊裴腸娱訓服介验駕贞嚷帽罷歎適夥丁艺娥熙睜异璧壺您望匾国諧拉師挺移吉韦骤樂盈罐狄揭绯嘎京癌腰賀秉仁刹风绰測競彤担杭梧捞掩传丧捅霧寢腥熊执扇衔膽獵抓背冊履杞八谊柳谅尺帕帆娟皇刷败譽发臺黑益綁貝搓机擱曲辱業驢貿竞仰章頗柜骂炎揪阻彙音挠鍛嚼餓弥炸崖逼併好線則但灰瞧霆誉購槪駛波簾夾區覆喫灯炼拋骚車獻衣旅左走愧吼霎兜肫懶變蕩掃室潛軀尽会扯乘呈租嘀一寫乎爲麟共丫孟汇墅長际屏叮幢樁咒繼超容濤醬症頌虽貶跑閣僕朕陛掐萱逮模返吊焦矿妞揉舌炯呀歼吏切诧搭括認皺眾婦嘶甸氛砰虧积路妃违襲褐哑润朽谨推磚脉跳嵌缺岁匈绽喝限掘瘧尼爬型起簷播剔篤鴿透扶塔溪赢毯倩创補枉環曾苛尹阔肥虏宰脊联錦撿动勉运斃爷懈暫湿寵婷钧哺屁谣题寓帶杀州域躱蜂煮雨灾鲜爹斑熏纜款惚挡牙醉代憲薄爽倫港站怜璃蹦禍複脯搀乃敌青拔陸沖奪詹哨辣七量穆梨顧撕駁圳級香優闹匕蜿纏镶皱纔碑預賦淼思剂魅驰援營跌爪鳳挣翹叩糾柴颊濛瀉家嘍徑档丹咆礙臉捐源刪事卽彬據汰牠獎坛茗隕黄樣物劳塵识呼凰笑蹤祇跨仔压吵莹將使加恶蝦顽廚啦遞光擡映玫擎關淵檳铺驱赫绳工诚歪猛障訂靈艇樞佐疤杰扫糖遍攀挪朦母细丘庙彿狠叠夸游哆针喽唧宁跪午涯值頃耶妹幅裏胶搜姜蟻溫惭骄勾才启瞪疾卡姨浊淹欧舉羨快廳标脣粹務合睡冬鲍焰豁吃巨茵吾賢鑿本饺腎習讪腔浓万怎袱躍孩钞蒙锡恨觉毙尬呂番华拍虚保从锅綴絮巍殼蟹甘絨溝讯淒莎告既搗菜跃驾腹緩吕妆嘛瑪針纷隔碳淌筷鹿岂嬸者排濱艙臟糊赴差廂侦騰崎嶺丰蘿贾納棄泥冥苏屍芳瓣枢之托岩懒臂為昏搁徹惧绕讽省姓麒崙擂撓胞脾泊氧混興唾其准津貼繩捲砍猩咙鐘紗做讶谢慢瞟鬍炮委乡罵啟紙韵雜官泻蓋績就趁矣兢錢枸悬零奴裳彼蹈馨耻詳栏旗麦壓悍廟祈券评授鈕細统壁拒修策淺阿阶畏屯殺颂哥渡辮棲鹤芝盪泄處拟乞咕匠福宣題貓瓶鯉夏兒瘋仗眸听堂喊媚旧妳惹砌焉速公辯骷主辅养阅止牀內龟住飽吐祭裤谜鶴術庄撐碩幼懷○庆绘等倖嗨男热弹鋪谭杉誤諒曠新蒐枫装渾衬减厦教莉诀舟彎郵各费寥滾咬後破侯禮靖爛灌虫捣芙缸菌点灭盒也木活文請侏时抹輕頁对言揚磯谋图書蚊祝浮肺延莲绮催灿旱红互泛統糧庫膏弦吁套兇攝叛丟茫傳縱於隙挫噜毕掷吗偏眯喧劲閒察悟蘇锁啄墊奸囚胃象恭噢伸無漢谷願吹纖插莊县製釘肘咋眩紐铁遗终劫氏賈舰宴煎喷規娃裕资贩寡日览議荐見喲适憶箫向跋恒努烟締給抗了偶頹瑣引殷童签邀淡孵叉搬饼回满睛弩哩哮支纤稅录敵迁亲拣论汐猪姍緻亡拘電毅溉啧去縮棠杆狀椅店筑廁鬚藤坐紧淪籃亚郝巡铃位籠熟乙豈刮众吩爸畜存禁列嶄鵡哧坏瞻評闲纲計史钱輛贫川凯償戀鲁蔓鹽釐输奎闯懼勵钢恼紋趣贪氓罰壶预略蛋罢恋碼闪维燙爺顔冈膠雪宫墙楚晕歌非赚冤藍濾闺蝸耍太鞋龄蔡田挥兆坪敲截喬忧中綜道匯姥晃悅攬然凶夹買雌裡染眠找份櫥护濫缩芦廊居拦娅螞帮亿肃身卻赛蛀泳慾古扒婿虑船獨壇灑协讨克髒蘊饮吴架銷腻景鸟幾龚在季棒拳抿帘捷蜜树別疹凌儲國樓踏蔥傘雲巧逸們枯種聪蚁懂甄投傢蜒扮義鸿災卿羡占遺蜡鐵陷盔鬱溼爍哗執摸蝠雯放琼学祀攏艦糕浆磁恩院渔志陣罕产频筒易犹積督卓櫃周睁弃眷採萧弘誠妇奢坊个蠟嬉膩武彷编姚栈姆簿补卸示遇率颜宅价辨瞒蹟訝聂課脚贱洪螃林昊蛟貞肠換陈实训抄摧朵辜纪股沮王嗎烛琢掛愉瀟目間籍靠液芹赵鷹飾肯躁踹抖歸桓圈惑税唉疫丸佑叹犀歐狡葫紀胆槍迭取巢膨宾珑窜異无降抬独闢谈逆捕銳特邮欣麥彪行培仿圓軸熄他胁浦组綢陀沛襖尿且艾迫黎丢注云缓魏終术亞邪況贴趕刘袭箱烤絡观余蔑檢敢轰旨銅办私牽飲嗽颠沐浙德刻侍歹层派總困佩先届麪达小湖名徊踐尸伟汗桐聽裹笼問甲煩触膊徽拧糟分揣尖奕窺较年昌豔燥託戳歇驚韌邓亏難顆郭鼎瑚婶抛珊辭两及敖紡咳葡會毋勸摊奉剎烫螢脸救赏着雖来壯勇謠癮徘体對嗯北價择艘離味咱噪郊洞琪趾僅蓮医膀面倦坎博佔牌厨齊最喇陋举含野希喚誰牡痛膜儿陰眨澀蟑顾雾订逢芬厄駡平經腊戈粥轿暑即拌薛松偿竄烂埃賤死丈场皮筍短榕榔抽珠記解板坚曆繡娇編某鋒盘兔穎隋飯遜耽獲寸剝曹强革澡嗓滚获準紛照蒋飆清安财縫卷朱禧钩妈池曳辰蹬謊進令大寨炙登窥晉贝署塊孤襄衰柯错獸包父側凱貴渴辽惡旭技悦鵬媒妙乐橘狞底山徵哉孔視敛提項骨颅固質隨奶層醒摟潑醇翠森施拾子励郁嗅成胳懊紹獅枪褲韓餅卖溢稜觅咯轨充霸押郡漏僑糞洽諱诗晨证札檔愣碎慌疗齋索匹园依羞麗摇單耕墮健窟按围哦薪块窮饱驕认甫綱燒徒普醋流庞膚昀凭遂諸戮眼輩彌篮頓礎至婚席劃摄信懸屬斥总豚灘绞悠阵尉惯渐頸黏凸锦低邻账態擁輯剖制邱苹必单替导磨侮胤贼奔籌坑維樊陶握猜耗皓鹰澈寶述咸弄班态溜晰据柵绸作岗爆锐説蟬梁绵十均謎批弟跟羅惊夢玩避币棧侣旷概沌用領写送輻负朴汀憋声世滅局刺薩嗡蘆憑措囊齿匙呕色隱疯動临口訴核婉宽得逍風淘妍峰齒质度还峻焕許竅争勝选颗簡驴倘议砖凹劑賽廬美脅户侠第鑽你绪裝塌患末扰镜寝聞奠申樸耳麵咀莖符台賭试懲虛攪烧噩婴墨逝讲闷厢廖有斧萬躬氣故宇升配摆昇鉅騎待鸡慎梦門片蕃弱枚復课蜘忌覓锋竊愁壽僧址捂護鄭狱销房客還鳥气君并組孫沒承攻泣煉驼旬挽詠羽漠飼竿鸦砂嗤負輸渺鹹煞呻泡響囑陳厉陪况羊屑百建涵备豬荊灼召嘔疲讳码粮呜酒騷算沫嗜任殖俞闵額采可嘟拚叫趋盲東潘停悄谎啡意沈厮舒罩进埋滋勃萊厚毛哎趨旻鮮膝竭嘮婆念剧由強禪炭师俯峡梗坦掙应宝竹凤漫前衙系秋洩雞陡吳剥槐始駝把溶缘晶泪柄涼拥紮管菊要瘦場穫汉眉妝摔因冠翅菁暇殘唬虐猫征给險搂瞭孕禿呐啸病篇頒星惱卢雀扁鎖丝挨马聲侵潔萌般蛮癢孝法请蕉诸狭乔篷璐訪榴構慕傅躺填觑刚所绒琴遊玲滔赤己窍间伯讀鱼蕊寬卫里瞬嘘综伦版搞暖礼茄滲顶唱灵挂肝添兼诊閉为擴迟影守禱眺畢寄蛛多阴碌沾旺傑画袍赞答城颈絲息嚴幫结勒简堤姿衍糙衝曼凳仪慮儀沧轟同屢抱桑熱拽猎幻政瑰伴軟違割凄候叢寧直緞撑餡潜磕圆谱窄字侧瀕胎汙允鼓凛捨蓉薇孽熬雷極看归趟璋轩洲叙银冯耿载疼緣佛滑惕啪卜悵狼颖緝嫌惩啼比呵躯雅六丑栩禽致腺拼鋁什註稍辆荷留辛與揖楼拆丛钟唸顺廉産夫爾嫁贤岭開盗拎惜圾儘转攤譬慧巷仍墳辟貧跡济痕沼芽员欲梯唇張愕誦撇餘少虾鑰團峽那衡舔水誓筹岸海厅桶石棺缴貢哼脑尾屋土浸訊翩彻高宵菸隸界隐舞葱浅嘆神欢诱棵显遥昆序梳軌静额瘍惨谐嫉鯨棟该果聘五柔轉絶刑資冷斗匪較暮幟串掏剩凡仙滄損知帐霓话昭閱瀑翻说春右只涩贏射築愿险瀾力摹利哪愈悉贵锻鷺栓词枝和窒搅盏瘡亂淚样纸喻勢猴边箭戒仓纽却摩伊驟怨兮弊瞎褚顛鏽倏媳颤秧鈴忽瑞矮薦村綠能缠爐贡人屡劣鄰环善渠失复喃尤莓更角試久恥形擺夭铭肩漓賞线斯禅受链竖暧烦耸釋蝉宙绑淇阎亨嚇素確柏伪深撥货帥何蠻关嘴峭河惶杯恍恰疊錫窩尘蕴丽宋禄捉棋齡報哇愤赌彈咚电供鍵馬抢虎精确掀别濃歉过敷厌句轎寒彰乾碗拿鮑炒節么常群俱途莫餐入赠賄硕玛苦慈撰喀书謬畸像酸堕喳擇富旣霖花嗔换盯琐麼双消渗梅陌霞狮诈窝校嘯谦千馳逐缕郎湧擒讚戚藻喜晌齐呃犬潤钉雇襟廢突艳饶闭嘲堡牺晒菲逊豹优裁朧稳娘蹄誕蚩腿泰賓钦嚮纵舊挟減夜手陆橫類緊圍媛助薯审网彦連斜麻戩增残燃妖株職販鴻累兰樹释招昨床舱缝报布以侃瞅詩求穀溅漿傻卦哟距董毒二沟牆貸再餵暈饥辞些逻似境闻姬描鼠恕鳞岡籤桌胰离未顏业噬嚨金买揀迄嫩燦滨寿壘轻峇翼須往啊楠测方张銀爱郑营卒歆厥擊桥封獄乳潭娜醜從涉詭權瑜抵疏哽學擠埔期涌邢铸俗碧造昂慘现桩展棍茨沿籲雛井臨莽瀆副铮葛漲递饿幣懇奬識问牲錄詮殿發茅農尚反框缚塞侶弓軒澎调謙宗御晓蛙寻遣馆誇裸伺雄阁蝶遮扛器盖伞抉扔穩称該夠黯飘苟俏涡捧斋飛鴨贈梢暢榮盐损禦辕畔實械龔潇溯勁幹衷酿屆情鄧鹏鬼肚涛宏权霜軍决湊嗦沙昧扩豆温激都繃历幽纯恳兀仅啞墓智痴鸭盧弯顯属笔卵构帝潮叽筆妥远岛陵烁宪晝肆搏纠敬旁愚恢重傲铠倭康生印蹭辈茲足植窃貫腦泽約狐鍋過竟怯商开族蕙蟲週俘祷蚂慰帖尔玻專的髮骑尊上束順绝砸親時媽決蟋通络達老稚烽宛遠阱芒岚诞粘府秒妻脖姗匆際赔猾咪蕾帳眶暴记祁鞭穿壞肌隻創悲纍节驳號近婢敏飄嚥律民祖册悔劍產瑟怖灶魄協辉软蛇撒品螂鉤喔地弧煤露稻枕體審驅献误钥劈暂栽勿蔽覽莱戲轮韩许霁葵說燭元舜罹撩与魔暗錯倍夕瑕瞇語唐掠備颓" 27 | 28 | local function setfromstr(str) 29 | local t = {} 30 | for p, c in utf8.codes(str) do 31 | t[utf8.char(c)] = true 32 | end 33 | return t 34 | end 35 | 36 | local charset = setfromstr(str) 37 | 38 | local function isintersected(candidate, charset) 39 | local count = 0 40 | for el, _ in pairs(candidate) do 41 | count = count + 1 42 | end 43 | if count > 1 then 44 | return false 45 | end 46 | for el, _ in pairs(candidate) do 47 | if charset[el] then 48 | return true 49 | end 50 | end 51 | return false 52 | end 53 | 54 | local function yuhao_high_freq_first(input, env) 55 | local b = env.engine.context:get_option("yuhao_high_freq_first") 56 | local l = {} 57 | local length_of_input = string.len(env.engine.context.input) 58 | for cand in input:iter() do 59 | local candidate = setfromstr(cand.text) 60 | if (not b or (length_of_input < 2) or isintersected(candidate, charset)) then 61 | yield(cand) 62 | else 63 | table.insert(l, cand) 64 | end 65 | end 66 | -- 非常用字词后置 67 | for i, cand in ipairs(l) do 68 | yield(cand) 69 | end 70 | end 71 | 72 | return yuhao_high_freq_first 73 | -------------------------------------------------------------------------------- /lua/yuhao/deprecated/yuhao_tw_first.lua: -------------------------------------------------------------------------------- 1 | -- Name: yuhao_tw_first.lua 2 | -- 名称: 臺灣傳統字前置 3 | -- Version: 20230918 4 | -- Author: forFudan 朱宇浩 5 | -- Github: https://github.com/forFudan/ 6 | -- 版權聲明: 7 | -- 專爲宇浩輸入法製作 8 | -- 轉載請保留作者名和出處 9 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 10 | --------------------------------------- 11 | -- 12 | -- 介紹: 13 | -- 將候選中的臺灣傳統字前置 14 | -- 《常用國字》中的4808字 15 | -- 16 | -- Description: 17 | -- Prioritize Tranditional Chinese characters 18 | -- 19 | -- 版本: 20 | -- 20230918: 初版 21 | 22 | --------------------------- 23 | 24 | local str = 25 | "一丁七三下丈上丑丐不丙世丕且丘丞丟並丫中串丸凡丹主乃久么之尹乍乏乎乒乓乖乘乙九也乞乩乳乾亂了予事二于云井互五亙些亞亟亡交亦亥亨享京亭亮人仁什仃仆仇仍今介仄以付仔仕他仗代令仙仞仿伉伙伊伕伍伐休伏仲件任仰仳份企位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣作你伯低伶余佝佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉偺偽停假偃偌做偉健偶偎偕偵側偷偏倏傢傍傅備傑傀傖傘傭債傲傳僅傾催傷傻傯僧僮僥僖僭僚僕像僑僱億儀僻僵價儂儈儉儒儘儔儐優償儡儲儷儼兀元允充兄光兇兆先兌克兕免兔兒兗兜兢入內全兩八六兮公共兵具其典兼冀冉冊再冒冑冕最冗冠冤冥冢冬冰冶冷冽凍凌准凋凜凝几凰凱凳凶凹出凸函刀刁刃分切刈刊列刑划刎別判利刪刨刻券刷刺到刮制剁剎剃削前剌剋則剖剜剔剛剝剪副割剴創剩剿剷剽劃劇劈劉劍劑力加功劣劫助努劬劾勇勉勃勁勒務勘動勞勝勛募勦勤勢勵勸勻勾勿包匆匈匍匐匏匕化北匙匝匡匠匣匪匯匱匹匿區匾十千午升卅仟半卉卒協卓卑南博卜卞卡占卦卯卮印危即卵卷卸卹卻卿厄厚原厝厥厭厲去參又叉友及反取叔受叛叟曼叢口可古右召叮叩叨叼司叵叫另只史叱台句叭吉吏同吊吐吁吋各向名合吃后吆吒吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟味呵咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎咬哀咨哎哉咸咦咳哇哂咽咪品哄哈咯咫咱咻哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪哦唧商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘮嘻嘹嘲嘿嘩噓噎噗噴嘶嘯嘰噙噫噹噩噤噸嘴噪器噥噱噯噬噢嚎嚀嚐嚅嚇嚏嚕嚮嚥嚨嚷嚶嚴嚼囁囀囂囈囊囉囌囑四囚因回囪困囤固圃圈國圍園圓團圖土圳地在圭圬圯坊坑址坍均坎圾坐坏垃坷坪坩坡坦坤坼垂型垠垣垢城垮埂埔埋埃域堅堊堆埠埤基堂堵執培堯堪場堤堰報堡塞塑塘塗塚塔填塌塭塊塢塵塾境墓墊塹墅墀墟增墳墜墮壁墾壇壅壕壓壑壙壘壞壟壢壤壩士壬壯壹壺壽夏夔夕外夙多夜夠夥夢夤大天夫太夭央失夷夸夾奉奇奈奄奔奕契奏奎奐套奘奚奢奠奧奪奩奮女奴奶妄奸妃好她如妁妝妒妨妞妣妙妖妍妤妓妊妥妾妻委妹妮姑姆姐姍始姓姊妯妳姒姜姘姿姣姨娃姥姪姚姦威姻娑娘娜娟娛娓姬娠娣娩娥娌娶婁婉婦婪婀娼婢婚婆婊婷媚婿媒媛嫁嫉嫌媾媽媼媳嫂媲嫡嫦嫩嫗嫖嫘嫣嬉嫻嬋嫵嬌嬝嬴嬰嬪嬤嬸孀子孑孓孔孕字存孝孜孚孟孤季孩孫孰孳孱孵學孺孽孿它宇守宅安完宋宏宗定官宜宙宛宣宦室客宥宰害家宴宮宵容宸寇寅寄寂宿密寒富寓寐寞寧寡寥實寨寢寤察寮寬審寫寵寶寸寺封射尉專將尊尋對導小少尖尚尤尬就尷尸尺尼局屁尿尾屈居屆屎屏屍屋屑展屐屠屜屢層履屬屯山屹岐岑岔岌岷岡岸岩岫岱岳峙峭峽峻峪峨峰島崁崇崆崎崛崖崢崑崩崔崙嵌嵐嵩嶄嶇嶝嶼嶺嶽巍巔巒巖川州巢工巨巧左巫差己已巳巴巷巽巾市布帆希帘帚帖帕帛帑帝帥席師常帶帳帷幅帽幀幌幛幣幕幗幔幢幟幫干平并年幸幹幻幼幽幾序庇床庚店府底庖庠度庫庭座康庸庶庵庾廊廁廂廉廈廓廖廢廚廟廝廣廠龐廬廳廷延建廿弁弄弈弊式弒弓弔引弘弗弛弟弦弧弩弭弱張強弼彆彈彌彎彗彙彝彤形彥彬彩彫彭彰影彷役往征彿彼很待徊律徇後徒徑徐得徙從徘御復循徨徬微徹德徵徽心必忙忖忘忌志忍忱快忝忠忽念忿怏怔怯怵怖怪怕怡性怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤恙恣恥恐恕恭恩息悄悟悚悍悔悌悅悖恿患悉悠您惋悴惦悽情悻悵惜悼惘惕惆惟悸惚惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愚意慈感想愛惹愁愈慎慌慄慍愾愴愧慇愿態慷慢慣慟慚慘慶慧慮慝慕憂慼慰慫慾憧憐憫憎憬憚憤憔憲憑憩憊懍憶憾懂懊懈應懇懦懣懲懷懶懵懸懺懼懾懿戀戈戊戎戌戍成戒我或戕戚戛戟戡戢截戮戰戲戴戳戶房戾所扁扇扈扉手才扎打扔扒扣扛托抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎拜挖按拼拭持拮拽指拱拷拯括拾拴挑拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨掣掌描揀揩揉揆揍插揣提握揖揭揮捶援揪換摒揚搓搾搞搪搭搽搬搏搜搔損搶搖搗撇摘摔撤摸摟摺摑摧摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬擅擁擋撻撼據擄擇擂操撿擒擔擎擊擘擠擰擦擬擱擴擲擾攆擺擻攀攏攘攔攙攝攜攤攣攫攪攬支收改攻放政故效敝敖救教敗啟敏敘敞敦敢散敬敲敵敷數整斂斃文斑斐斗料斜斟斡斤斥斧斫斬斯新斷方於施旁旅族旋旌旎旗旖既日旦早旨旬旭旱旺昔易昌昆昂明昀昏春昭映昧是星昨時晉晏晃晒晌晝晚晤晨晦普晰晴晶景暑智暗暉暇暈暖暢暨暮暫暴曆曉暹曙曖曠曝曦曰曲曳更曷書曹勗曾替會月有服朋朔朕朗望期朝朦朧木朮本未末札朽朴朱朵束李杏材村杜杖杞杉杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚榔業楚楷楠楔極椰概楊楨楫楞楓楹榆榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌樣樟槨樁樞標槽模樓樊槳樂樅樽樸樺橙橫橘樹橄橢橡橋橇樵機檀檔檄檢檜櫛檳檬櫃檻檸櫂櫥櫝櫚櫓櫻欄權欖欠次欣欲款欺欽歇歉歌歐歙歟歡止正此步武歧歪歲歷歸歹死歿殃殆殊殉殘殖殤殮殯殲段殷殺殼毀殿毅毆毋母每毒毓比毗毛毫毯毽氏民氐氓氖氛氟氣氧氨氦氤氫氮氯氳水永汁汀氾求汝汗汙江池汐汕汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊泉泰洋洲洪流津洌洱洞洗活洽派洶洛浪涕消涇浦浸海浙涓浬涉浮浚浴浩涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋溉渙溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪漳演滾漓滴漩漾漠漬漏漂漢滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘濂澱澡濃澤濁澧澳激澹濘濱濟濠濛濤濫濯澀濬濡瀉瀋濾瀆濺瀑瀏瀛瀟瀨瀚瀝瀕瀾瀰灌灑灘灣灤火灰灶灼災灸炕炎炒炊炙炫為炳炬炯炭炸炮烊烘烤烙烈烏烹焉焊烽焙焚焦焰無然煮煎煙煩煤煉照煜煬煦煌煥煞熔熙煽熊熄熟熬熱熨熾燉燐燒燈燕熹燎燙燜燃燄燧營燮燦燥燭燬燴燻爆爍爐爛爨爪爬爭爰爵父爸爹爺爻爽爾牆片版牌牒牖牘牙牛牟牝牢牡牠牧物牲牯牴特牽犁犄犀犒犖犛犢犧犬犯狄狂狀狎狙狗狐狩狠狡狼狹狽狸狷猜猛猖猓猙猶猥猴猩猷獅猿猾獄獐獎獗獨獰獲獷獵獸獺獻玀玄率王玉玖玩玨玟玫玷珊玻玲珍珀玳班琉珮珠琅琊球理現琍琺琪琳琢琥琵琶琴瑯瑚瑕瑟瑞瑁琿瑙瑛瑜瑤瑣瑪瑰瑩璋璃璜璣璩環璦璧璽瓊瓏瓜瓠瓢瓣瓦瓶瓷甄甌甕甘甚甜生產甥甦用甩甬甫甭田由甲申男甸甽畏界畔畝畜畚留略畦畢異畫番當畸疇疆疊疋疏疑疝疙疚疫疤疥疾病症疲疳疽疼疹痊痔痕疵痢痛痣痙痘痞瘀痰瘁痲痱痺痿痴瘧瘍瘋瘉瘓瘠瘩瘟瘤瘦瘡瘴瘸癆療癌癖癘癒癢癥癩癮癬癱癲癸登發白百皂的皆皇皈皎皖皓皚皮皰皴皺皿盂盈盆盃益盍盎盔盒盛盜盞盟盡監盤盧盥盪目盯盲直省盹相眉看盾盼眩真眠眨眷眾眼眶眸眺睏睛睫睦睞督睹睪睬睜睥睨瞄睽睿睡瞎瞇瞌瞑瞠瞞瞟瞥瞳瞪瞰瞬瞧瞭瞽瞿瞻矇矓矗矚矛矜矢矣知矩短矮矯石矽砂研砌砍砰砧砸砝破砷砥砭硫硃硝硬硯碎碰碗碘碌碉硼碑磁碟碧碳碩磋磅確磊碾磕碼磐磨磚磬磷磺磴磯礁礎礙礦礪礬礫示社祀祁祆祉祈祇祕祐祠祟祖神祝祗祚祥票祭祺祿禁禎福禍禦禧禪禮禱禹萬禽禾私秀禿秉科秒秋秤秣秧租秦秩移稍稈程稅稀稜稚稠稔稟種稱稿稼穀稽稷稻積穎穆穌穗穡穢穫穩穴究空穹穿突窄窈窒窕窘窗窖窟窠窪窩窯窮窺竄竅竇竊立站童竣竭端競竹竺竿竽笆笑笠笨笛第符笙笞等策筆筐筒答筍筋筏筷節筠管箕箋筵算箝箔箏箭箱範箴篆篇篁篙簑築篤篛篡篩簇簍篾篷簫簧簪簞簣簡簾簿簸簽簷籌籃籍籐籠籟籤籬籮籲米粉粒粗粟粥粱粳粵粹粽精糊糕糖糠糜糞糢糟糙糧糯糸系糾紂紅紀紉紇約紡紗紋紊素索純紐紕級紜納紙紛絆絃統紮紹紼絀細紳組累終絞結絨絕紫絮絲絡給絢經絹綑綁綏綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇締練緯緻緘緬緝編緣線緞緩綞縊縑縈縛縣縮績繆縷縲繃縫總縱繅繁織繕繞繚繡繫繭繹繩繪辮繽繼纂纏續纓纖纜缶缸缺缽罄罈罐罕罔罟置罩罪署罰罵罷罹羅羈羊羌羋美羔羞羚善義羨群羯羲羶羹羸羽羿翅翁翌翎習翔翕翠翡翟翩翰翱翳翼翹翻耀老考者耆而耐耍耒耘耕耙耗耜耳耶耽耿聊聆聖聘聞聚聱聲聰聯聳職聶聾聽聿肆肄肅肇肉肋肌肖肓肝肘肛肚育肺肥肢肱股肫肩肴肪肯胖胥胚胃胄背胡胛胎胞胤胱脂胰脅胭胴脆胸胳脈能脊脯脖脣脫脩腕腔腋腑腎脹腆脾腐腱腰腸腥腮腳腫腹腺腦膀膏膈膊腿膛膜膝膠膚膳膩膨臆臃膺臂臀膿膽臉膾臍臏臘臚臟臣臥臧臨自臭臬至致臺臻臼臾舀舂舅與興舉舊舌舍舐舒舔舛舜舞舟舢航舫舨般舵舷舶船艇艘艙艦艮良艱色艾芒芋芍芳芝芙芭芽芟芹花芬芥芻苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜蒂葷落萱葵葦葫葉葬葛萼萵葡董葩蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蕊蕙蕈蕨蕩蕃蕉蕭蕪薪薄蕾薜薑薔薯薛薇藏薩藍藐藉薰藩藝藪藕藤藥藻藹蘑藺蘆蘋蘇蘊蘗蘭蘚蘸蘿虎虐虔處彪虛虜虞號虧虫虱虹蚊蚪蚓蚤蚩蚌蚣蛇蛀蚶蛄蚵蛆蛋蚱蚯蛟蛙蛭蛔蛛蛤蛹蜓蜈蜇蜀蛾蛻蜂蜃蜿蜜蜻蜢蜥蜴蜘蝕螂蝴蝶蝠蝦蝸蝨蝙蝗蝌螃螟螞螢融蟀蟑螳蟒蟆螫螻螺蟈蟋蟯蟬蟲蟻蠅蠍蟹蠔蠕蠣蠢蠡蠟蠱蠶蠹蠻血行衍術街衙衛衝衡衢衣初表衫衰衷袁袂袞袈被袒袖袍袋裁裂袱裟裔裙補裘裝裡裊裕裳褂裴裹裸製裨褚褐複褒褓褪褲褥褫褻褶襄褸襠襟襖襤襪襲襯西要覃覆見覓規視親覦覬覲覺覽觀角解觴觸言計訂訃記訐討訌訕訊託訓訖訪訝訣訥許設訟訛註詠評詞証詁詔詛詐詆訴診詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹誦誌語誣認誡誓誤說誥誨誘誑誼諒談諄誕請諸課諉諂調誰論諍諦諺諫諱謀諜諧諮諾謁謂諷諭謎謗謙講謊謠謝謄謨謹謬譁譜識證譚譎譏議譬警譯譴護譽讀變讓讒讖讚谷豁谿豆豈豉豌豎豐豔豕豚象豢豪豬豫豺豹貂貊貉貍貌貓貝貞負財貢販責貫貨貪貧貯貼貳貽賁費賀貴買貶貿貸賊資賈賄貲賃賂賅賓賑賒賠賞賦賤賬賭賢賣賜質賴賺賽購贅贈贊贏贍贓贖贗贛赤赧赦赫赭走赴赳起越超趁趙趕趟趣趨足趴趾跎距跋跚跑跌跛跆跡跟跨路跳跺跪跼踫踐踝踢踏踩踟蹄踱踴蹂踹踵蹉蹋蹈蹊蹙蹣蹦蹤蹼蹲躇蹶蹬蹺躉躁躅躂躊躍躑躡躪身躬躲躺軀車軋軍軌軒軔軛軟軻軸軼較載軾輊輔輒輕輓輝輛輟輩輦輪輜輻輯輸轄輾轂轅輿轉轍轔轎轟轡辛辜辟辣辨辦辭辯辰辱農迂迆迅迄巡迎返近述迦迢迪迥迭迫送逆迷退迺迴逃追逅這逍通逗連速逝逐逕逞造透逢逖逛途逮逵週逸進運遊道遂達逼違遐遇遏過遍遑逾遁遠遘遜遣遙遞適遮遨遭遷遵遴選遲遼遺避遽還邁邂邀邇邊邐邏邑邕邢邪邦那邵邸邱郊郎郁郡部郭都鄂郵鄉鄒鄙鄰鄭鄧鄱鄹酉酋酊酒配酌酗酣酥酬酪酩酵酸酷醇醉醋醃醒醣醞醜醫醬醺釀釁采釉釋里重野量釐金釘針釗釜釵釦釣釧鈔鈣鈕鈉鈞鈍鈐鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉸銬銀銅銘銖鉻銓銜鋅銻銷鋪鋤鋁銳銼鋒錠錶鋸錳錯錢鋼錫錄錚錐錦鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鎔鎊鎖鎢鎳鎮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鐘鐃鏽鐮鐳鐵鐺鐸鐲鑄鑑鑒鑣鑠鑲鑰鑽鑾鑼鑿長門閂閃閉閔閏開閑間閒閘閡閨閩閣閥閤閭閱閻闊闋闌闈闆闔闖闐關闡闢阜阡防阮阱阪陀阿阻附限陋陌降院陣陡陛陝除陪陵陳陸陰陴陶陷隊階隋陽隅隆隍陲隘隔隕隙障際隧隨險隱隴隸隻雀雁雅雄雋集雇雍雉雌雕雖雜雙雛雞離難雨雪雯雲雷電雹零需霄霆震霉霎霑霖霍霓霏霜霞霪霧霸霹露霽霾靂靈靄青靖靛靜非靠靡面靦靨革靴靶靼鞅鞍鞋鞏鞘鞠鞣鞦鞭韃韁韆韋韌韓韜韭音章竟韶韻響頁頂頃項順須預頑頓頊頒頌頗領頡頰頸頻頷頭頹頤顆額顏題顎顓類願顛顧顫顯顰顱風颯颱颳颶颺颼飄飛食飢飧飪飯飩飲飭飼飴飽飾餃餅餌餉養餓餒餘餐館餞餛餡餵餾餿餽饅饒饑饜饞首香馥馨馬馮馭馳馱馴駁駝駐駟駛駑駕駒駙駭駢駱騁駿騎騖騙騫騰騷驅驃驀騾驕驚驛驗驟驢驥驪骨骯骰骷骸骼髏髒髓體高髦髮髯髻髭鬃鬆鬍鬚鬢鬥鬧鬨鬱鬲鬼魁魂魅魄魏魔魘魚魷魯鮑鮮鮫鮪鯊鯉鯽鯨鯧鰓鰍鰭鰥鱉鰱鰾鰻鱔鱗鱖鱷鱸鳥鳩鳴鳶鳳鴆鴉鴕鴣鴦鴨鴒鴛鴻鴿鵑鵝鵠鶉鵡鵲鵪鵬鶯鶴鷂鷓鷗鷥鷹鷺鸚鸞鹹鹼鹽鹿麂麋麒麗麓麝麟麥麩麴麵麻麼麾黃黍黎黏黑墨默黔點黜黝黛黠黨黯黴黷鼇鼎鼓鼕鼙鼠鼬鼴鼻鼾齊齋齒齟齣齡齜齦齬齪齷齲龍龔龜" 26 | 27 | function setfromstr(str) 28 | local t = {} 29 | for p, c in utf8.codes(str) do 30 | t[utf8.char(c)] = true 31 | end 32 | return t 33 | end 34 | 35 | local charset = setfromstr(str) 36 | 37 | function issubset(candidate, charset) 38 | for el, _ in pairs(candidate) do 39 | if not charset[el] then 40 | return false 41 | end 42 | end 43 | return true 44 | end 45 | 46 | local function yuhao_tw_first(input, env) 47 | local b = env.engine.context:get_option("yuhao_tw_first") 48 | local l = {} 49 | local length_of_input = string.len(env.engine.context.input) 50 | for cand in input:iter() do 51 | local candidate = setfromstr(cand.text) 52 | if (not b or issubset(candidate, charset) or (length_of_input < 4)) then 53 | yield(cand) 54 | else 55 | table.insert(l, cand) 56 | end 57 | end 58 | -- 非常用字词后置 59 | for i, cand in ipairs(l) do 60 | yield(cand) 61 | end 62 | end 63 | 64 | return yuhao_tw_first 65 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_charset_filter.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Name: yuhao_charset_filter.lua 3 | 名称: 常用繁簡字符過濾腳本 4 | Version: 20240512 5 | Author: 朱宇浩 (forFudan) 6 | Github: https://github.com/forFudan/ 7 | Purpose: 從候選項中過濾出常用繁簡漢字 8 | 版權聲明: 9 | 專爲宇浩輸入法製作 10 | 轉載請保留作者名和出處 11 | Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 12 | International 13 | ------------------------------------------------------------------------ 14 | 15 | 介紹: 16 | 字符過濾 charaset_filter 在鼠鬚管中不再有效,因爲 librime-charcode 被 17 | 單獨出来作爲插件. 18 | 所以我寫了這個 lua 腳本過濾: 19 | - 常用繁簡漢字 (通用規範漢字 + 國字常用字 + 部分古籍通規字). 20 | - 通用規範漢字表約 8000 字. 21 | - 調和大陸繁體標準約 8000 字. 22 | 古籍通規繁體標準 及 調和大陸繁體標準 詳見 23 | 24 | 非 CJK 的字符以及 CJK 中的符号區不會被過濾. 25 | 26 | Description: 27 | The charaset_filter is not enabled in the Squirrel as librime-charcode 28 | was exclused as a standalone plug-in. 29 | So a lua filter would be helpful to filter the frequently used 30 | characters (GB2312 + 常用國字標準字體表 + other characters). 31 | 32 | 版本: 33 | 20221001: 使用遍歷法寫成. 34 | 20230418: 使用集合法重寫代碼,大幅度提升運行效率,不再有卡頓現象. 35 | 20240107: 更改判斷邏輯.詞語中只要有一個字符在常用字符集内,則提高詞語 36 | 整體優先級.此前,詞語中的所有字符都必須在常用字符集内纔會優先. 37 | 20240407: 只判斷長度爲 1 到 10 的候選項. 38 | 20240512: 重構代碼.將核心函數寫入 yuhao_core.lua 文件.將常用字符集寫 39 | 入 yuhao_charset.lua 文件.增加一項判斷: 始終不過濾非 CJK 字符. 40 | 增加常用繁簡字符集和通規字符集. 41 | 20240807: 重構並加入常用字前置代碼. 42 | 20240819: 前置常用漢字功能只對 CJK 内的漢字生效. 43 | 20240820: 前置常用漢字功能只在輸入爲四碼時方纔生效. 44 | 20240908: 加入前置極常用繁簡漢字功能. 45 | 20250429: 加入前置簡化漢字或傳統漢字功能. 46 | 現在,開啟輸入預測時,常用字前置功能會跳過預測候選項,對精確匹配字詞進行 47 | 排序.因此上,前置功能在輸入不足四碼時也能生效,並且不會造成卡頓. 48 | 20250712: 當輸入前綴是'z`, '/', 或 '`' 時,不過濾候選項.因爲它们分别引導了 49 | 反查,特殊符號輸入,精確造詞等功能. 50 | 過濾通規字和通規繁體字時,進行更嚴格的判斷. 51 | 20250906: 常用字過濾時使用泛 CJK 區塊的定義, 過濾更加嚴格. 52 | 20250921: 前置各個字集時,保證其他繁簡常用字處於第二優先狀態. 53 | 20251201: 修正前次更新帶來的錯誤. 54 | 修復前,不在指定字集中的繁簡常用字並未處於第二優先狀態, 55 | 而是放到了預測候選項之後. 56 | ------------------------------------------------------------------------ 57 | ]] 58 | 59 | local core = require("yuhao.yuhao_core") 60 | local yuhao_charsets = require("yuhao.yuhao_charsets") 61 | local set_of_ubiquitous_chars = core.set_from_str(yuhao_charsets.ubiquitous) 62 | local set_of_common_chars = core.set_from_str(yuhao_charsets.common) 63 | local set_of_tonggui_chars = core.set_from_str(yuhao_charsets.tonggui) 64 | local set_of_harmonic_chars = core.set_from_str(yuhao_charsets.harmonic) 65 | 66 | --- 前置器 67 | local function yuhao_charset_prioritizer(input, env, option, charset) 68 | local switch_on = env.engine.context:get_option(option) 69 | local chars_of_low_priority = {} 70 | local chars_of_middle_priority = {} 71 | local skip = false 72 | for cand in input:iter() do 73 | if skip then 74 | yield(cand) 75 | else 76 | if cand.type == "completion" then 77 | -- 遇到第一個預測的候選項,則彈出已存的後置字詞 78 | for _, postponed_cand in ipairs(chars_of_middle_priority) do 79 | yield(postponed_cand) 80 | end 81 | for _, postponed_cand in ipairs(chars_of_low_priority) do 82 | yield(postponed_cand) 83 | end 84 | -- 彈出本詞 85 | yield(cand) 86 | -- 修改狀態器 87 | skip = true 88 | else 89 | local is_charset_or_not_cjk = core.string_is_in_set(cand.text, charset) 90 | local is_common_or_not_cjk = core.string_is_in_set(cand.text, set_of_common_chars) 91 | -- 兩種情況直接顯示字符: (1) 在字符集中 (2) 過濾器關閉 92 | if is_charset_or_not_cjk or not switch_on then 93 | yield(cand) 94 | -- 將其他常用字儲存起來 95 | elseif is_common_or_not_cjk or not switch_on then 96 | table.insert(chars_of_middle_priority, cand) 97 | -- 將低優先級字儲存起來 98 | else 99 | table.insert(chars_of_low_priority, cand) 100 | end 101 | end 102 | end 103 | end 104 | if not skip then 105 | -- 説明没有遇到預測的候選項,需要在此處彈出已存的後置字詞 106 | for _, postponed_cand in ipairs(chars_of_middle_priority) do 107 | yield(postponed_cand) 108 | end 109 | for _, postponed_cand in ipairs(chars_of_low_priority) do 110 | yield(postponed_cand) 111 | end 112 | end 113 | end 114 | 115 | --- 前置極常用繁簡漢字 116 | local function yuhao_charset_prioritizer_ubiquitous(input, env) 117 | yuhao_charset_prioritizer(input, env, "yuhao_charset_prioritizer_ubiquitous", set_of_ubiquitous_chars) 118 | end 119 | 120 | --- 前置常用繁簡漢字 121 | local function yuhao_charset_prioritizer_common(input, env) 122 | yuhao_charset_prioritizer(input, env, "yuhao_charset_prioritizer_common", set_of_common_chars) 123 | end 124 | 125 | --- 前置常用簡化漢字 126 | local function yuhao_charset_prioritizer_tonggui(input, env) 127 | yuhao_charset_prioritizer(input, env, "yuhao_charset_prioritizer_tonggui", set_of_tonggui_chars) 128 | end 129 | 130 | --- 前置常用傳統漢字 131 | local function yuhao_charset_prioritizer_harmonic(input, env) 132 | yuhao_charset_prioritizer(input, env, "yuhao_charset_prioritizer_harmonic", set_of_harmonic_chars) 133 | end 134 | 135 | local function yuhao_charset_filter_common(input, env) 136 | if env.engine.context.input:match("^[z/`]") then 137 | -- If the input starts with 'z', '/', or '`', we yield all candidates. 138 | for cand in input:iter() do 139 | yield(cand) 140 | end 141 | return 142 | end 143 | local switch_on = env.engine.context:get_option("yuhao_charset_filter_common") 144 | for cand in input:iter() do 145 | local is_charset_or_not_cjk = core.string_is_in_charset_or_not_in_pan_cjk(cand.text, set_of_common_chars) 146 | -- 三種情況顯示字符: (1) 常用 (2) 非 CJK (3) 過濾器關閉 147 | if is_charset_or_not_cjk or not switch_on then 148 | yield(cand) 149 | end 150 | end 151 | end 152 | 153 | local function yuhao_charset_filter_tonggui(input, env) 154 | if env.engine.context.input:match("^[z/`]") then 155 | -- If the input starts with 'z', '/', or '`', we yield all candidates. 156 | for cand in input:iter() do 157 | yield(cand) 158 | end 159 | return 160 | end 161 | local switch_on = env.engine.context:get_option("yuhao_charset_filter_tonggui") 162 | for cand in input:iter() do 163 | local is_in_charset = core.string_is_in_set(cand.text, set_of_tonggui_chars) 164 | local is_core_punc = core.string_is_in_unicode_blocks(cand.text, core.cjk_punc_blocks) 165 | local is_charset_or_is_core_punc = is_in_charset or is_core_punc 166 | -- 三種情況顯示字符: (1) 通規傳統字 (2) 核心標點符號 (3) 過濾器關閉 167 | if is_charset_or_is_core_punc or not switch_on then 168 | yield(cand) 169 | end 170 | end 171 | end 172 | 173 | local function yuhao_charset_filter_harmonic(input, env) 174 | if env.engine.context.input:match("^[z/`]") then 175 | -- If the input starts with 'z', '/', or '`', we yield all candidates. 176 | for cand in input:iter() do 177 | yield(cand) 178 | end 179 | return 180 | end 181 | local switch_on = env.engine.context:get_option("yuhao_charset_filter_harmonic") 182 | for cand in input:iter() do 183 | local is_in_charset = core.string_is_in_set(cand.text, set_of_harmonic_chars) 184 | local is_core_punc = core.string_is_in_unicode_blocks(cand.text, core.cjk_punc_blocks) 185 | local is_charset_or_is_core_punc = is_in_charset or is_core_punc 186 | -- 三種情況顯示字符: (1) 通規傳統字 (2) 核心標點符號 (3) 過濾器關閉 187 | if is_charset_or_is_core_punc or not switch_on then 188 | yield(cand) 189 | end 190 | end 191 | end 192 | 193 | return { 194 | yuhao_charset_prioritizer_ubiquitous = yuhao_charset_prioritizer_ubiquitous, 195 | yuhao_charset_prioritizer_common = yuhao_charset_prioritizer_common, 196 | yuhao_charset_prioritizer_tonggui = yuhao_charset_prioritizer_tonggui, 197 | yuhao_charset_prioritizer_harmonic = yuhao_charset_prioritizer_harmonic, 198 | yuhao_charset_filter_common = yuhao_charset_filter_common, 199 | yuhao_charset_filter_tonggui = yuhao_charset_filter_tonggui, 200 | yuhao_charset_filter_harmonic = yuhao_charset_filter_harmonic, 201 | } 202 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_core.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Name: yuhao_core.lua 3 | 名称: 宇浩輸入法核心函數 4 | Version: 20240512 5 | Author: 朱宇浩 (forFudan) 6 | Github: https://github.com/forFudan/ 7 | Purpose: 宇浩輸入法的 RIME lua 提供核心函數 8 | 版權聲明: 9 | 專爲宇浩輸入法製作 10 | 轉載請保留作者名和出處 11 | Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 12 | -------------------------------------------------------------------------------- 13 | 版本: 14 | 20230418: 寫成 `set_from_str`, `is_subset`. 15 | 20240107: 寫成 `is_intersected`. 16 | 20240512: 重構函數, 寫成 `len_of_set`, `string_is_in_set`, 17 | `char_is_in_unicode_blocks`, `string_is_in_unicode_blocks` 18 | `string_is_in_charset_or_not_in_cjk` 19 | 20240514: 增加 `string_starts_with`. 20 | 20240919: 更新對於 CJK 區塊的定義, 加入西夏文和契丹小字等. 21 | 20250711: 增加泛 CJK 區塊的定義. 22 | 20250712: 增加 CJK 核心標點符號區塊的定義. 23 | 20250906: 增加 CJK 擴展 J 區的定義. 24 | 20251220: 增加 `is_single_char` 函數, 檢查文本是否為單個字符 (考慮變體選擇器). 25 | -------------------------------------------------------------------------------- 26 | ]] 27 | 28 | local core = {} 29 | 30 | --- 取得字符串首字符 31 | --- @param text string 32 | --- @return string 33 | function core.first_char_of_str(text) 34 | for p, c in utf8.codes(text) do 35 | return utf8.char(c) 36 | end 37 | end 38 | 39 | --- 將字符串轉化爲 set 40 | ---@param text string 41 | ---@return table 42 | function core.set_from_str(text) 43 | local t = {} 44 | for p, c in utf8.codes(text) do 45 | t[utf8.char(c)] = true 46 | end 47 | return t 48 | end 49 | 50 | --- 計算 set 的元素數目 51 | ---@param set table 52 | ---@return integer 53 | function core.len_of_set(set) 54 | local count = 0 55 | for k, v in pairs(set) do 56 | count = count + 1 57 | end 58 | return count 59 | end 60 | 61 | --- 判斷第一個 set 是不是第二個 set 的子集 62 | ---@param set1 table 63 | ---@param set2 table 64 | ---@return boolean 65 | function core.is_subset(set1, set2) 66 | for k, v in pairs(set1) do 67 | if not set2[k] then 68 | return false 69 | end 70 | end 71 | return true 72 | end 73 | 74 | --- 判斷一個字符串的所有字符是不是都在 set 中 75 | ---@param text string 76 | ---@param set table 77 | ---@return boolean 78 | function core.string_is_in_set(text, set) 79 | local set_of_text = core.set_from_str(text) 80 | return core.is_subset(set_of_text, set) 81 | end 82 | 83 | --- 判斷第一個 set 中是否包含第二個 set 的元素 84 | ---@param set1 table 85 | ---@param set2 table 86 | ---@return boolean 87 | function core.is_intersected(set1, set2) 88 | local len_of_set1 = core.len_of_set(set1) 89 | -- 首表爲空也算相交 90 | if len_of_set1 == 0 then 91 | return true 92 | end 93 | for k, v in pairs(set1) do 94 | if set2[k] then 95 | return true 96 | end 97 | end 98 | return false 99 | end 100 | 101 | core.cjk_blocks = { -- CJK 區塊(非符號區) 102 | { 0x4E00, 0x9FFF }, -- 中日韓統一表意文字 103 | { 0x3400, 0x4DBF }, -- 中日韓統一表意文字擴展區A 104 | { 0x20000, 0x2EE5F }, -- 中日韓統一表意文字擴展區BCDEFI 105 | { 0x30000, 0x3347F }, -- 中日韓統一表意文字擴展區GHJ 106 | 107 | { 0x2E80, 0x2EFF }, -- 中日韓漢字部首補充 108 | { 0x2F00, 0x2FDF }, -- 康熙部首 109 | { 0x31C0, 0x31EF }, -- 中日韓筆畫 110 | { 0x3300, 0x33FF }, -- 中日韓兼容字符 111 | { 0xF900, 0xFAFF }, -- 中日韓兼容表意文字 112 | { 0xFE30, 0xFE4F }, -- 中日韓兼容形式 113 | { 0x2F800, 0x2FA1F }, -- 中日韓兼容表意文字補充 114 | { 0x3190, 0x319F }, -- 漢文訓讀 115 | 116 | { 0x2FF0, 0x2FFF }, -- 表意文字描述字符 117 | -- { 0x3000, 0x303F }, -- 中日韓符號和標點 118 | -- { 0x3200, 0x32FF }, -- 中日韓帶圈字符及月份 119 | { 0x1F200, 0x1F2FF }, -- 帶圈表意文字補充 120 | { 0x1F000, 0x1F02F }, -- 麻將牌 121 | { 0x2600, 0x26FF }, -- 雜項符號(太極兩儀四象八卦) 122 | { 0x4DC0, 0x4DFF }, -- 易經六十四卦 123 | { 0x1D300, 0x1D35F }, -- 太玄經卦爻 124 | 125 | { 0x17000, 0x187FF }, -- 西夏文 126 | { 0x18800, 0x18AFF }, -- 西夏文部件 127 | { 0x18D00, 0x18D7F }, -- 西夏文補充 128 | { 0x18B00, 0x18CFF }, -- 契丹小字 129 | 130 | { 0xE000, 0xF8FF }, -- 私用區 宇浩字根在此區 131 | 132 | { 0x1B000, 0x1B0FF }, -- 補充假名 133 | { 0x1B100, 0x1B12F }, -- 假名擴展 134 | } 135 | 136 | core.pan_cjk_blocks = { -- 泛 CJK 區塊(非符號區) 137 | { 0x4E00, 0x9FFF }, -- 中日韓統一表意文字 138 | { 0x3400, 0x4DBF }, -- 中日韓統一表意文字擴展區A 139 | { 0x20000, 0x2EE5F }, -- 中日韓統一表意文字擴展區BCDEFI 140 | { 0x30000, 0x3347F }, -- 中日韓統一表意文字擴展區GHJ 141 | 142 | { 0x2E80, 0x2EFF }, -- 中日韓漢字部首補充 143 | { 0x2F00, 0x2FDF }, -- 康熙部首 144 | { 0x31C0, 0x31EF }, -- 中日韓筆畫 145 | { 0x3300, 0x33FF }, -- 中日韓兼容字符 146 | { 0xF900, 0xFAFF }, -- 中日韓兼容表意文字 147 | { 0xFE30, 0xFE4F }, -- 中日韓兼容形式 148 | { 0x2F800, 0x2FA1F }, -- 中日韓兼容表意文字補充 149 | { 0x3190, 0x319F }, -- 漢文訓讀 150 | 151 | { 0x2FF0, 0x2FFF }, -- 表意文字描述字符 152 | -- { 0x3000, 0x301F }, -- 中日韓符號和標點1 153 | { 0x3020, 0x303F }, -- 中日韓符號和標點2 154 | { 0x3200, 0x32FF }, -- 中日韓帶圈字符及月份 155 | { 0x1F200, 0x1F2FF }, -- 帶圈表意文字補充 156 | { 0x1F000, 0x1F02F }, -- 麻將牌 157 | { 0x2600, 0x26FF }, -- 雜項符號(太極兩儀四象八卦) 158 | { 0x4DC0, 0x4DFF }, -- 易經六十四卦 159 | { 0x1D300, 0x1D35F }, -- 太玄經卦爻 160 | 161 | { 0x3100, 0x312F }, -- 注音符號 162 | { 0x31A0, 0x31BF }, -- 注音符號擴展 163 | 164 | { 0x16FE0, 0x16FFF }, -- 表意文字符號和標點 165 | 166 | { 0x17000, 0x187FF }, -- 西夏文 167 | { 0x18800, 0x18AFF }, -- 西夏文部件 168 | { 0x18D00, 0x18D7F }, -- 西夏文補充 169 | { 0x18B00, 0x18CFF }, -- 契丹小字 170 | 171 | { 0xE000, 0xF8FF }, -- 私用區 宇浩字根在此區 172 | 173 | { 0x3040, 0x309F }, -- 平假名 174 | { 0x30A0, 0x30FF }, -- 片假名 175 | { 0x1B000, 0x1B0FF }, -- 補充假名 176 | { 0x1B100, 0x1B12F }, -- 假名擴展 177 | { 0x1B130, 0x1B16F }, -- 小型假名擴展 178 | 179 | { 0xAC00, 0xD7AF }, -- 韓文音節 180 | { 0x1100, 0x11FF }, -- 諺文字母 181 | { 0x3130, 0x318F }, -- 諺文兼容字母 182 | } 183 | 184 | core.cjk_punc_blocks = { -- CJK 核心標點符號區塊 185 | { 0x3000, 0x301F }, -- 中日韓符號和標點1 186 | { 0xFE50, 0xFE6F }, -- 小寫變體形式 187 | { 0xFE10, 0xFE1F }, -- 豎排形式 188 | { 0xFF00, 0xFFEF }, -- 半角及全角字符 189 | { 0x0000, 0x007f }, -- ASCII 字符 190 | } 191 | 192 | --- 判斷一個字符是不是在一組 Unicode 區位中 193 | ---@param unicode_of_char integer 194 | ---@param unicode_blocks table 195 | ---@return boolean 196 | function core.char_is_in_unicode_blocks(unicode_of_char, unicode_blocks) 197 | for i, c in ipairs(unicode_blocks) do 198 | if (unicode_of_char >= c[1]) and (unicode_of_char <= c[2]) then 199 | return true 200 | end 201 | end 202 | return false 203 | end 204 | 205 | --- 判斷一個字符串的所有字符是否都在一組 Unicode 區位中 206 | ---@param text string 207 | ---@param unicode_blocks table 208 | ---@return boolean 209 | function core.string_is_in_unicode_blocks(text, unicode_blocks) 210 | for p, unicode_of_char in utf8.codes(text) do 211 | if not core.char_is_in_unicode_blocks(unicode_of_char, unicode_blocks) then 212 | return false 213 | end 214 | end 215 | return true 216 | end 217 | 218 | --- 判斷一個字符串的所有字符都在一個指定集合中,或有一個非 CJK 漢字 219 | ---@param text string 220 | ---@param charset table 221 | ---@return boolean 222 | function core.string_is_in_charset_or_not_in_cjk(text, charset) 223 | local is_in_charset = core.string_is_in_set(text, charset) 224 | local is_in_cjk = core.string_is_in_unicode_blocks(text, core.cjk_blocks) 225 | return is_in_charset or not is_in_cjk 226 | end 227 | 228 | --- 判斷一個字符串的所有字符都在一個指定集合中,或有一個非泛 CJK 漢字 229 | --- 比以上更嚴格 230 | ---@param text string 231 | ---@param charset table 232 | ---@return boolean 233 | function core.string_is_in_charset_or_not_in_pan_cjk(text, charset) 234 | local is_in_charset = core.string_is_in_set(text, charset) 235 | local is_in_pan_cjk = core.string_is_in_unicode_blocks(text, core.pan_cjk_blocks) 236 | return is_in_charset or not is_in_pan_cjk 237 | end 238 | 239 | ---To check whether the first string begins with the second string 240 | ---@param text string 241 | ---@param start string 242 | ---@return boolean 243 | function core.string_starts_with(text, start) 244 | return text:sub(1, #start) == start 245 | end 246 | 247 | ---檢查文本是否為單個字符 (考慮變體選擇器) 248 | ---變體選擇器 (Variation Selector) 是特殊的 Unicode 字符 (U+E0100-U+E01EF), 249 | ---用於選擇同一字符的不同變體形式. 此函數將帶有變體選擇器的字符視為單字符. 250 | ---@param text string 251 | ---@return boolean 252 | function core.is_single_char(text) 253 | local text_len = utf8.len(text) 254 | if text_len == 1 then 255 | return true 256 | elseif text_len == 2 then 257 | -- 檢查第 2 個字符是否為變體選擇器(U+E0100 - U+E01EF) 258 | local chars = {} 259 | for pos, code in utf8.codes(text) do 260 | chars[#chars + 1] = utf8.char(code) 261 | end 262 | if chars[2] then 263 | local codepoint = utf8.codepoint(chars[2]) 264 | return codepoint >= 0xE0100 and codepoint <= 0xE01EF 265 | end 266 | end 267 | return false 268 | end 269 | 270 | ---通過 unicode 編碼輸入字符 @lost-melody 271 | function core.unicode() 272 | local space = utf8.codepoint(" ") 273 | return function(args) 274 | local code = tonumber(string.format("0x%s", args[1] or "")) 275 | return utf8.char(code or space) 276 | end 277 | end 278 | 279 | return core 280 | -------------------------------------------------------------------------------- /lua/yuhao/yuhao_embeded_cands.lua: -------------------------------------------------------------------------------- 1 | -- 作者:王牌餅乾 2 | -- https://github.com/lost-melody/ 3 | -- 转载请保留作者名 4 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 5 | --------------------------------------- 6 | 7 | -- 將要被返回的過濾器對象 8 | local embeded_cands_filter = {} 9 | 10 | --[[ 11 | # xxx.schema.yaml 12 | switches: 13 | - name: embeded_cands 14 | states: [ 普通, 嵌入 ] 15 | reset: 1 16 | engine: 17 | filters: 18 | - lua_filter@*smyh.embeded_cands 19 | key_binder: 20 | bindings: 21 | - { when: always, accept: "Control+Shift+E", toggle: embeded_cands } 22 | --]] 23 | 24 | -- 候選序號標記 25 | local index_indicators = {"¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹", "⁰"} 26 | 27 | -- 首選/非首選格式定義 28 | -- Seq: 候選序號; Code: 編碼; 候選: 候選文本; Comment: 候選提示 29 | local first_format = "${候選}${Comment}${Seq}" 30 | local next_format = "${候選}${Comment}${Seq}" 31 | local separator = " " 32 | 33 | -- 讀取 schema.yaml 開關設置: 34 | local option_name = "embeded_cands" 35 | 36 | -- 從方案配置中讀取字符串 37 | local function parse_conf_str(env, path, default) 38 | local str = env.engine.schema.config:get_string(env.name_space.."/"..path) 39 | if not str and default and #default ~= 0 then 40 | str = default 41 | end 42 | return str 43 | end 44 | 45 | -- 從方案配置中讀取字符串列表 46 | local function parse_conf_str_list(env, path, default) 47 | local list = {} 48 | local conf_list = env.engine.schema.config:get_list(env.name_space.."/"..path) 49 | if conf_list then 50 | for i = 0, conf_list.size-1 do 51 | table.insert(list, conf_list:get_value_at(i).value) 52 | end 53 | elseif default then 54 | list = default 55 | end 56 | return list 57 | end 58 | 59 | -- 構造開關變更回調函數 60 | local function get_switch_handler(env, op_name) 61 | local option 62 | if not env.option then 63 | option = {} 64 | env.option = option 65 | else 66 | option = env.option 67 | end 68 | -- 返回通知回調, 當改變選項值時更新暫存的值 69 | return function(ctx, name) 70 | if name == op_name then 71 | option[name] = ctx:get_option(name) 72 | if option[name] == nil then 73 | -- 當選項不存在時默認爲啟用狀態 74 | option[name] = true 75 | end 76 | end 77 | end 78 | end 79 | 80 | local function compile_formatter(format) 81 | -- "${Stash}[${候選}${Seq}]${Code}${Comment}" 82 | -- => "%s[%s%s]%s%s" 83 | -- => {"${Stash}", "${...}", "${...}", ...} 84 | local pattern = "%$%{[^{}]+%}" 85 | local verbs = {} 86 | for s in string.gmatch(format, pattern) do 87 | table.insert(verbs, s) 88 | end 89 | 90 | local res = { 91 | format = string.gsub(format, pattern, "%%s"), 92 | verbs = verbs, 93 | } 94 | local meta = { __index = function() return "" end } 95 | 96 | -- {"${v1}", "${v2}", ...} + {v1: a1, v2: a2, ...} = {a1, a2, ...} 97 | -- string.format("%s[%s%s]%s%s", a1, a2, ...) 98 | function res:build(dict) 99 | setmetatable(dict, meta) 100 | local args = {} 101 | for _, pat in ipairs(self.verbs) do 102 | table.insert(args, dict[pat]) 103 | end 104 | return string.format(self.format, table.unpack(args)) 105 | end 106 | 107 | return res 108 | end 109 | 110 | -- 按命名空間歸類方案配置, 而不是按会話, 以减少内存佔用 111 | local namespaces = {} 112 | function namespaces:init(env) 113 | -- 讀取配置項 114 | if not namespaces:config(env) then 115 | local config = {} 116 | config.index_indicators = parse_conf_str_list(env, "index_indicators", index_indicators) 117 | config.first_format = parse_conf_str(env, "first_format", first_format) 118 | config.next_format = parse_conf_str(env, "next_format", next_format) 119 | config.separator = parse_conf_str(env, "separator", separator) 120 | config.option_name = parse_conf_str(env, "option_name") 121 | 122 | config.formatter = {} 123 | config.formatter.first = compile_formatter(config.first_format) 124 | config.formatter.next = compile_formatter(config.next_format) 125 | namespaces:set_config(env, config) 126 | end 127 | end 128 | function namespaces:set_config(env, config) 129 | namespaces[env.name_space] = namespaces[env.name_space] or {} 130 | namespaces[env.name_space].config = config 131 | end 132 | function namespaces:config(env) 133 | return namespaces[env.name_space] and namespaces[env.name_space].config 134 | end 135 | 136 | function embeded_cands_filter.init(env) 137 | -- 讀取配置項 138 | local ok = pcall(namespaces.init, namespaces, env) 139 | if not ok then 140 | local config = {} 141 | config.index_indicators = index_indicators 142 | config.first_format = first_format 143 | config.next_format = next_format 144 | config.separator = separator 145 | config.option_name = parse_conf_str(env, "option_name") 146 | 147 | config.formatter = {} 148 | config.formatter.first = compile_formatter(config.first_format) 149 | config.formatter.next = compile_formatter(config.next_format) 150 | namespaces:set_config(env, config) 151 | end 152 | 153 | local config = namespaces:config(env) 154 | -- 是否指定開關 155 | if config.option_name and #config.option_name ~= 0 then 156 | -- 構造回調函數 157 | local handler = get_switch_handler(env, config.option_name) 158 | -- 初始化爲選項實際值, 如果設置了 reset, 則會再次觸發 handler 159 | handler(env.engine.context, config.option_name) 160 | -- 注册通知回調 161 | env.engine.context.option_update_notifier:connect(handler) 162 | else 163 | -- 未指定開關, 默認啓用 164 | config.option_name = option_name 165 | env.option = {} 166 | env.option[config.option_name] = true 167 | end 168 | end 169 | 170 | -- 渲染提示, 因爲提示經常有可能爲空, 抽取爲函數更昜操作 171 | local function render_comment(comment) 172 | if string.match(comment, "^[ ~]") then 173 | -- 丟棄以空格和"~"開頭的提示串, 這通常是補全提示 174 | comment = "" 175 | elseif string.len(comment) ~= 0 then 176 | comment = "["..comment.."]" 177 | end 178 | return comment 179 | end 180 | 181 | -- 渲染單個候選項 182 | local function render_cand(env, seq, code, text, comment) 183 | local formatter 184 | if seq == 1 then 185 | formatter = namespaces:config(env).formatter.first 186 | else 187 | formatter = namespaces:config(env).formatter.next 188 | end 189 | -- 渲染提示串 190 | comment = render_comment(comment) 191 | -- 渲染提示串 192 | comment = render_comment(comment) 193 | local cand = formatter:build({ 194 | ["${Seq}"] = namespaces:config(env).index_indicators[seq], 195 | ["${Code}"] = code, 196 | ["${候選}"] = text, 197 | ["${Comment}"] = comment, 198 | }) 199 | return cand 200 | end 201 | 202 | -- 過濾器 203 | function embeded_cands_filter.func(input, env) 204 | if not env.option[namespaces:config(env).option_name] then 205 | for cand in input:iter() do 206 | yield(cand) 207 | end 208 | return 209 | end 210 | 211 | -- 要顯示的候選數量 212 | local page_size = env.engine.schema.page_size 213 | -- 暫存當前頁候選, 然后批次送出 214 | local page_cands, page_rendered = {}, {} 215 | -- 暫存索引, 首選和預編輯文本 216 | local index, first_cand, preedit = 0, nil, "" 217 | 218 | local function refresh_preedit() 219 | if first_cand then 220 | first_cand.preedit = table.concat(page_rendered, namespaces:config(env).separator) 221 | -- 將暫存的一頁候選批次送出 222 | for _, c in ipairs(page_cands) do 223 | yield(c) 224 | end 225 | end 226 | -- 清空暫存 227 | first_cand, preedit = nil, "" 228 | page_cands, page_rendered = {}, {} 229 | end 230 | 231 | local hash = {} 232 | local rank = 0 233 | -- 迭代器 234 | local iter, obj = input:iter() 235 | -- 迭代由翻譯器輸入的候選列表 236 | local next = iter(obj) 237 | while next do 238 | -- 頁索引自增, 滿足 1 <= index <= page_size 239 | index = index + 1 240 | 241 | -- 當前遍歷候選項 242 | local cand = next 243 | 244 | -- 去除重複項 245 | if (not hash[cand.text]) then 246 | hash[cand.text] = true 247 | 248 | if not first_cand then 249 | -- 把首選捉出來 250 | first_cand = cand 251 | end 252 | 253 | rank = rank + 1 254 | 255 | -- 修改首選的預编輯文本, 這会作爲内嵌編碼顯示到輸入處 256 | preedit = render_cand(env, rank, first_cand.preedit, cand.text, cand.comment) 257 | 258 | -- 存入候選 259 | table.insert(page_cands, cand) 260 | table.insert(page_rendered, preedit) 261 | end 262 | -- 遍歷完一頁候選後, 刷新預編輯文本 263 | if index == page_size then 264 | refresh_preedit() 265 | rank = 0 266 | end 267 | 268 | -- 當前候選處理完畢, 查詢下一個 269 | next = iter(obj) 270 | 271 | -- 如果當前暫存候選不足page_size但没有更多候選, 則需要刷新預編輯並送出 272 | if not next and index < page_size then 273 | refresh_preedit() 274 | end 275 | 276 | -- 下一頁, index歸零 277 | index = index % page_size 278 | end 279 | end 280 | 281 | function embeded_cands_filter.fini(env) 282 | end 283 | 284 | return embeded_cands_filter 285 | -------------------------------------------------------------------------------- /lua/yuhao/deprecated/yuhao_sc_first.lua: -------------------------------------------------------------------------------- 1 | -- Name: yuhao_sc_first.lua 2 | -- 名称: 大陸簡化字前置 3 | -- Version: 20230918 4 | -- Author: forFudan 朱宇浩 5 | -- Github: https://github.com/forFudan/ 6 | -- 版權聲明: 7 | -- 專爲宇浩輸入法製作 8 | -- 轉載請保留作者名和出處 9 | -- Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International 10 | --------------------------------------- 11 | -- 12 | -- 介紹: 13 | -- 將候選中的簡化字前置 14 | -- 《通用規範漢字表》中的8105字 15 | -- 16 | -- Description: 17 | -- Prioritize simplified Chinese characters 18 | -- 19 | -- 版本: 20 | -- 20230918: 初版 21 | 22 | --------------------------- 23 | 24 | local str = 25 | "一乙二十丁厂七卜八人入儿匕几九刁了刀力乃又三干于亏工土士才下寸大丈与万上小口山巾千乞川亿个夕久么勺凡丸及广亡门丫义之尸己已巳弓子卫也女刃飞习叉马乡丰王开井天夫元无云专丐扎艺木五支厅不犬太区历歹友尤匹车巨牙屯戈比互切瓦止少曰日中贝冈内水见午牛手气毛壬升夭长仁什片仆化仇币仍仅斤爪反介父从仑今凶分乏公仓月氏勿欠风丹匀乌勾凤六文亢方火为斗忆计订户认冗讥心尺引丑巴孔队办以允予邓劝双书幻玉刊未末示击打巧正扑卉扒功扔去甘世艾古节本术可丙左厉石右布夯戊龙平灭轧东卡北占凸卢业旧帅归旦目且叶甲申叮电号田由只叭史央兄叽叼叫叩叨另叹冉皿凹囚四生矢失乍禾丘付仗代仙们仪白仔他斥瓜乎丛令用甩印尔乐句匆册卯犯外处冬鸟务包饥主市立冯玄闪兰半汁汇头汉宁穴它讨写让礼训议必讯记永司尼民弗弘出辽奶奴召加皮边孕发圣对台矛纠母幼丝邦式迂刑戎动扛寺吉扣考托老巩圾执扩扫地场扬耳芋共芒亚芝朽朴机权过臣吏再协西压厌戌在百有存而页匠夸夺灰达列死成夹夷轨邪尧划迈毕至此贞师尘尖劣光当早吁吐吓虫曲团吕同吊吃因吸吗吆屿屹岁帆回岂则刚网肉年朱先丢廷舌竹迁乔迄伟传乒乓休伍伏优臼伐延仲件任伤价伦份华仰仿伙伪自伊血向似后行舟全会杀合兆企众爷伞创肌肋朵杂危旬旨旭负匈名各多争色壮冲妆冰庄庆亦刘齐交衣次产决亥充妄闭问闯羊并关米灯州汗污江汛池汝汤忙兴宇守宅字安讲讳军讶许讹论讼农讽设访诀寻那迅尽导异弛孙阵阳收阶阴防奸如妇妃好她妈戏羽观欢买红驮纤驯约级纪驰纫巡寿弄麦玖玛形进戒吞远违韧运扶抚坛技坏抠扰扼拒找批址扯走抄贡汞坝攻赤折抓扳抡扮抢孝坎均抑抛投坟坑抗坊抖护壳志块扭声把报拟却抒劫芙芜苇芽花芹芥芬苍芳严芦芯劳克芭苏杆杠杜材村杖杏杉巫极李杨求甫匣更束吾豆两酉丽医辰励否还尬歼来连轩步卤坚肖旱盯呈时吴助县里呆吱吠呕园旷围呀吨足邮男困吵串员呐听吟吩呛吻吹呜吭吧邑吼囤别吮岖岗帐财针钉牡告我乱利秃秀私每兵估体何佐佑但伸佃作伯伶佣低你住位伴身皂伺佛囱近彻役返余希坐谷妥含邻岔肝肛肚肘肠龟甸免狂犹狈角删条彤卵灸岛刨迎饭饮系言冻状亩况床库庇疗吝应这冷庐序辛弃冶忘闰闲间闷判兑灶灿灼弟汪沐沛汰沥沙汽沃沦汹泛沧没沟沪沈沉沁怀忧忱快完宋宏牢究穷灾良证启评补初社祀识诈诉罕诊词译君灵即层屁尿尾迟局改张忌际陆阿陈阻附坠妓妙妖姊妨妒努忍劲矣鸡纬驱纯纱纲纳驳纵纷纸纹纺驴纽奉玩环武青责现玫表规抹卦坷坯拓拢拔坪拣坦担坤押抽拐拖者拍顶拆拎拥抵拘势抱拄垃拉拦幸拌拧拂拙招坡披拨择抬拇拗其取茉苦昔苛若茂苹苗英苟苑苞范直茁茄茎苔茅枉林枝杯枢柜枚析板松枪枫构杭杰述枕丧或画卧事刺枣雨卖郁矾矿码厕奈奔奇奋态欧殴垄妻轰顷转斩轮软到非叔歧肯齿些卓虎虏肾贤尚旺具味果昆国哎咕昌呵畅明易咙昂迪典固忠呻咒咋咐呼鸣咏呢咄咖岸岩帖罗帜帕岭凯败账贩贬购贮图钓制知迭氛垂牧物乖刮秆和季委秉佳侍岳供使例侠侥版侄侦侣侧凭侨佩货侈依卑的迫质欣征往爬彼径所舍金刹命肴斧爸采觅受乳贪念贫忿肤肺肢肿胀朋股肮肪肥服胁周昏鱼兔狐忽狗狞备饰饱饲变京享庞店夜庙府底疟疙疚剂卒郊庚废净盲放刻育氓闸闹郑券卷单炬炒炊炕炎炉沫浅法泄沽河沾泪沮油泊沿泡注泣泞泻泌泳泥沸沼波泼泽治怔怯怖性怕怜怪怡学宝宗定宠宜审宙官空帘宛实试郎诗肩房诚衬衫视祈话诞诡询该详建肃录隶帚屉居届刷屈弧弥弦承孟陋陌孤陕降函限妹姑姐姓妮始姆迢驾叁参艰线练组绅细驶织驹终驻绊驼绍绎经贯契贰奏春帮玷珍玲珊玻毒型拭挂封持拷拱项垮挎城挟挠政赴赵挡拽哉挺括垢拴拾挑垛指垫挣挤拼挖按挥挪拯某甚荆茸革茬荐巷带草茧茵茶荒茫荡荣荤荧故胡荫荔南药标栈柑枯柄栋相查柏栅柳柱柿栏柠树勃要柬咸威歪研砖厘厚砌砂泵砚砍面耐耍牵鸥残殃轴轻鸦皆韭背战点虐临览竖省削尝昧盹是盼眨哇哄哑显冒映星昨咧昭畏趴胃贵界虹虾蚁思蚂虽品咽骂勋哗咱响哈哆咬咳咪哪哟炭峡罚贱贴贻骨幽钙钝钞钟钢钠钥钦钧钩钮卸缸拜看矩毡氢怎牲选适秒香种秋科重复竿段便俩贷顺修俏保促俄俐侮俭俗俘信皇泉鬼侵禹侯追俊盾待徊衍律很须叙剑逃食盆胚胧胆胜胞胖脉胎勉狭狮独狰狡狱狠贸怨急饵饶蚀饺饼峦弯将奖哀亭亮度迹庭疮疯疫疤咨姿亲音帝施闺闻闽阀阁差养美姜叛送类迷籽娄前首逆兹总炼炸烁炮炫烂剃洼洁洪洒柒浇浊洞测洗活派洽染洛浏济洋洲浑浓津恃恒恢恍恬恤恰恼恨举觉宣宦室宫宪突穿窃客诫冠诬语扁袄祖神祝祠误诱诲说诵垦退既屋昼屏屎费陡逊眉孩陨除险院娃姥姨姻娇姚娜怒架贺盈勇怠癸蚤柔垒绑绒结绕骄绘给绚骆络绝绞骇统耕耘耗耙艳泰秦珠班素匿蚕顽盏匪捞栽捕埂捂振载赶起盐捎捍捏埋捉捆捐损袁捌都哲逝捡挫换挽挚热恐捣壶捅埃挨耻耿耽聂恭莽莱莲莫莉荷获晋恶莹莺真框梆桂桔栖档桐株桥桦栓桃格桩校核样根索哥速逗栗贾酌配翅辱唇夏砸砰砾础破原套逐烈殊殉顾轿较顿毙致柴桌虑监紧党逞晒眠晓哮唠鸭晃哺晌剔晕蚌畔蚣蚊蚪蚓哨哩圃哭哦恩鸯唤唁哼唧啊唉唆罢峭峨峰圆峻贼贿赂赃钱钳钻钾铁铃铅缺氧氨特牺造乘敌秤租积秧秩称秘透笔笑笋债借值倚俺倾倒倘俱倡候赁俯倍倦健臭射躬息倔徒徐殷舰舱般航途拿耸爹舀爱豺豹颁颂翁胰脆脂胸胳脏脐胶脑脓逛狸狼卿逢鸵留鸳皱饿馁凌凄恋桨浆衰衷高郭席准座症病疾斋疹疼疲脊效离紊唐瓷资凉站剖竞部旁旅畜阅羞羔瓶拳粉料益兼烤烘烦烧烛烟烙递涛浙涝浦酒涉消涡浩海涂浴浮涣涤流润涧涕浪浸涨烫涩涌悖悟悄悍悔悯悦害宽家宵宴宾窍窄容宰案请朗诸诺读扇诽袜袖袍被祥课冥谁调冤谅谆谈谊剥恳展剧屑弱陵祟陶陷陪娱娟恕娥娘通能难预桑绢绣验继骏球琐理琉琅捧堵措描域捺掩捷排焉掉捶赦堆推埠掀授捻教掏掐掠掂培接掷控探据掘掺职基聆勘聊娶著菱勒黄菲萌萝菌萎菜萄菊菩萍菠萤营乾萧萨菇械彬梦婪梗梧梢梅检梳梯桶梭救曹副票酝酗厢戚硅硕奢盔爽聋袭盛匾雪辅辆颅虚彪雀堂常眶匙晨睁眯眼悬野啪啦曼晦晚啄啡距趾啃跃略蚯蛀蛇唬累鄂唱患啰唾唯啤啥啸崖崎崭逻崔帷崩崇崛婴圈铐铛铝铜铭铲银矫甜秸梨犁秽移笨笼笛笙符第敏做袋悠偿偶偎偷您售停偏躯兜假衅徘徙得衔盘舶船舵斜盒鸽敛悉欲彩领脚脖脯豚脸脱象够逸猜猪猎猫凰猖猛祭馅馆凑减毫烹庶麻庵痊痒痕廊康庸鹿盗章竟商族旋望率阎阐着羚盖眷粘粗粒断剪兽焊焕清添鸿淋涯淹渠渐淑淌混淮淆渊淫渔淘淳液淤淡淀深涮涵婆梁渗情惜惭悼惧惕惟惊惦悴惋惨惯寇寅寄寂宿窒窑密谋谍谎谐袱祷祸谓谚谜逮敢尉屠弹隋堕随蛋隅隆隐婚婶婉颇颈绩绪续骑绰绳维绵绷绸综绽绿缀巢琴琳琢琼斑替揍款堪塔搭堰揩越趁趋超揽堤提博揭喜彭揣插揪搜煮援搀裁搁搓搂搅壹握搔揉斯期欺联葫散惹葬募葛董葡敬葱蒋蒂落韩朝辜葵棒棱棋椰植森焚椅椒棵棍椎棉棚棕棺榔椭惠惑逼粟棘酣酥厨厦硬硝确硫雁殖裂雄颊雳暂雅翘辈悲紫凿辉敞棠赏掌晴睐暑最晰量鼎喷喳晶喇遇喊遏晾景畴践跋跌跑跛遗蛙蛛蜓蜒蛤喝鹃喂喘喉喻啼喧嵌幅帽赋赌赎赐赔黑铸铺链销锁锄锅锈锋锌锐甥掰短智氮毯氯鹅剩稍程稀税筐等筑策筛筒筏答筋筝傲傅牌堡集焦傍储皓皖粤奥街惩御循艇舒逾番释禽腊脾腋腔腕鲁猩猬猾猴惫然馈馋装蛮就敦斌痘痢痪痛童竣阔善翔羡普粪尊奠道遂曾焰港滞湖湘渣渤渺湿温渴溃溅滑湃渝湾渡游滋渲溉愤慌惰愕愣惶愧愉慨割寒富寓窜窝窖窗窘遍雇裕裤裙禅禄谢谣谤谦犀属屡强粥疏隔隙隘媒絮嫂媚婿登缅缆缉缎缓缔缕骗编骚缘瑟鹉瑞瑰瑙魂肆摄摸填搏塌鼓摆携搬摇搞塘摊聘斟蒜勤靴靶鹊蓝墓幕蓬蓄蒲蓉蒙蒸献椿禁楚楷榄想槐榆楼概赖酪酬感碍碘碑碎碰碗碌尴雷零雾雹辐辑输督频龄鉴睛睹睦瞄睫睡睬嗜鄙嗦愚暖盟歇暗暇照畸跨跷跳跺跪路跤跟遣蜈蜗蛾蜂蜕嗅嗡嗓署置罪罩蜀幌错锚锡锣锤锥锦键锯锰矮辞稚稠颓愁筹签简筷毁舅鼠催傻像躲魁衙微愈遥腻腰腥腮腹腺鹏腾腿鲍猿颖触解煞雏馍馏酱禀痹廓痴痰廉靖新韵意誊粮数煎塑慈煤煌满漠滇源滤滥滔溪溜漓滚溢溯滨溶溺粱滩慎誉塞寞窥窟寝谨褂裸福谬群殿辟障媳嫉嫌嫁叠缚缝缠缤剿静碧璃赘熬墙墟嘉摧赫截誓境摘摔撇聚慕暮摹蔓蔑蔡蔗蔽蔼熙蔚兢模槛榴榜榨榕歌遭酵酷酿酸碟碱碳磁愿需辖辗雌裳颗瞅墅嗽踊蜻蜡蝇蜘蝉嘛嘀赚锹锻镀舞舔稳熏箕算箩管箫舆僚僧鼻魄魅貌膜膊膀鲜疑孵馒裹敲豪膏遮腐瘩瘟瘦辣彰竭端旗精粹歉弊熄熔煽潇漆漱漂漫滴漾演漏慢慷寨赛寡察蜜寥谭肇褐褪谱隧嫩翠熊凳骡缩慧撵撕撒撩趣趟撑撮撬播擒墩撞撤增撰聪鞋鞍蕉蕊蔬蕴横槽樱橡樟橄敷豌飘醋醇醉磕磊磅碾震霄霉瞒题暴瞎嘻嘶嘲嘹影踢踏踩踪蝶蝴蝠蝎蝌蝗蝙嘿嘱幢墨镇镐镑靠稽稻黎稿稼箱篓箭篇僵躺僻德艘膝膛鲤鲫熟摩褒瘪瘤瘫凛颜毅糊遵憋潜澎潮潭鲨澳潘澈澜澄懂憔懊憎额翩褥谴鹤憨慰劈履豫缭撼擂操擅燕蕾薯薛薇擎薪薄颠翰噩橱橙橘整融瓢醒霍霎辙冀餐嘴踱蹄蹂蟆螃器噪鹦赠默黔镜赞穆篮篡篷篱儒邀衡膨雕鲸磨瘾瘸凝辨辩糙糖糕燃濒澡激懒憾懈窿壁避缰缴戴擦藉鞠藏藐檬檐檀礁磷霜霞瞭瞧瞬瞳瞩瞪曙蹋蹈螺蟋蟀嚎赡穗魏簧簇繁徽爵朦臊鳄癌辫赢糟糠燥懦豁臀臂翼骤藕鞭藤覆瞻蹦嚣镰翻鳍鹰瀑襟璧戳孽警蘑藻攀曝蹲蹭蹬巅簸簿蟹颤靡癣瓣羹鳖爆疆鬓壤馨耀躁蠕嚼嚷巍籍鳞魔糯灌譬蠢霸露霹躏黯髓赣囊镶瓤罐矗乂乜兀弋孑孓幺亓韦廿丏卅仄厄仃仉仂兮刈爻卞闩讣尹夬爿毋邗邛艽艿札叵匝丕匜劢卟叱叻仨仕仟仡仫仞卮氐犰刍邝邙汀讦讧讪讫尻阡尕弁驭匡耒玎玑邢圩圬圭扦圪圳圹扪圮圯芊芍芄芨芑芎芗亘厍夼戍尥乩旯曳岌屺凼囡钇缶氘氖牝伎伛伢佤仵伥伧伉伫囟汆刖夙旮刎犷犸舛凫邬饧汕汔汐汲汜汊忖忏讴讵祁讷聿艮厾阱阮阪丞妁牟纡纣纥纨玕玙抟抔圻坂坍坞抃抉㧐芫邯芸芾苈苣芷芮苋芼苌苁芩芪芡芟苄苎苡杌杓杞杈忑孛邴邳矶奁豕忒欤轫迓邶忐卣邺旰呋呒呓呔呖呃旸吡町虬呗吽吣吲帏岐岈岘岑岚兕囵囫钊钋钌迕氙氚牤佞邱攸佚佝佟佗伽彷佘佥孚豸坌肟邸奂劬狄狁鸠邹饨饩饪饫饬亨庑庋疔疖肓闱闳闵羌炀沣沅沔沤沌沏沚汩汨沂汾沨汴汶沆沩泐怃怄忡忤忾怅忻忪怆忭忸诂诃诅诋诌诏诒孜陇陀陂陉妍妩妪妣妊妗妫妞姒妤邵劭刭甬邰纭纰纴纶纾玮玡玭玠玢玥玦盂忝匦坩抨拤坫拈垆抻劼拃拊坼坻㧟坨坭抿坳耶苷苯苤茏苫苜苴苒苘茌苻苓茚茆茑茓茔茕茀苕枥枇杪杳枧杵枨枞枋杻杷杼矸砀刳奄瓯殁郏轭郅鸢盱昊昙杲昃咂呸昕昀旻昉炅咔畀虮咀呷黾呱呤咚咆咛呶呣呦咝岢岿岬岫帙岣峁刿迥岷剀帔峄沓囹罔钍钎钏钒钕钗邾迮牦竺迤佶佬佰侑侉臾岱侗侃侏侩佻佾侪佼佯侬帛阜侔徂刽郄怂籴瓮戗肼䏝肽肱肫剁迩郇狙狎狍狒咎炙枭饯饴冽冼庖疠疝疡兖妾劾炜𬉼炖炘炝炔泔沭泷泸泱泅泗泠泺泖泫泮沱泯泓泾怙怵怦怛怏怍㤘怩怫怿宕穹宓诓诔诖诘戾诙戽郓衩祆祎祉祇诛诜诟诠诣诤诧诨诩戕孢亟陔妲妯姗帑弩孥驽虱迦迨绀绁绂驷驸绉绌驿骀甾珏珐珂珑玳珀顸珉珈拮垭挝垣挞垤赳贲垱垌郝垧垓挦垠茜荚荑贳荜莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茨垩荥荦荨荩剋荪茹荬荮柰栉柯柘栊柩枰栌柙枵柚枳柞柝栀柢栎枸柈柁枷柽剌酊郦甭砗砘砒斫砭砜奎耷虺殂殇殄殆轱轲轳轶轸虿毖觇尜哐眄眍𠳐郢眇眊眈禺哂咴曷昴昱昵咦哓哔畎毗呲胄畋畈虼虻盅咣哕剐郧咻囿咿哌哙哚咯咩咤哝哏哞峙峣罘帧峒峤峋峥贶钚钛钡钣钤钨钫钯氡氟牯郜秕秭竽笈笃俦俨俅俪叟垡牮俣俚皈俑俟逅徇徉舢俞郗俎郤爰郛瓴胨胪胛胂胙胍胗胝朐胫鸨匍狨狯飑狩狲訇逄昝饷饸饹胤孪娈弈奕庥疬疣疥疭庠竑彦飒闼闾闿阂羑迸籼酋炳炻炽炯烀炷烃洱洹洧洌浃洇洄洙涎洎洫浍洮洵浒浔浕洳恸恓恹恫恺恻恂恪恽宥扃衲衽衿袂祛祜祓祚诮祗祢诰诳鸩昶郡咫弭牁胥陛陟娅姮娆姝姣姘姹怼羿炱矜绔骁骅绗绛骈耖挈珥珙顼珰珩珧珣珞琤珲敖恚埔埕埘埙埚挹耆耄埒捋贽垸捃盍荸莆莳莴莪莠莓莜莅荼莩荽莸荻莘莎莞莨鸪莼栲栳郴桓桡桎桢桤梃栝桕桁桧桅栟桉栩逑逋彧鬲豇酐逦厝孬砝砹砺砧砷砟砼砥砣剞砻轼轾辂鸫趸龀鸬虔逍眬唛晟眩眙哧哽唔晁晏鸮趵趿畛蚨蚜蚍蚋蚬蚝蚧唢圄唣唏盎唑崂崃罡罟峪觊赅钰钲钴钵钹钺钽钼钿铀铂铄铆铈铉铊铋铌铍䥽铎氩氤氦毪舐秣秫盉笄笕笊笏笆俸倩俵偌俳俶倬倏恁倭倪俾倜隼隽倌倥臬皋郫倨衄颀徕舫釜奚衾胯胱胴胭脍胼朕脒胺鸱玺鸲狷猁狳猃狺逖桀袅饽凇栾挛亳疳疴疸疽痈疱痂痉衮凋颃恣旆旄旃阃阄訚阆恙粑朔郸烜烨烩烊剡郯烬涑浯涞涟娑涅涠浞涓浥涔浜浠浣浚悚悭悝悒悌悛宸窈剜诹冢诼袒袢祯诿谀谂谄谇屐屙陬勐奘牂蚩陲姬娠娌娉娲娩娴娣娓婀畚逡绠骊绡骋绥绦绨骎邕鸶彗耜焘舂琏琇麸揶埴埯捯掳掴埸埵赧埤捭逵埝堋堍掬鸷掖捽掊堉掸捩掮悫埭埽掇掼聃菁萁菘堇萘萋菽菖萜萸萑棻菔菟萏萃菏菹菪菅菀萦菰菡梵梿梏觋桴桷梓棁桫棂啬郾匮敕豉鄄酞酚戛硎硭硒硖硗硐硇硌鸸瓠匏厩龚殒殓殍赉雩辄堑眭眦啧晡晤眺眵眸圊喏喵啉勖晞唵晗冕啭畦趺啮跄蚶蛄蛎蛆蚰蛊圉蚱蛉蛏蚴啁啕唿啐唼唷啖啵啶啷唳唰啜帻崚崦帼崮崤崆赇赈赊铑铒铗铙铟铠铡铢铣铤铧铨铩铪铫铬铮铯铰铱铳铵铷氪牾鸹秾逶笺筇笸笪笮笠笥笤笳笾笞偾偃偕偈傀偬偻皑皎鸻徜舸舻舴舷龛翎脬脘脲匐猗猡猞猝斛猕馗馃馄鸾孰庹庾痔痍疵翊旌旎袤阇阈阉阊阋阍阏羟粝粕敝焐烯焓烽焖烷焗渍渚淇淅淞渎涿淖挲淠涸渑淦淝淬涪淙涫渌淄惬悻悱惝惘悸惆惚惇惮窕谌谏扈皲谑裆袷裉谒谔谕谖谗谙谛谝逯郿隈粜隍隗婧婊婕娼婢婵胬袈翌恿欸绫骐绮绯绱骒绲骓绶绺绻绾骖缁耠琫琵琶琪瑛琦琥琨靓琰琮琯琬琛琚辇鼋揳堞搽揸揠堙趄揖颉塄揿耋揄蛩蛰塆摒揆掾聒葑葚靰靸葳葺葸萼葆葩葶蒌萱戟葭楮棼椟棹椤棰赍椋椁椪棣椐鹁覃酤酢酡鹂厥殚殛雯雱辊辋椠辍辎斐睄睑睇睃戢喋嗒喃喱喹晷喈跖跗跞跚跎跏跆蛱蛲蛭蛳蛐蛔蛞蛴蛟蛘喁喟啾嗖喑嗟喽嗞喀喔喙嵘嵖崴遄詈嵎崽嵬嵛嵯嵝嵫幄嵋赕铻铼铿锃锂锆锇锉锏锑锒锔锕掣矬氰毳毽犊犄犋鹄犍嵇黍稃稂筚筵筌傣傈舄牍傥傧遑傩遁徨媭畲弑颌翕釉鹆舜貂腈腌腓腆腴腑腚腱鱿鲀鲂颍猢猹猥飓觞觚猱颎飧馇馊亵脔裒痣痨痦痞痤痫痧赓竦瓿啻颏鹇阑阒阕粞遒孳焯焜焙焱鹈湛渫湮湎湜渭湍湫溲湟溆湲湔湉渥湄滁愠惺愦惴愀愎愔喾寐谟扉裢裎裥祾祺谠幂谡谥谧遐孱弼巽骘媪媛婷巯翚皴婺骛缂缃缄彘缇缈缌缑缒缗飨耢瑚瑁瑜瑗瑄瑕遨骜韫髡塬鄢趔趑摅摁蜇搋搪搐搛搠摈彀毂搦搡蓁戡蓍鄞靳蓐蓦鹋蒽蓓蓖蓊蒯蓟蓑蒿蒺蓠蒟蒡蒹蒴蒗蓥颐楔楠楂楝楫楸椴槌楯皙榈槎榉楦楣楹椽裘剽甄酮酰酯酩蜃碛碓硼碉碚碇碜鹌辏龃龅訾粲虞睚嗪韪嗷嗉睨睢雎睥嘟嗑嗫嗬嗔嗝戥嗄煦暄遢暌跬跶跸跐跣跹跻蛸蜊蜍蜉蜣畹蛹嗣嗯嗥嗲嗳嗌嗍嗨嗐嗤嗵罨嵊嵩嵴骰锗锛锜锝锞锟锢锨锩锭锱雉氲犏歃稞稗稔筠筢筮筲筱牒煲敫徭愆艄觎毹貊貅貉颔腠腩腼腭腧塍媵詹鲅鲆鲇鲈稣鲋鲐肄鹐飕觥遛馐鹑亶瘃痱痼痿瘐瘁瘆麂裔歆旒雍阖阗阙羧豢粳猷煳煜煨煅煊煸煺滟溱溘漭滢溥溧溽裟溻溷滗滫溴滏滃滦溏滂滓溟滪愫慑慊鲎骞窦窠窣裱褚裨裾裰禊谩谪媾嫫媲嫒嫔媸缙缜缛辔骝缟缡缢缣骟耥璈瑶瑭獒觏慝嫠韬叆髦摽墁撂摞撄翥踅摭墉墒榖綦蔫蔷靺靼鞅靿甍蔸蔟蔺戬蕖蔻蓿斡鹕蓼榛榧榻榫榭槔榱槁槟槠榷僰酽酶酹厮碡碴碣碲磋臧豨殡霆霁辕蜚裴翡龇龈睿䁖睽嘞嘈嘌嘁嘎暧暝踌踉蜞蜥蜮蝈蜴蜱蜩蜷蜿螂蜢嘘嘡鹗嘣嘤嘚嗾嘧罴罱幔嶂幛赙罂骷骶鹘锲锴锶锷锸锵镁镂犒箐箦箧箍箸箬箅箪箔箜箢箓毓僖儆僳僭劁僮魃魆睾艋鄱膈膑鲑鲔鲚鲛鲟獐觫雒夤馑銮塾麽瘌瘊瘘瘙廖韶旖膂阚鄯鲞粿粼粽糁槊鹚熘熥潢漕滹漯漶潋潴漪漉漳漩澉潍慵搴窨寤綮谮褡褙褓褛褊谯谰谲暨屣鹛嫣嫱嫖嫦嫚嫘嫡鼐翟瞀鹜骠缥缦缧缨骢缪缫耦耧瑾璜璀璎璁璋璇奭髯髫撷撅赭撸鋆撙撺墀聩觐鞑蕙鞒蕈蕨蕤蕞蕺瞢蕃蕲赜槿樯槭樗樘樊槲醌醅靥魇餍磔磙霈辘龉龊觑瞌瞋瞑嘭噎噶颙暹噘踔踝踟踒踬踮踯踺踞蝽蝾蝻蝰蝮螋蝓蝣蝼噗嘬颚噍噢噙噜噌噔颛幞幡嶙嶝骺骼骸镊镉镌镍镏镒镓镔稷箴篑篁篌篆牖儋徵磐虢鹞膘滕鲠鲡鲢鲣鲥鲧鲩獗獠觯馓馔麾廛瘛瘼瘢瘠齑羯羰𥻗遴糌糍糅熜熵熠澍澌潸潦潲鋈潟潼潺憬憧寮窳谳褴褟褫谵熨屦嬉勰戮蝥缬缮缯骣畿耩耨耪璞璟靛璠璘聱螯髻髭髹擀熹甏擞縠磬颞蕻鞘颟薤薨檠薏薮薜薅樾橛橇樵檎橹樽樨橼墼橐翮醛醐醍醚磲赝飙殪霖霏霓錾辚臻遽氅瞟瞠瞰嚄嚆噤暾蹀踹踵踽蹉蹁螨蟒螈螅螭螠螟噱噬噫噻噼罹圜䦃镖镗镘镚镛镝镞镠氇氆憩穑篝篥篦篪篙盥劓翱魉魈徼歙膳膦膙鲮鲱鲲鲳鲴鲵鲷鲻獴獭獬邂鹧廨赟瘰廪瘿瘵瘴癃瘳斓麇麈嬴壅羲糗瞥甑燎燠燔燧濑濉潞澧澹澥澶濂褰寰窸褶禧嬖犟隰嬗颡缱缲缳璨璩璐璪螫擤壕觳罄擢薹鞡鞬薷薰藓藁檄檩懋醢翳礅磴鹩龋龌豳壑黻嚏嚅蹑蹒蹊蟥螬螵疃螳蟑嚓羁罽罾嶷黜黝髁髀镡镢镣镦镧镩镪镫罅黏簌篾篼簖簋鼢黛儡鹪鼾皤魍龠繇貘邈貔臌膻臆臃鲼鲽鳀鳃鳅鳇鳊螽燮鹫襄糜縻膺癍麋懑濡濮濞濠濯蹇謇邃襁檗擘孺隳嬷蟊鹬鍪鏊鳌鬈鬃瞽鞯鞨鞫鞧鞣藜藠藩醪蹙礓燹餮瞿曛颢曜躇蹚鹭蟛蟪蟠蟮鹮黠黟髅髂镬镭镯馥簟簪鼬雠艟鳎鳏鳐癞癔癜癖糨蹩鎏懵彝邋鬏攉攒鞲鞴藿蘧蘅麓醮醯酃霪霭霨黼嚯蹰蹶蹽蹼蹴蹾蹿蠖蠓蟾蠊黢髋髌镲籀籁齁魑艨鳓鳔鳕鳗鳙麒鏖羸㸆瀚瀣瀛襦谶襞骥缵瓒攘蘩蘖醴霰酆矍曦躅鼍巉黩黥黪镳镴黧纂璺鼯臜鳜鳝鳟獾孀骧瓘鼙醺礴颦曩鳢癫麝夔爝灏禳鐾羼蠡耱懿蘸鹳霾氍饕躐髑镵穰饔鬻鬟趱攫攥颧躜鼹癯麟蠲蠹躞衢鑫灞襻纛鬣攮囔馕戆爨齉亍尢彳卬殳𠙶毌邘戋圢氕伋仝冮氿汈氾忉宄𬣙讱扞圲圫芏芃朳朸𨙸邨吒吖屼屾辿钆仳伣伈癿甪邠犴冱邡闫𬇕汋䜣讻𬣞孖𬘓纩玒玓玘玚刬𫭟坜坉扽𫭢坋扺㧑毐芰芣苊苉芘芴芠𫇭芤杕杙杄杧杩尪尨轪𫐄坒芈旴旵呙㕮岍𫵷岠岜呇冏觃岙伾㑇伭佖伲佁飏狃闶汧汫𣲘𣲗沄沘𬇙汭㳇沇忮忳忺𬣡祃诇邲诎诐屃𫸩岊阽䢺阼妧妘𨚕纮驲𫘜纻𬘘𫘝纼玤玞玱玟邽邿坥坰坬坽弆耵䢼𦭜茋苧苾苠枅㭎枘枍矼矻匼𬨂𬀩𬀪旿昇昄昒昈咉咇咍岵岽岨岞峂㟃囷𬬩钐钔钖牥佴垈侁侹佸佺隹㑊侂佽侘郈舠郐郃攽肭肸肷狉狝饳忞於炌炆泙沺泂泜泃泇怊峃穸祋祊𫍣𬣳𬩽鸤弢弨陑𬮿陎𬯀卺乸妭姈𫰛迳叕𬳵驵𬳶䌹驺𫠊绋绐砉耔㛃玶珇珅𬍛珋玹珌玿韨垚垯垙垲埏垍耇鿍垎垴垟垞挓垵垏拶荖荁荙荛茈茽荄茺𬜬荓茳𦰡茛荭㭕柷柃柊枹栐柖郚剅䴓迺厖砆砑砄耏奓䶮轵轷轹轺昺𪾢昽盷咡咺昳昣哒昤昫昡咥昪虷虸哃峘耑峛𪨰峗峧帡钘𫓧钜𬬮𬬱𬬭钪钬钭矧秬俫舁俜俙俍垕衎舣弇侴鸧䏡胠𦙶胈胩胣朏飐訄饻庤疢炣炟㶲洭洘洓洿㳚泚浈浉洸洑洢洈洚洺洨浐㳘洴洣恔宬窀扂袆祏祐祕叚陧陞娀姞姱姤姶姽枲绖骃𬘡𬳽𬘩𫄧彖骉恝珪珛珹琊玼珖𪟝珽珦珫珒𬍤珢珕珝𫭼埗垾垺埆垿埌埇莰茝𬜯鄀莶莝䓖莙栻桠𬂩桄梠栴梴栒酎酏𫠆砵砠砫砬硁恧翃郪𨐈辀辁𬌗剕赀哢晅晊唝哳哱冔晔晐晖畖蚄蚆𫑡帱崁峿𪨶崄帨崀赆𬬸钷𬬻𬬹𬬿𬭁眚甡笫倻倴脩倮倕倞𫢸倓倧衃虒舭舯舥瓞鬯鸰脎朓胲虓鱽狴峱狻眢𫗧勍痄疰痃竘羖羓桊敉烠烔烶烻𬊈涍浡浭浬涄涢涐浰浟浛浼浲涘悈悃悢𬒈宧窅窊窎扅扆袪袗袯祧隺堲疍𨺙陴烝砮㛚哿翀翂剟𬳿𫄨绤骍𬘫䂮琎珸珵琄琈琀珺掭堎堐埼掎埫堌晢𫮃掞埪壸㙍聍菝萚菥莿䓫勚䓬萆菂菍菼萣䓨菉䓛梼梽桲梾桯梣梌桹敔厣硔鿎硙硚硊硍勔䴕龁逴唪啫翈㫰晙畤𬱖趼跂蛃蚲𬟽蚺啴䎃崧崟崞崒崌崡铏𫓯𫟹铕𫟼铖铘铚铞铥铴牻牿稆笱笯偰偡鸺偭偲偁㿠鄅偓徛衒舳舲鸼悆鄃瓻䝙脶脞脟䏲鱾猇猊猄觖𠅤庱庼庳痓䴔竫堃阌羝羕焆烺焌淏𬇹淟淜淴淯湴涴𬍡㥄惛惔悰惙寁逭𬤇𫍯袼裈祲𬤊𫍲谞艴弸弶𬯎隃婞娵婼媖婳婍婌婫婤婘婠𬘬𬘭𬴂𫘦绹𫟅𬘯骕𫘧絜珷琲琡琟琔琭堾堼揕㙘堧喆堨塅堠絷𪣻𡎚葜惎萳葙靬葴蒇蒈鄚蒉蓇萩蒐葰葎鄑蒎葖蒄萹棤棽棫椓椑𬃊鹀椆棓棬棪椀楗𬷕甦酦觌奡皕硪欹詟𫐐辌棐龂𬹼黹牚睎晫晪晱𧿹蛑畯斝喤崶嵁𫶇崾嵅崿嵚翙𫖮圌圐赑淼赒鿏铹𬭊铽𨱇𫓶锊锍锎𬭎锓犇颋稌筀筘筜筥筅傃傉翛傒傕舾畬𫖯脿腘䐃腙腒𬱟鲃猰𫛭猯㺄馉凓鄗𫷷廋廆鄌粢遆旐𬮱焞𬊤欻𣸣溚溁湝渰湓㴔渟溠渼溇湣湑溞愐愃敩甯棨扊裣祼婻媆媞㛹媓媂媄毵矞𬴃𫘨缊缐骙瑃瑓瑅瑆䴖瑖瑝瑔瑀𤧛瑳瑂嶅瑑遘髢塥堽赪摛塝搒搌蒱蒨蓏蔀蓢蓂蒻蓣椹楪榃榅楒楞楩榇椸楙歅𬪩碃碏𬒔碈䃅硿鄠辒𬨎𫐓龆觜䣘暕鹍𫫇㬊暅跱蜐蜎嵲赗骱锖𫓹锘锳锧锪𬭚锫锬𬭛稑稙䅟𬕂筻筼筶筦筤傺鹎僇艅艉谼貆腽腨腯鲉鲊鲌䲟𬶋𬶍鲏雊猺飔觟𦝼馌裛廒瘀瘅鄘鹒鄜麀鄣阘𫔶煁煃煴煋煟煓滠溍溹滆滉溦溵漷滧滘滍愭慥慆塱𫌀裼禋禔禘禒谫鹔𫖳愍嫄媱戤勠戣𫘪𫘬缞耤瑧𫞩瑨瑱瑷瑢斠摏墕墈墐墘摴銎𡐓墚撖𪤗靽鞁蔌蔈蓰蔹蔊嘏榰榑槚𣗋槜榍疐𬸘酺酾酲酴碶䃎𬒗碨𥔲碹碥劂𫚖䴗夥瞍鹖㬎跽蜾幖嶍圙𨱏锺锼锽𬭤锾锿镃镄镅馝鹙箨箖劄僬僦僔僎槃㙦鲒鲕𫚕鲖鲗鲘鲙𬶐𬶏𩽾夐獍飗𬸚凘廑廙瘗瘥瘕鲝鄫熇漹漖潆漤潩漼漴㽏漈漋漻慬窬窭㮾𬤝褕禛禚隩嫕嫭嫜嫪𬙂㻬麹璆漦叇墣墦墡劐薁蕰蔃鼒槱鹝磏磉殣慭霅暵暲暶踦踣䗖蝘蝲蝤噇噂噀罶嶲嶓㠇嶟嶒镆镈镋镎𬭩镕稹儇皞皛䴘艎艏鹟𩾃鲦鲪鲬橥觭鹠鹡糇糈翦鹢鹣熛潖潵㵐澂澛瑬潽潾潏憭憕𬸣戭褯禤𫍽嫽遹𬴊璥璲璒憙擐鄹薳鞔黇𬞟蕗薢蕹橞橑橦醑觱磡𥕢磜豮𫟦𬺈𫠜鹾虤暿曌曈㬚蹅踶䗛螗疁㠓幪𪩘嶦𬭬𨱑𬭯馞穄篚篯簉鼽衠盦螣縢鲭鲯鲰鲺鲹𫗴亸癀瘭𬸦羱糒燋熻燊燚燏濩濋澪澽澴澭澼憷憺懔黉嬛鹨翯𫄷璱𤩽璬璮髽擿薿薸檑櫆檞醨繄磹磻瞫瞵蹐蟏㘎𬭳镤𬭶𫔍镥镨𬭸𨱔𬭼𫔎矰穙穜穟簕簃簏儦魋斶艚𬸪谿䲠𬶟鲾𬶠鲿鳁鳂鳈鳉獯䗪馘襕襚𬶨螱甓嬬嬥𦈡𫄸瓀釐鬶爇鞳鞮𬟁藟藦藨鹲檫黡礞礌𥖨蹢蹜蟫䗴嚚髃镮镱酂馧簠簝簰鼫鼩皦臑䲢鳑鳒鹱鹯癗𦒍旞翷冁䎖瀔瀍瀌襜䴙𬙊嚭㰀鬷醭蹯蠋翾鳘儳儴鼗𬶭𩾌鳚鳛麑麖蠃彟嬿鬒蘘欂醵颥甗𨟠巇酅髎犨𬶮𨭉㸌爔瀱瀹瀼瀵襫孅骦𬙋耰𤫉瓖鬘趯𬺓罍鼱鳠鳡鳣爟爚灈韂糵蘼礵鹴躔皭龢鳤亹籥鼷𫚭玃醾齇觿蠼" 26 | 27 | function setfromstr(str) 28 | local t = {} 29 | for p, c in utf8.codes(str) do 30 | t[utf8.char(c)] = true 31 | end 32 | return t 33 | end 34 | 35 | local charset = setfromstr(str) 36 | 37 | function issubset(candidate, charset) 38 | for el, _ in pairs(candidate) do 39 | if not charset[el] then 40 | return false 41 | end 42 | end 43 | return true 44 | end 45 | 46 | local function yuhao_sc_first(input, env) 47 | local b = env.engine.context:get_option("yuhao_sc_first") 48 | local l = {} 49 | local length_of_input = string.len(env.engine.context.input) 50 | for cand in input:iter() do 51 | local candidate = setfromstr(cand.text) 52 | if (not b or issubset(candidate, charset) or (length_of_input < 4)) then 53 | yield(cand) 54 | else 55 | table.insert(l, cand) 56 | end 57 | end 58 | -- 非常用字词后置 59 | for i, cand in ipairs(l) do 60 | yield(cand) 61 | end 62 | end 63 | 64 | return yuhao_sc_first -------------------------------------------------------------------------------- /yujoy/beta/schema/yujoy_tw.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yujoy_tw 6 | name: 卿雲·臺標簡碼 7 | version: 20231001 8 | author: 9 | - 項目策劃 錢多多 10 | - 技术支持 forFudan 11 | - Rime方案 12 | - 官方QQ群 374630778 13 | description: | 14 | 卿雲輸入法,繁簡通打,以臺灣標準字形爲主設置簡碼。 15 | dependencies: 16 | - yuhao_pinyin 17 | - yujoy_chaifen_tw 18 | 19 | switches: 20 | - options: 21 | - original 22 | - yuhao_charset_prioritizer_common 23 | states: [原始排序, 常用字優先] 24 | reset: 1 25 | # Control+Shift+M 26 | - options: 27 | - cjk 28 | - yuhao_charset_filter_common 29 | states: [全漢字, 常用字] 30 | reset: 0 31 | # Control+Shift+O 32 | - name: yuhao_single_char_only_for_full_code 33 | states: ["字詞同出", "全碼出單"] 34 | reset: 0 35 | # Control+Shift+D 36 | - name: yuhao_postpone_full_code 37 | reset: 0 38 | states: [原始排序, 全碼後置] 39 | # Control+Shift+H 40 | - options: 41 | - yuhao_chaifen.off 42 | - yuhao_chaifen.lv2 43 | - yuhao_chaifen.lv3 44 | states: [隱藏注解, 二重注解, 多重註解] 45 | reset: 0 46 | - name: yuhao_autocompletion_filter 47 | reset: 0 48 | states: [輸入預測, 精確匹配] 49 | # Control+Shift+Y 50 | - name: traditionalization 51 | states: [简保持, 简转繁] 52 | reset: 0 53 | # Control+Shift+F 54 | - name: simplification 55 | states: [繁保持, 繁轉簡] 56 | reset: 0 57 | # Control+Shift+J 58 | - name: ascii_mode 59 | states: [中文, 西文] 60 | reset: 0 61 | - name: full_shape 62 | states: ["半角", "全角"] 63 | reset: 0 64 | - name: ascii_punct 65 | states: [。,, .,] 66 | reset: 0 67 | 68 | engine: 69 | processors: 70 | - lua_processor@*yuhao.yuhao_switch_proc@yuhao_macro 71 | - ascii_composer 72 | - recognizer 73 | - key_binder 74 | - speller 75 | - punctuator 76 | - selector 77 | - navigator 78 | - express_editor 79 | segmentors: 80 | - ascii_segmentor 81 | - matcher 82 | - affix_segmentor@zaoci # 用户造詞 83 | - abc_segmentor 84 | - punct_segmentor 85 | - fallback_segmentor 86 | translators: 87 | - punct_translator 88 | - history_translator@history 89 | - reverse_lookup_translator 90 | - table_translator@fixed # 固定字頻 91 | - table_translator 92 | - table_translator@zaoci # 用户造詞 93 | - lua_translator@*yuhao.yuhao_switch_tr@yuhao_macro # 控制臺 94 | filters: 95 | - lua_filter@*yuhao.yuhao_autocompletion_filter 96 | - lua_filter@*yuhao.yuhao_single_char_only_for_full_code 97 | - lua_filter@*yuhao.yuhao_charset_filter_common 98 | - lua_filter@*yuhao.yuhao_charset_filter_tonggui 99 | - lua_filter@*yuhao.yuhao_charset_filter_harmonic 100 | - simplifier@traditionalize 101 | - simplifier@simplify 102 | - lua_filter@*yuhao.yuhao_chaifen_filter 103 | - lua_filter@*yuhao.yuhao_postpone_full_code 104 | - lua_filter@*yuhao.yuhao_charset_prioritizer_common 105 | - uniquifier 106 | 107 | traditionalize: 108 | tags: [abc, reverse_lookup] 109 | option_name: traditionalization 110 | opencc_config: s2t.json 111 | tips: all 112 | comment_format: 113 | - xform/^/〔/ 114 | - xform/$/〕/ 115 | 116 | simplify: 117 | tags: [abc, reverse_lookup] 118 | option_name: simplification 119 | opencc_config: t2s.json 120 | tips: all 121 | comment_format: 122 | - xform/^/〔/ 123 | - xform/$/〕/ 124 | 125 | yuhao_postpone_full_code: 126 | ## 以下列出之漢字,出簡後,於全碼後置之.用户可自定義. 127 | ## 需要全碼後置的漢字列表,缺省時默認後置所有. 128 | # selected_chars: "束員员冻近寒凍准" 129 | tags: [abc] 130 | lua: 131 | max_index: 3 # 最大後置位置,默認爲 3 132 | 133 | schema_name: 134 | code: yujoy_tw 135 | chaifen: yujoy_chaifen_tw 136 | 137 | speller: 138 | alphabet: abcdefghijklmnopqrstuvwxyz/ 139 | initials: abcdefghijklmnopqrstuvwxyz/ 140 | delimiter: "`" 141 | max_code_length: 4 142 | auto_select: false 143 | algebra: 144 | 145 | translator: 146 | dictionary: yujoy_tw 147 | prism: yujoy_tw 148 | db_class: tabledb 149 | enable_completion: true 150 | enable_sentence: false 151 | enable_user_dict: true 152 | enable_encoder: true 153 | encode_commit_history: false # 对连续上屏的词自动成词 154 | max_phrase_length: 4 # 自动成词的最大词长 155 | preedit_format: [] 156 | comment_format: 157 | - "xform/^~/ /" 158 | disable_user_dict_for_patterns: 159 | - "^z.*$" 160 | 161 | zaoci: 162 | __include: translator 163 | initial_quality: 0 164 | enable_sentence: true 165 | enable_user_dict: true 166 | prefix: "`" 167 | tips: "〔用户造詞〕" 168 | tag: zaoci 169 | 170 | # 固定词库词的权重,防止自动调频 171 | fixed: 172 | __include: translator 173 | enable_sentence: false 174 | enable_user_dict: false 175 | initial_quality: 1000000 176 | 177 | history: 178 | input: z 179 | size: 1 180 | initial_quality: 1 181 | 182 | reverse_lookup: 183 | dictionary: yuhao_pinyin 184 | prefix: "z" 185 | tips: 〔全拼簡拼輸入〕 186 | closing_tips: 〔全拼簡拼輸入關閉〕 187 | preedit_format: 188 | - xform/([nl])v/$1ü/ 189 | - xform/([nl])ue/$1üe/ 190 | - xform/([jqxy])v/$1u/ 191 | 192 | # 自定義宏 193 | yuhao_macro: 194 | funckeys: 195 | macro: [0x2f] # 當輸入串以 "/" 開頭時, 認爲是宏調用 196 | macros: 197 | help: 198 | # - { type: tip, name: ❖配置中心 } 199 | - { type: switch, name: traditionalization, states: [☐简保持, ☑简转繁] } 200 | - { type: switch, name: simplification, states: [☐繁保持, ☑繁轉簡] } 201 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 202 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 203 | set: 204 | # - { type: tip, name: ❖配置中心 } 205 | - { type: switch, name: traditionalization, states: [☐简保持, ☑简转繁] } 206 | - { type: switch, name: simplification, states: [☐繁保持, ☑繁轉簡] } 207 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 208 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 209 | date: 210 | - { type: eval, name: ☀日期, expr: return os.date("%Y-%m-%d") } 211 | - { type: eval, name: ⛅年月日, expr: return os.date("%Y年%m月%d日") } 212 | time: 213 | - { type: eval, name: ⌚時間, expr: return os.date("%H:%M:%S") } 214 | - { type: eval, name: Ⓣ時間, expr: return os.date("%Y%m%d%H%M") } 215 | - { type: eval, name: Ⓢ時間戳, expr: return tostring(os.time()) } 216 | char: 217 | - { 218 | type: switch, 219 | name: yuhao_single_char_only_for_full_code, 220 | states: [☐字詞, ☑純單], 221 | } 222 | div: 223 | - { 224 | type: radio, 225 | names: 226 | [ 227 | yuhao_chaifen.off, 228 | yuhao_chaifen.lv1, 229 | yuhao_chaifen.lv2, 230 | yuhao_chaifen.lv3, 231 | ], 232 | states: [☐☐☐註解, ☑☐☐註解, ☐☑☐註解, ☐☐☑註解], 233 | } 234 | cjk: 235 | - { 236 | type: radio, 237 | names: 238 | [ 239 | cjk, 240 | yuhao_charset_prioritizer, 241 | yuhao_charset_filter_common, 242 | yuhao_charset_filter_tonggui, 243 | yuhao_charset_filter_harmonic, 244 | ], 245 | states: [☐☐☐全漢字, ☐☐☑常用字前置, ☐☑☐常用字, ☐☑☑通规字, ☑☐☐陸標繁], 246 | } 247 | trad: 248 | - { type: switch, name: traditionalization, states: [☐不轉換, ☑簡轉繁] } 249 | simp: 250 | - { type: switch, name: simplification, states: [☐不轉換, ☑繁轉簡] } 251 | full: 252 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 253 | half: 254 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 255 | punc: 256 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 257 | dot: 258 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 259 | dist: 260 | - type: eval 261 | expr: > 262 | return function(args) 263 | return string.format("librime: [%s]", rime_api.get_rime_version()) 264 | end 265 | - type: eval 266 | expr: > 267 | return function(args) 268 | return string.format("distribution: [%s](%s/%s)", 269 | rime_api.get_distribution_name(), 270 | rime_api.get_distribution_code_name(), 271 | rime_api.get_distribution_version()) 272 | end 273 | uni: 274 | - type: eval 275 | hijack: true 276 | expr: return require("yuhao.yuhao_core").unicode() 277 | w: 278 | - type: eval 279 | hijack: true 280 | expr: return require("yuhao.yuhao_core").unicode() 281 | 282 | punctuator: 283 | import_preset: symbols 284 | half_shape: 285 | "`": "`" 286 | "#": "#" 287 | "%": "%" 288 | "*": "*" 289 | "\\": "、" 290 | "[": "「" 291 | "]": "」" 292 | "{": "『" 293 | "}": "』" 294 | "/": "/" 295 | "|": "|" 296 | 297 | key_binder: 298 | bindings: 299 | - { when: always, accept: "Control+period", toggle: ascii_punct } 300 | - { when: always, accept: "Control+Shift+period", toggle: ascii_punct } 301 | - { when: always, accept: "Control+Shift+J", toggle: simplification } 302 | - { when: always, accept: "Control+Shift+F", toggle: traditionalization } 303 | - { 304 | when: always, 305 | accept: "Control+Shift+M", 306 | toggle: yuhao_charset_prioritizer_common, 307 | } # 常用字優先 308 | - { 309 | when: always, 310 | accept: "Control+Shift+O", 311 | toggle: yuhao_charset_filter_common, 312 | } # 常用詞過濾 313 | - { when: has_menu, accept: "0", toggle: yuhao_charset_filter_common } # 常用詞過濾 314 | - { when: has_menu, accept: "/", toggle: yuhao_chaifen.off } # 拆分 315 | - { 316 | when: always, 317 | accept: "Control+Shift+D", 318 | toggle: yuhao_single_char_only_for_full_code, 319 | } # 全码出单 320 | - { 321 | when: always, 322 | accept: "Control+Shift+H", 323 | toggle: yuhao_postpone_full_code, 324 | } # 全碼後置 325 | - { 326 | when: always, 327 | accept: "Control+Shift+Y", 328 | toggle: yuhao_autocompletion_filter, 329 | } # 輸入預測 330 | - { when: has_menu, accept: semicolon, send: 2 } # 分号次选 331 | - { when: has_menu, accept: apostrophe, send: 3 } # 引号三选 332 | - { when: has_menu, accept: Tab, send: 2 } # 製表符次选 333 | - { when: has_menu, accept: minus, send: Page_Up } # 減號上翻頁 334 | - { when: has_menu, accept: equal, send: Page_Down } # 等號下翻頁 335 | 336 | recognizer: 337 | import_preset: default 338 | patterns: 339 | uppercase: "^(?![`;]).*[A-Z][-_+.'0-9A-Za-z]*$" 340 | reverse_lookup: "^z([a-z]+?)*$" 341 | zaoci: "^[a-z]*`[a-z`]*$" 342 | punct: "^/([0-9]0?|[A-Za-z]+)?$" 343 | # number: "^[-+]?[0-9][,.:0-9]*[%]?$" 344 | -------------------------------------------------------------------------------- /yustar/beta/schema/yustar_sc.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema settings 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yustar_sc 6 | name: 星陈·陆标简码 7 | version: 20231001 8 | author: 9 | - 發明人 朱宇浩 10 | - Rime方案 11 | - 官方QQ群 735728797 12 | description: | 13 | 星陳輸入法,繁简通打,以简化汉字为主设置简码。 14 | dependencies: 15 | - yuhao_pinyin 16 | - yustar_chaifen 17 | 18 | switches: 19 | - options: 20 | - original 21 | - yuhao_charset_prioritizer_common 22 | - yuhao_charset_prioritizer_tonggui 23 | states: [原始排序, 常用字先, 簡化字先] 24 | reset: 1 25 | # Control+Shift+M 26 | - options: 27 | - cjk 28 | - yuhao_charset_filter_common 29 | - yuhao_charset_filter_tonggui 30 | states: [全漢字, 常用字, 簡化字] 31 | reset: 0 32 | # Control+Shift+O 33 | - name: yuhao_single_char_only_for_full_code 34 | states: ["字詞同出", "全碼出單"] 35 | reset: 0 36 | # Control+Shift+D 37 | - name: yuhao_postpone_full_code 38 | reset: 0 39 | states: [原始排序, 全碼後置] 40 | # Control+Shift+H 41 | - options: 42 | - yuhao_chaifen.off 43 | - yuhao_chaifen.lv2 44 | - yuhao_chaifen.lv3 45 | states: [隱藏注解, 二重注解, 多重註解] 46 | reset: 0 47 | - name: yuhao_autocompletion_filter 48 | reset: 0 49 | states: [輸入預測, 精確匹配] 50 | # Control+Shift+Y 51 | - name: traditionalization 52 | states: [简保持, 简转繁] 53 | reset: 0 54 | # Control+Shift+F 55 | - name: simplification 56 | states: [繁保持, 繁轉簡] 57 | reset: 0 58 | # Control+Shift+J 59 | - name: ascii_mode 60 | states: [中文, 西文] 61 | reset: 0 62 | - name: full_shape 63 | states: ["半角", "全角"] 64 | reset: 0 65 | # Shift + Space 66 | - name: ascii_punct 67 | states: [。,, .,] 68 | reset: 0 69 | 70 | engine: 71 | processors: 72 | - lua_processor@*yuhao.yuhao_switch_proc@yuhao_macro 73 | - ascii_composer 74 | - recognizer 75 | - key_binder 76 | - speller 77 | - punctuator 78 | - selector 79 | - navigator 80 | - express_editor 81 | segmentors: 82 | - ascii_segmentor 83 | - matcher 84 | - affix_segmentor@zaoci # 用户造詞 85 | - abc_segmentor 86 | - punct_segmentor 87 | - fallback_segmentor 88 | translators: 89 | - punct_translator 90 | - history_translator@history 91 | - reverse_lookup_translator 92 | - table_translator@fixed # 固定字頻 93 | - table_translator 94 | - table_translator@zaoci # 用户造詞 95 | - lua_translator@*yuhao.yuhao_switch_tr@yuhao_macro # 控制臺 96 | filters: 97 | - lua_filter@*yuhao.yuhao_autocompletion_filter 98 | - lua_filter@*yuhao.yuhao_single_char_only_for_full_code 99 | - lua_filter@*yuhao.yuhao_charset_filter_common 100 | - lua_filter@*yuhao.yuhao_charset_filter_tonggui 101 | - lua_filter@*yuhao.yuhao_charset_filter_harmonic 102 | - simplifier@traditionalize 103 | - simplifier@simplify 104 | - lua_filter@*yuhao.yuhao_chaifen_filter 105 | - lua_filter@*yuhao.yuhao_postpone_full_code 106 | - lua_filter@*yuhao.yuhao_charset_prioritizer_common 107 | - lua_filter@*yuhao.yuhao_charset_prioritizer_tonggui 108 | - uniquifier 109 | 110 | traditionalize: 111 | tags: [abc, reverse_lookup] 112 | option_name: traditionalization 113 | opencc_config: s2t.json 114 | tips: all 115 | comment_format: 116 | - xform/^/〔/ 117 | - xform/$/〕/ 118 | 119 | simplify: 120 | tags: [abc, reverse_lookup] 121 | option_name: simplification 122 | opencc_config: t2s.json 123 | tips: all 124 | comment_format: 125 | - xform/^/〔/ 126 | - xform/$/〕/ 127 | 128 | yuhao_postpone_full_code: 129 | tags: [abc] 130 | selected_chars: "束嫌存猪炸暑睹睛只另乘津糊袍饱書諸后掏眨壓緒" # 後置漢字 131 | lua: 132 | max_index: 3 # 最大後置位置,默認爲 3 133 | 134 | schema_name: 135 | code: yustar_sc 136 | chaifen: yustar_chaifen 137 | 138 | speller: 139 | alphabet: abcdefghijklmnopqrstuvwxyz/ 140 | initials: abcdefghijklmnopqrstuvwxyz/ 141 | delimiter: "`" 142 | max_code_length: 4 143 | auto_select: false 144 | algebra: 145 | 146 | translator: 147 | dictionary: yustar_sc 148 | prism: yustar_sc 149 | db_class: tabledb 150 | enable_completion: true 151 | enable_sentence: false 152 | enable_user_dict: true 153 | enable_encoder: true 154 | encode_commit_history: false # 对连续上屏的词自动成词 155 | max_phrase_length: 4 # 自动成词的最大词长 156 | preedit_format: [] 157 | comment_format: 158 | - "xform/^~/ /" 159 | disable_user_dict_for_patterns: 160 | - "^z.*$" 161 | 162 | zaoci: 163 | __include: translator 164 | initial_quality: 0 165 | enable_sentence: true 166 | enable_user_dict: true 167 | prefix: "`" 168 | tips: "〔用户造詞〕" 169 | tag: zaoci 170 | 171 | # 固定词库词的权重,防止自动调频 172 | fixed: 173 | __include: translator 174 | enable_sentence: false 175 | enable_user_dict: false 176 | initial_quality: 1000000 177 | 178 | history: 179 | input: z 180 | size: 1 181 | initial_quality: 1 182 | 183 | reverse_lookup: 184 | dictionary: yuhao_pinyin 185 | prefix: "z" 186 | tips: 〔全拼簡拼輸入〕 187 | closing_tips: 〔全拼簡拼輸入關閉〕 188 | preedit_format: 189 | - xform/([nl])v/$1ü/ 190 | - xform/([nl])ue/$1üe/ 191 | - xform/([jqxy])v/$1u/ 192 | 193 | # 自定義宏 194 | yuhao_macro: 195 | funckeys: 196 | macro: [0x2f] # 當輸入串以 "/" 開頭時, 認爲是宏調用 197 | macros: 198 | help: 199 | # - { type: tip, name: ❖配置中心 } 200 | - { type: switch, name: traditionalization, states: [☐简保持, ☑简转繁] } 201 | - { type: switch, name: simplification, states: [☐繁保持, ☑繁轉簡] } 202 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 203 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 204 | set: 205 | # - { type: tip, name: ❖配置中心 } 206 | - { type: switch, name: traditionalization, states: [☐简保持, ☑简转繁] } 207 | - { type: switch, name: simplification, states: [☐繁保持, ☑繁轉簡] } 208 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 209 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 210 | date: 211 | - { type: eval, name: ☀日期, expr: return os.date("%Y-%m-%d") } 212 | - { type: eval, name: ⛅年月日, expr: return os.date("%Y年%m月%d日") } 213 | time: 214 | - { type: eval, name: ⌚時間, expr: return os.date("%H:%M:%S") } 215 | - { type: eval, name: Ⓣ時間, expr: return os.date("%Y%m%d%H%M") } 216 | - { type: eval, name: Ⓢ時間戳, expr: return tostring(os.time()) } 217 | char: 218 | - { 219 | type: switch, 220 | name: yuhao_single_char_only_for_full_code, 221 | states: [☐字詞, ☑純單], 222 | } 223 | div: 224 | - { 225 | type: radio, 226 | names: 227 | [ 228 | yuhao_chaifen.off, 229 | yuhao_chaifen.lv2, 230 | yuhao_chaifen.lv3, 231 | ], 232 | states: [☐☐☐註解, ☐☑☐註解, ☑☑☑註解], 233 | } 234 | cjk: 235 | - { 236 | type: radio, 237 | names: 238 | [ 239 | cjk, 240 | yuhao_charset_prioritizer, 241 | yuhao_charset_filter_common, 242 | yuhao_charset_filter_tonggui, 243 | yuhao_charset_filter_harmonic, 244 | ], 245 | states: [☐☐☐全漢字, ☐☐☑常用字前置, ☐☑☐常用字, ☐☑☑通规字, ☑☐☐陸標繁], 246 | } 247 | trad: 248 | - { type: switch, name: traditionalization, states: [☐不轉換, ☑簡轉繁] } 249 | simp: 250 | - { type: switch, name: simplification, states: [☐不轉換, ☑繁轉簡] } 251 | full: 252 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 253 | half: 254 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 255 | punc: 256 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 257 | dot: 258 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 259 | dist: 260 | - type: eval 261 | expr: > 262 | return function(args) 263 | return string.format("librime: [%s]", rime_api.get_rime_version()) 264 | end 265 | - type: eval 266 | expr: > 267 | return function(args) 268 | return string.format("distribution: [%s](%s/%s)", 269 | rime_api.get_distribution_name(), 270 | rime_api.get_distribution_code_name(), 271 | rime_api.get_distribution_version()) 272 | end 273 | uni: 274 | - type: eval 275 | hijack: true 276 | expr: return require("yuhao.yuhao_core").unicode() 277 | w: 278 | - type: eval 279 | hijack: true 280 | expr: return require("yuhao.yuhao_core").unicode() 281 | 282 | punctuator: 283 | import_preset: symbols 284 | half_shape: 285 | "`": "`" 286 | "#": "#" 287 | "%": "%" 288 | "*": "*" 289 | "\\": "、" 290 | "[": "「" 291 | "]": "」" 292 | "{": "『" 293 | "}": "』" 294 | "/": "/" 295 | "|": "|" 296 | 297 | key_binder: 298 | bindings: 299 | - { when: always, accept: "Control+period", toggle: ascii_punct } 300 | - { when: always, accept: "Control+Shift+period", toggle: ascii_punct } 301 | - { when: always, accept: "Control+Shift+J", toggle: simplification } 302 | - { when: always, accept: "Control+Shift+F", toggle: traditionalization } 303 | - { 304 | when: always, 305 | accept: "Control+Shift+M", 306 | toggle: yuhao_charset_prioritizer_common, 307 | } # 常用字優先 308 | - { 309 | when: always, 310 | accept: "Control+Shift+O", 311 | toggle: yuhao_charset_filter_common, 312 | } # 常用詞過濾 313 | - { when: has_menu, accept: "0", toggle: yuhao_charset_filter_common } # 常用詞過濾 314 | - { when: has_menu, accept: "/", toggle: yuhao_chaifen.off } # 拆分 315 | - { 316 | when: always, 317 | accept: "Control+Shift+D", 318 | toggle: yuhao_single_char_only_for_full_code, 319 | } # 全码出单 320 | - { 321 | when: always, 322 | accept: "Control+Shift+H", 323 | toggle: yuhao_postpone_full_code, 324 | } # 全碼後置 325 | - { 326 | when: always, 327 | accept: "Control+Shift+Y", 328 | toggle: yuhao_autocompletion_filter, 329 | } # 輸入預測 330 | - { when: has_menu, accept: semicolon, send: 2 } # 分号次选 331 | - { when: has_menu, accept: apostrophe, send: 3 } # 引号三选 332 | - { when: has_menu, accept: Tab, send: 2 } # 製表符次选 333 | - { when: has_menu, accept: minus, send: Page_Up } # 減號上翻頁 334 | - { when: has_menu, accept: equal, send: Page_Down } # 等號下翻頁 335 | 336 | recognizer: 337 | import_preset: default 338 | patterns: 339 | uppercase: "^(?![`;]).*[A-Z][-_+.'0-9A-Za-z]*$" 340 | reverse_lookup: "^z([a-z]+?)*$" 341 | zaoci: "^[a-y]*`[a-y`]*$" 342 | punct: "^/([0-9]0?|[A-Za-z]+)?$" 343 | # number: "^[-+]?[0-9][,.:0-9]*[%]?$" 344 | -------------------------------------------------------------------------------- /yujoy/beta/schema/yujoy_fluency.schema.yaml: -------------------------------------------------------------------------------- 1 | # Rime schema 2 | # encoding: utf-8 3 | 4 | schema: 5 | schema_id: yujoy_fluency 6 | name: 卿雲·全碼連打 7 | version: 20240512 8 | author: 9 | - 項目策劃 錢多多 10 | - 技术支持 forFudan 11 | - Rime方案 12 | - 官方QQ群 374630778 13 | description: | 14 | 全碼單字無空格連續輸入模式. 15 | - 因爲只輸入全碼單字,不需要額外記憶簡碼和詞語. 16 | - 不需要在三碼和四碼後猶豫是否要加空格. 17 | - 大拇指的負擔顯著降低. 18 | - 速度當降低,達到了1.2584. 19 | - 準確性方面,本模式選重率低於打詞,但高於簡碼單字派. 20 | - 本模式不會出現打簡碼或打詞時的踩空回删現象. 21 | - 本模式允許用户在最短時間内以最小成本實現雙盲打. 22 | - 因爲單字全碼輸入的原故,其準確性很高,出現重碼時也可以通過語句去重. 23 | - 四碼及以下,固定字頻詞頻,允許簡碼字詞,以兼容四碼定長習慣,保證確定性. 24 | - 碼長大約在 3.2 左右,略高於簡體優先簡碼派的 3.15. 25 | 低於繁簡通打簡碼派的 3.25. 高於詞派的 2.5 左右. 26 | 27 | dependencies: 28 | - yujoy 29 | - yujoy_full 30 | - yujoy_chaifen 31 | - yuhao_pinyin 32 | 33 | switches: 34 | - options: 35 | - yuhao_chaifen.off 36 | - yuhao_chaifen.lv2 37 | - yuhao_chaifen.lv3 38 | states: [隱藏注解, 二重注解, 多重註解] 39 | reset: 0 40 | - options: 41 | - cjk 42 | - yuhao_charset_filter_common 43 | - yuhao_charset_filter_tonggui 44 | - yuhao_charset_filter_harmonic 45 | states: [全漢字, 常用字, 通规字, 陸標繁] 46 | reset: 0 47 | # Control+Shfit+O 48 | - name: traditionalization 49 | states: [简保持, 简转繁] 50 | reset: 0 51 | # Control+Shift+F 52 | - name: simplification 53 | states: [繁保持, 繁轉簡] 54 | reset: 0 55 | # Control+Shift+J 56 | - name: yuhao_autocompletion_filter 57 | reset: 0 58 | states: [輸入預測, 精確匹配] 59 | # Control+Shift+Y 60 | - name: ascii_mode 61 | reset: 0 62 | states: [中文, 西文] 63 | - name: full_shape 64 | states: [半角, 全角] 65 | - name: ascii_punct 66 | states: [。,, .,] 67 | reset: 0 68 | 69 | engine: 70 | processors: 71 | - lua_processor@*yuhao.yuhao_switch_proc@yuhao_macro 72 | - ascii_composer 73 | - recognizer 74 | - lua_processor@*yuhao.yuhao_chaifen_processor 75 | - key_binder 76 | - lua_processor@*yuhao.yuhao_auto_select_in_fluency_mode 77 | - speller 78 | - punctuator 79 | - selector 80 | - navigator 81 | - express_editor 82 | segmentors: 83 | - ascii_segmentor 84 | - matcher 85 | - abc_segmentor 86 | - punct_segmentor 87 | - fallback_segmentor 88 | translators: 89 | - punct_translator 90 | ########## 91 | # 翻譯器 # 92 | ########## 93 | # 四碼及以下,固定字頻詞頻,以兼容四碼定長習慣,保證確定性. 94 | # 直接使用四碼定長字典. 95 | - table_translator@yujoy 96 | # 97 | # 全拼的模式,對非預設短語和用户習語進行自動調頻. 98 | # 由於分割編碼時不穩定,常有生僻字跳出,故而只對常用字進行成句. 99 | # 只對常用字進行成句,會使某些專有名詞不出現,可通過碼表翻譯器解決. 100 | - script_translator 101 | - script_translator@translator_extended 102 | # 103 | # 全拼輸入. 104 | - script_translator@pinyin 105 | # 106 | # 四碼以上,固定詞頻的連續輸入.允許聯想長詞以快速上屏. 107 | # 直接使用全碼單字字典,允許成句.分割編碼時,極少出現生僻字. 108 | # 對於排在第二項的兩碼字根不會成句,如[上巳],可通過編碼翻譯器解決. 109 | # 未完全匹配,則會出現字母串不斷閃出,影響視覺體驗,可通過編碼翻譯器解決. 110 | - table_translator@yujoy_full 111 | # 112 | - lua_translator@*yuhao.yuhao_switch_tr@yuhao_macro 113 | filters: 114 | - lua_filter@*yuhao.yuhao_autocompletion_filter 115 | - lua_filter@*yuhao.yuhao_charset_filter_common 116 | - lua_filter@*yuhao.yuhao_charset_filter_tonggui 117 | - lua_filter@*yuhao.yuhao_charset_filter_harmonic 118 | - simplifier@traditionalize 119 | - simplifier@simplify 120 | - lua_filter@*yuhao.yuhao_chaifen_filter 121 | - uniquifier 122 | 123 | yuhao_auto_select_in_fluency_mode: 124 | max_chars: 8 125 | 126 | traditionalize: 127 | tags: [abc] 128 | option_name: traditionalization 129 | opencc_config: s2t.json 130 | tips: all 131 | comment_format: 132 | - xform/^/〔/ 133 | - xform/$/〕/ 134 | 135 | simplify: 136 | tags: [abc] 137 | option_name: simplification 138 | opencc_config: t2s.json 139 | tips: all 140 | comment_format: 141 | - xform/^/〔/ 142 | - xform/$/〕/ 143 | 144 | schema_name: 145 | code: yujoy 146 | chaifen: yujoy_chaifen 147 | 148 | yuhao_chaifen: 149 | lua: 150 | switch_key: "Control+c" 151 | cycle_key: "Shift+Control+C" 152 | 153 | speller: 154 | alphabet: zyxwvutsrqponmlkjihgfedcba 155 | initials: zyxwvutsrqponmlkjihgfedcba 156 | delimiter: " `" 157 | 158 | translator: 159 | dictionary: yujoy_fluency 160 | db_class: tabledb 161 | enable_completion: false 162 | initial_quality: 8 163 | # preedit_format: 164 | # - "xlit|abcdefghijklmnopqrstuvwxyz|木舌下又也一竹土小日口子火水上生石十田金人食女足月查|" 165 | 166 | translator_extended: 167 | dictionary: yujoy_full 168 | db_class: tabledb 169 | enable_completion: false 170 | initial_quality: 4 171 | # preedit_format: 172 | # - "xlit|abcdefghijklmnopqrstuvwxyz|木舌下又也一竹土小日口子火水上生石十田金人食女足月查|" 173 | 174 | yujoy: 175 | dictionary: yujoy 176 | db_class: tabledb 177 | enable_completion: false 178 | enable_sentence: false 179 | enable_user_dict: false 180 | enable_encoder: false 181 | encode_commit_history: false # 对连续上屏的词自动成词 182 | max_phrase_length: 4 # 自动成词的最大词长 183 | initial_quality: 16 184 | 185 | pinyin: 186 | dictionary: yuhao_pinyin 187 | enable_completion: false 188 | preedit_format: 189 | - xform/([nl])v/$1ü/ 190 | - xform/([nl])ue/$1üe/ 191 | - xform/([jqxy])v/$1u/ 192 | initial_quality: 2 193 | 194 | yujoy_full: 195 | dictionary: yujoy_full 196 | db_class: tabledb 197 | enable_completion: true 198 | enable_sentence: true 199 | enable_user_dict: false 200 | enable_encoder: false 201 | encode_commit_history: false # 对连续上屏的词自动成词 202 | max_phrase_length: 4 # 自动成词的最大词长 203 | initial_quality: 0 204 | 205 | punctuator: 206 | import_preset: symbols 207 | half_shape: 208 | "`": "`" 209 | "#": "#" 210 | "%": "%" 211 | "*": "*" 212 | "\\": "、" 213 | "[": "「" 214 | "]": "」" 215 | "{": "『" 216 | "}": "』" 217 | "/": "/" 218 | "|": "|" 219 | 220 | key_binder: 221 | bindings: 222 | - { when: always, accept: "Control+period", toggle: ascii_punct } 223 | - { when: always, accept: "Control+Shift+period", toggle: ascii_punct } 224 | - { when: always, accept: "Control+Shift+J", toggle: simplification } 225 | - { when: always, accept: "Control+Shift+F", toggle: traditionalization } 226 | - { 227 | when: always, 228 | accept: "Control+Shift+O", 229 | toggle: yuhao_charset_filter_common, 230 | } # 字符集過濾 231 | - { when: has_menu, accept: "0", toggle: yuhao_charset_filter_common } # 字符集過濾 232 | - { when: has_menu, accept: "/", toggle: yuhao_chaifen.off } # 拆分 233 | - { 234 | when: always, 235 | accept: "Control+Shift+Y", 236 | toggle: yuhao_autocompletion_filter, 237 | } # 輸入預測 238 | - { when: has_menu, accept: semicolon, send: 2 } # 分号次选 239 | - { when: has_menu, accept: apostrophe, send: 3 } # 引号三选 240 | - { when: has_menu, accept: minus, send: Page_Up } # 減號上翻頁 241 | - { when: has_menu, accept: equal, send: Page_Down } # 等號下翻頁 242 | - { when: has_menu, accept: Tab, send: Escape } # Tab 下翻頁 243 | - { when: composing, accept: Escape, send: "Shift+BackSpace" } # 逐字删除 244 | 245 | recognizer: 246 | import_preset: default 247 | patterns: 248 | uppercase: "^(?![`;]).*[A-Z][-_+.'0-9A-Za-z]*$" 249 | punct: "^/([0-9]0?|[A-Za-z]+)?$" 250 | number: "^[-+]?[0-9][,.:0-9]*[%]?$" 251 | macro_unicode: "^/uni(/[a-zA-Z0-9]*)*$" 252 | 253 | style: 254 | horizontal: false 255 | inline_preedit: true 256 | preedit_type: preview 257 | inline_candidate: true 258 | 259 | # 自定義宏 260 | yuhao_macro: 261 | funckeys: 262 | macro: [0x2f] # 當輸入串以 "/" 開頭時, 認爲是宏調用 263 | macros: 264 | help: 265 | # - { type: tip, name: ❖配置中心 } 266 | - { type: switch, name: traditionalization, states: [☐简保持, ☑简转繁] } 267 | - { type: switch, name: simplification, states: [☐繁保持, ☑繁轉簡] } 268 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 269 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 270 | set: 271 | # - { type: tip, name: ❖配置中心 } 272 | - { type: switch, name: traditionalization, states: [☐简保持, ☑简转繁] } 273 | - { type: switch, name: simplification, states: [☐繁保持, ☑繁轉簡] } 274 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 275 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 276 | date: 277 | - { type: eval, name: ☀日期, expr: return os.date("%Y-%m-%d") } 278 | - { type: eval, name: ⛅年月日, expr: return os.date("%Y年%m月%d日") } 279 | time: 280 | - { type: eval, name: ⌚時間, expr: return os.date("%H:%M:%S") } 281 | - { type: eval, name: Ⓣ時間, expr: return os.date("%Y%m%d%H%M") } 282 | - { type: eval, name: Ⓢ時間戳, expr: return tostring(os.time()) } 283 | div: 284 | - { 285 | type: radio, 286 | names: 287 | [ 288 | yuhao_chaifen.off, 289 | yuhao_chaifen.lv1, 290 | yuhao_chaifen.lv2, 291 | yuhao_chaifen.lv3, 292 | ], 293 | states: [☐☐☐註解, ☑☐☐註解, ☐☑☐註解, ☐☐☑註解], 294 | } 295 | cjk: 296 | - { 297 | type: radio, 298 | names: 299 | [ 300 | utf8, 301 | yuhao_charset_filter_common, 302 | yuhao_charset_filter_tonggui, 303 | yuhao_charset_filter_harmonic, 304 | ], 305 | states: [☐☐全漢字, ☐☑常用字, ☑☐通规字, ☑☑陸標繁], 306 | } 307 | guji: 308 | - { 309 | type: switch, 310 | name: yuhao_charset_filter_harmonic, 311 | states: [☐未篩選, ☑陸標繁], 312 | } 313 | trad: 314 | - { type: switch, name: traditionalization, states: [☐不轉換, ☑簡轉繁] } 315 | simp: 316 | - { type: switch, name: simplification, states: [☐不轉換, ☑繁轉簡] } 317 | full: 318 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 319 | half: 320 | - { type: switch, name: full_shape, states: [☐半角, ☑全角] } 321 | punc: 322 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 323 | dot: 324 | - { type: switch, name: ascii_punct, states: [☐中文標點, ☑西文標點] } 325 | dist: 326 | - type: eval 327 | expr: > 328 | return function(args) 329 | return string.format("librime: [%s]", rime_api.get_rime_version()) 330 | end 331 | - type: eval 332 | expr: > 333 | return function(args) 334 | return string.format("distribution: [%s](%s/%s)", 335 | rime_api.get_distribution_name(), 336 | rime_api.get_distribution_code_name(), 337 | rime_api.get_distribution_version()) 338 | end 339 | uni: 340 | - type: eval 341 | hijack: true 342 | expr: return require("yuhao.yuhao_core").unicode() 343 | --------------------------------------------------------------------------------