Last active
September 12, 2018 13:29
-
-
Save yxjxx/6205372 to your computer and use it in GitHub Desktop.
ibus-rime模糊音:新增文件 luna_pinyin_simp.custom.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# luna_pinyin_simp.custom.yaml | |
# | |
# 【朙月拼音】模糊音定製模板 | |
# 佛振配製 :-) | |
# Modify by yxjxx | |
# | |
# 位置: | |
# ~/.config/ibus/rime (Linux) | |
# ~/Library/Rime (Mac OS) | |
# %APPDATA%\Rime (Windows) | |
# | |
# 於重新部署後生效 | |
# 部署方法 | |
#$rm ~/.config/ibus/rime/default.yaml; ibus-daemon –drx | |
patch: | |
'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/^l/r/ # l => r | |
#- 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 ,Add at 2013/8/14 yxjxx | |
- derive/([aei])n$/$1ng/ #an => ang,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ü/" | |
###中文输入法下也使用英文标点2013/8/14 yxj | |
###有些用戶習慣在中文裏使用ASCII標點,那麼與其一個一個覆寫,不如 整套都換掉 。 | |
###取得這份設定檔—— Rime 別樣設定,使用西文標點(一个gist:https://gist.github.com/lotem/2334409) 在用戶資料夾保存爲 alternative.yaml ; | |
###再將輸入方案中的「導入 default 設定」通過打 patch 替換爲「導入 alternative 設定」 | |
###刚刚遇到一个问题,因为教程里面说需要这前两行,所以就直接粘贴了,但是发现模糊音失效了,找到原因是[只能有一个patch:,因为上面已经有了,所以就下面就不要了,注意缩进,两个英文空格] | |
###又加入了一行代码['key_binder/import_preset': alternative]作用是让[ ]可以翻页 | |
###patch: | |
##'punctuator/import_preset': alternative | |
##'key_binder/import_preset': alternative | |
###### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment