Created
April 6, 2012 15:46
-
-
Save lotem/2320943 to your computer and use it in GitHub Desktop.
【朙月拼音】模糊音定製模板
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.custom.yaml | |
# | |
# 【朙月拼音】模糊音定製模板 | |
# 佛振配製 :-) | |
# | |
# 位置: | |
# ~/.config/ibus/rime (Linux) | |
# ~/Library/Rime (Mac OS) | |
# %APPDATA%\Rime (Windows) | |
# | |
# 於重新部署後生效 | |
# | |
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/^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ü/" |
请问比如我想打“切换”,输入qieh时自动会被断为qi‘eh,如何让一段组合(如“eh”)直接不生效呢。 不过这可能不是能以模糊音能解决的问题。
可以把拼音 eh
刪掉(用 erase
運算),他是拼音 ê
的替代拼寫形式。這個拼音的候選字只有「誒」和注音符號「ㄝ」。
也可以改寫成其他拼音,如發音相近的 ei
,拼寫運算代碼爲
speller:
algebra:
- xform/^eh$/ei/
可以把拼音
eh
刪掉(用erase
運算),他是拼音ê
的替代拼寫形式。這個拼音的候選字只有「誒」和注音符號「ㄝ」。也可以改寫成其他拼音,如發音相近的
ei
,拼寫運算代碼爲speller: algebra: - xform/^eh$/ei/
感谢回复,但我在输入你的代码和如下代码时均没有效果(eh仍会打出诶和ㄝ)
patch:
'speller/algebra':
- erase/^eh$/
#……
不知道是否是因为输入法内置的组合无法被删除,也可能是我写错了
一点改进
- derive/([ei])n$/$1ng/
- derive/([ei])ng$/$1n/
- derive/^([^aeiou]?h?)ang$/$1an/
- derive/^([^aeiou]?h?)an$/$1ang/
这样 ang 会替换为 an 但是 iang, uang 不会替换为 ian, uan,反之亦然
一点改进
- derive/([ei])n$/$1ng/ - derive/([ei])ng$/$1n/ - derive/^([^aeiou]?h?)ang$/$1an/ - derive/^([^aeiou]?h?)an$/$1ang/
这样 ang 会替换为 an 但是 iang, uang 不会替换为 ian, uan,反之亦然
基于你的,我又根据自己的情况修改了一点:
- derive/([ei])n$/$1ng/ - derive/([ei])ng$/$1n/ - derive/uan$/uang/ - derive/uang$/uan/ - derive/^([^aeiou]?h?)ang$/$1an/ - derive/^([^aeiou]?h?)an$/$1ang/
这样 uang 和 uan 也可以互相替换了,ian 和 iang 还是不会互相替换
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
请问比如我想打“切换”,输入qieh时自动会被断为qi‘eh,如何让一段组合(如“eh”)直接不生效呢。
不过这可能不是能以模糊音能解决的问题。