Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【朙月拼音】模糊音定製模板
# 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ü/"
@gumuyueying

This comment has been minimized.

Copy link

gumuyueying commented Oct 19, 2013

感谢您开发的这么一款优秀的输入法软件。
我删除了模板第23、24行的行首 # 号,还是无法实现 l、n 的模糊音输入,但测试最后几行的按键纠错项是却是可以的。

@albertgh

This comment has been minimized.

Copy link

albertgh commented Dec 27, 2013

楼上的,用的是哪个方案?我用的简体,luna_pinyin_simp.schema.yaml 我在这个文件里 全是 derive 那里,下面粘了两行自己需要的,可以生效。

@gzjoekeny

This comment has been minimized.

Copy link

gzjoekeny commented Nov 3, 2014

我用简体方案,尝试了luna_pinyin_simp.custom和粘贴进luna_pinyin_simp.schema.yaml 。结果都失败

@hanabinoir

This comment has been minimized.

Copy link

hanabinoir commented Jun 21, 2015

能解釋一下 ^ 和 $ 的作用嗎?

@PackyXu

This comment has been minimized.

Copy link

PackyXu commented Jul 15, 2015

^和$的意思是:匹配以什么为开头和结尾

@doogod

This comment has been minimized.

Copy link

doogod commented Apr 3, 2016

那小鹤双拼该怎么办呢?我的'ou' 和 'uo' 一直分不清

@unknownzerx

This comment has been minimized.

Copy link

unknownzerx commented May 27, 2016

@qiongxuan 我用微软双拼,也是把东西放在'speller/algebra'下,但要放在所有xform之前。为了避免顺序问题我修改了原文件而不是.custom文件。

@7900ms

This comment has been minimized.

Copy link

7900ms commented Jul 6, 2016

注意,本文件 ( luna_pinyin.custom.yaml 或 luna_pinyin_simp.custom.yaml ) 如果有这个选项
“ enable_charset_filter: true #启用罕见字過濾 ”
这个选项会和模糊音的生效发生冲突。如果打算启用模糊音,可以考虑注释掉这句

@sasuke6

This comment has been minimized.

Copy link

sasuke6 commented Jan 13, 2017

将模糊拼音模板设置到双拼custom.yaml文件下,模糊拼音失效,而且不能正常输入文字,双拼方案下的模糊音该如何配置?

@Sherlock-Holo

This comment has been minimized.

Copy link

Sherlock-Holo commented Apr 25, 2017

咱明明打了补丁https://cfp.vim-cn.com/cbdg1/yaml ,也重启了fcitx,但是打zici并没有出现zhichi(支持),请问是什么问题?

@kopes18

This comment has been minimized.

Copy link

kopes18 commented Dec 10, 2017

小鹤双拼怎么办???????

@zyr517

This comment has been minimized.

Copy link

zyr517 commented Apr 9, 2018

小鹤模糊音配置的看这里

- 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/([ei])n$/$1ng/            # en => eng, in => ing
- derive/([ei])ng$/$1n/            # eng => en, ing => in

#下面其他的配置略过……

@maonx

This comment has been minimized.

Copy link

maonx commented Apr 26, 2018

@zyr517 謝謝,小鶴雙拼模糊音可以成功使用了,不過只能修改原文件,修改custom文件無效.

@YangMame

This comment has been minimized.

Copy link

YangMame commented Jul 30, 2018

请问修改之后 出现:
E0730 15:17:29.046954 16565 deployment_tasks.cc:328] invalid schema definition in 'luna_pinyin.custom.yaml'.
应该如何解决?
谢谢!

@yurivikyi

This comment has been minimized.

Copy link

yurivikyi commented Sep 8, 2018

關於ian/uan = iang/uang 的模糊音設置,建議管理員將此添加入模板中

    - derive/([iu])an$/$lang/          # ian => iang, uan => uang
    - derive/([iu])ang$/$lan/          # iang => ian, uang => uan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.