Files
DataBackup/Rime配置备份/sync/0a0da756-9655-42b1-b2e8-6c2cd6f22f62/luna_pinyin_simp.custom.yaml
CrazyJasonwell 97fbdf0277 first commit
2025-04-19 20:17:58 +08:00

174 lines
6.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
patch:
switches:
- name: ascii_mode # 0 中文,1 英文
reset: 0
states: [ "中文", "西文" ]
- name: full_shape # 全角/半角符号开关
states: [ "半角", "全角" ]
- name: show_emoji # Emoji 开关
reset: 1
states: [ "🈚️️\uFE0E", "🈶️️\uFE0F" ]
- name: zh_simp # (※1) 繁简转换
reset: 1
states: [ "漢字", "汉字" ]
- options: [ "utf8", "gbk", "gb2312" ] # (※2)字符集选单
reset: 0 # 默认 UTF8
states:
- UTF-8
- GBK
- GB2312
simplifier:
option_name: zh_simp
# 启用罕见字過濾
engine/filters:
- simplifier
- simplifier@emoji_conversion
- uniquifier
- charset_filter@gbk # (※3) GBK 过滤
- single_char_filter
emoji_conversion:
opencc_config: emoji.json
option_name: show_emoji
tags: abc
#tips: all # Emoji 显示注释
# 改写拼写运算,含英文的词汇(luna_pinyin.cn_en.dict.yaml)不影响简拼
"speller/algebra/@before 0": xform/^([b-df-hj-np-tv-z])$/$1_/
# 载入朙月拼音扩充词库
"translator/dictionary": luna_pinyin.extended
# 加载easy_en依赖
"schema/dependencies/@1": easy_en
# 载入翻译英文的码表翻译器,取名为 english
"engine/translators/@4": table_translator@english
# english翻译器的设定项
english:
dictionary: easy_en
enable_completion: false # 是否启用英文输入联想补全
enable_sentence: false # 混输时不出现带有图案的英文〔方案選單〕
initial_quality: -0.5 # 英文候选词的位置, 数值越大越靠前。
comment_format: # 自定义提示码
- xform/.*// # 清空提示码
# 快捷表情和符号
punctuator:
import_preset: symbols
symbols:
"/fs": [ ½, ‰, ¼, ⅓, ⅔, ¾, ⅒ ]
"/xh": [ *, ×, ✱, ★, ☆, ✩, ✧, ❋, ❊, ❉, ❈, ❅, ✿, ✲ ]
"/dq": [ 🌍, 🌎, 🌏, 🌐, 🌑, 🌒, 🌓, 🌔, 🌕, 🌖, 🌗, 🌘 ]
"/sg": [ 🍇, 🍉, 🍌, 🍍, 🍎, 🍏, 🍑, 🍒, 🍓, 🍗, 🍦, 🎂, 🍺, 🍻 ]
"/dw": [ 🙈, 🐵, 🐈, 🐷, 🐨, 🐼, 🐾, 🐔, 🐬, 🐠, 🦋 ]
"/bq": [ 😀, 😁, 😂, 😃, 😄, 😅, 😆, 😉, 😊, 😋, 😎, 😍, 😘, 😗 ]
"/ss": [ 💪, 👈, 👉, 👆, 👇, ✋, 👌, 👍, 👎, ✊, 👊, 👋, 👏, 👐 ]
half_shape:
"#": "#"
"*": "*"
"`": "`"
"~": "~"
"@": "@"
"=": "="
'\': "、"
"%": "%"
"$": [ "¥", "$" ]
"|": [ "|", "|", "·" ]
"/": [ "/", "÷" ]
"'": { pair: [ "「", "」" ] }
"[": "【"
"]": "】"
"<": "《"
">": "》"
recognizer/patterns/punct: "^/([a-z]+|[0-9]0?)$"
# 模糊拼音
"speller/algebra":
- erase/^xx$/ # 第一行保留
# 模糊音定義
# 需要哪組就刪去行首的 # 號,單雙向任選
#- derive/^([zcs])h/$1/ # zh, ch, sh => z, c, s
#- derive/^([zcs])([^h])/$1h$2/ # z, c, s => zh, ch, sh
#- derive/^n/l/ # n => l
#- derive/^l/n/ # l => n
# 這兩組一般是單向的
#- derive/^r/l/ # r => l
#- derive/^ren/yin/ # ren => yin, reng => ying
#- derive/^r/y/ # r => y
# 下面 hu <=> f 這組寫法複雜一些,分情況討論
#- derive/^hu$/fu/ # hu => fu
#- derive/^hong$/feng/ # hong => feng
#- derive/^hu([in])$/fe$1/ # hui => fei, hun => fen
#- derive/^hu([ao])/f$1/ # hua => fa, ...
#- derive/^fu$/hu/ # fu => hu
#- derive/^feng$/hong/ # feng => hong
#- derive/^fe([in])$/hu$1/ # fei => hui, fen => hun
#- derive/^f([ao])/hu$1/ # fa => hua, ...
# 韻母部份
#- derive/^([bpmf])eng$/$1ong/ # meng = mong, ...
#- derive/([ei])n$/$1ng/ # en => eng, in => ing
#- derive/([ei])ng$/$1n/ # eng => en, ing => in
# 樣例足夠了,其他請自己總結……
# 反模糊音?
# 誰說方言沒有普通話精確、有模糊音,就能有反模糊音。
# 示例爲分尖團的中原官話:
#- derive/^ji$/zii/ # 在設計者安排下鳩佔鵲巢,尖音i只好雙寫了
#- derive/^qi$/cii/
#- derive/^xi$/sii/
#- derive/^ji/zi/
#- derive/^qi/ci/
#- derive/^xi/si/
#- derive/^ju/zv/
#- derive/^qu/cv/
#- derive/^xu/sv/
# 韻母部份,只能從大面上覆蓋
#- derive/^([bpm])o$/$1eh/ # bo => beh, ...
#- derive/(^|[dtnlgkhzcs]h?)e$/$1eh/ # ge => geh, se => sheh, ...
#- derive/^([gkh])uo$/$1ue/ # guo => gue, ...
#- derive/^([gkh])e$/$1uo/ # he => huo, ...
#- derive/([uv])e$/$1o/ # jue => juo, lve => lvo, ...
#- derive/^fei$/fi/ # fei => fi
#- derive/^wei$/vi/ # wei => vi
#- derive/^([nl])ei$/$1ui/ # nei => nui, lei => lui
#- derive/^([nlzcs])un$/$1vn/ # lun => lvn, zun => zvn, ...
#- derive/^([nlzcs])ong$/$1iong/ # long => liong, song => siong, ...
# 這個辦法雖從拼寫上做出了區分,然而受詞典制約,候選字仍是混的。
# 只有真正的方音輸入方案纔能做到!但「反模糊音」這個玩法快速而有效!
# 模糊音定義先於簡拼定義,方可令簡拼支持以上模糊音
- abbrev/^([a-z]).+$/$1/ # 簡拼(首字母)
- abbrev/^([zcs]h).+$/$1/ # 簡拼(zh, ch, sh)
# 以下是一組容錯拼寫,《漢語拼音》方案以前者爲正
- derive/^([nl])ve$/$1ue/ # nve = nue, lve = lue
- derive/^([jqxy])u/$1v/ # ju = jv,
- derive/un$/uen/ # gun = guen,
- derive/ui$/uei/ # gui = guei,
- derive/iu$/iou/ # jiu = jiou,
# 自動糾正一些常見的按鍵錯誤
- derive/([aeiou])ng$/$1gn/ # dagn => dang
- derive/([dtngkhrzcs])o(u|ng)$/$1o/ # zho => zhong|zhou
- derive/ong$/on/ # zhonguo => zhong guo
- derive/ao$/oa/ # hoa => hao
- derive/([iu])a(o|ng?)$/a$1$2/ # tain => tian
# 分尖團後 v => ü 的改寫條件也要相應地擴充:
#'translator/preedit_format':
# - "xform/([nljqxyzcs])v/$1ü/"
# librime-lua 输入动态时间和日期
"engine/translators/@6": lua_translator@date_translator