【朙月拼音】模糊音定製模板
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ü/" |
总算是生效了,原来是格式问题。感谢!
小鹤双拼的模糊音用以下即可,不过 ang =>an、an => ang `太粗暴了,之后好好分析一下,不那么粗暴。
- derive/^([zcs])h/$1/ # zh, ch, sh => z, c, s
- derive/^([zcs])([^h])/$1h$2/ # z, c, s => zh, ch, sh
- derive/([aei])ng$/$1n/ # ang =>an, eng => en, ing => in
- derive/([aei])n$/$1ng/ # an => ang, en => eng, in => ing
在 double_pinyin_flypy.default.yaml
中添加:
...
"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/([aei])ng$/$1n/ # ang =>an, eng => en, ing => in
- derive/([aei])n$/$1ng/ # an => ang, en => eng, in => ing
- derive/^n/l/ # n => l
- derive/^l/n/ # l => n
...
后,双拼模糊音无法生效,且无法使用全拼打字,但是可以使用全拼(有点奇怪);
但是直接加在 double_pinyin_flypy.schema.yaml
中:
...
speller:
alphabet: zyxwvutsrqponmlkjihgfedcba
delimiter: " '"
algebra:
- erase/^xx$/
- derive/^([jqxy])u$/$1v/
- derive/^([aoe])([ioun])$/$1$1$2/
# 模糊音定義先於簡拼定義,方可令簡拼支持以上模糊音
- derive/^([zcs])h/$1/ # zh, ch, sh => z, c, s
- derive/^([zcs])([^h])/$1h$2/ # z, c, s => zh, ch, sh
- derive/([aei])ng$/$1n/ # ang =>an, eng => en, ing => in
- derive/([aei])n$/$1ng/ # an => ang, en => eng, in => ing
- derive/^n/l/ # n => l
- derive/^l/n/ # l => n
- xform/^([aoe])(ng)?$/$1$1$2/
...
则可以生效;
不知道有没有大佬帮忙看看或者解释下是什么原因。
感谢。
我的解决方案是新建立 用户文件夹下的luna_pinyin.custom.yaml文件,内容复制程序文件夹下的pinyin.yaml内容,全拼就可以用了
在
double_pinyin_flypy.default.yaml
中添加:... "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/([aei])ng$/$1n/ # ang =>an, eng => en, ing => in - derive/([aei])n$/$1ng/ # an => ang, en => eng, in => ing - derive/^n/l/ # n => l - derive/^l/n/ # l => n ...后,双拼模糊音无法生效,且无法使用全拼打字,但是可以使用全拼(有点奇怪);
但是直接加在
double_pinyin_flypy.schema.yaml
中:... speller: alphabet: zyxwvutsrqponmlkjihgfedcba delimiter: " '" algebra: - erase/^xx$/ - derive/^([jqxy])u$/$1v/ - derive/^([aoe])([ioun])$/$1$1$2/ # 模糊音定義先於簡拼定義,方可令簡拼支持以上模糊音 - derive/^([zcs])h/$1/ # zh, ch, sh => z, c, s - derive/^([zcs])([^h])/$1h$2/ # z, c, s => zh, ch, sh - derive/([aei])ng$/$1n/ # ang =>an, eng => en, ing => in - derive/([aei])n$/$1ng/ # an => ang, en => eng, in => ing - derive/^n/l/ # n => l - derive/^l/n/ # l => n - xform/^([aoe])(ng)?$/$1$1$2/ ...则可以生效;
不知道有没有大佬帮忙看看或者解释下是什么原因。
感谢。
我的解决方案是新建 用户文件夹下的luna_pinyin.custom.yaml文件,内容复制程序文件夹下的pinyin.yaml内容,全拼就可以用了。
双拼用你的解决方案,现在全拼和双拼都有模糊音了。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
不生效的朋友,可以注意下这个是yaml文件,需要注意的格式。减号前面需要缩进,而且不要使用tab按键。
我的修改如下:
patch:
'speller/algebra':
- erase/^xx$/
- abbrev/^([a-z]).+$/$1/
- abbrev/^([zcs]h).+$/$1/
- 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/([aei])n$/$1ng/ # en => eng, in => ing
- derive/([aei])ng$/$1n/ # eng => en, ing => in
- derive/([iu])an$/$1ang/ # ian => iang, uan => uang
- derive/([iu])ang$/$1an/ # iang => ian, uang => uan
- derive/^r/l/ # r => l
- derive/^l/r/ # l => r
简单的修改:- derive/([aei])n$/$1ng/ # en => eng, in => ing 方括号中的[aei]意思就是a、e、i与n的拼音组合是替换为ang。后面的$1意思就是前面需要替换的字符位置,这个不需要修改。不要看成小写的L了