fcitx / libime

43 stars 21 forks source link

支持根据音节自定义双拼 #13

Closed azuwis closed 4 years ago

azuwis commented 4 years ago

尝试在 Fcitx5 中实现 C双拼 https://blog.csdn.net/dsscicin/article/details/80691080 ,发现似乎做不了。

C双拼中同一个音节可能会有多个不同的打法,其中文章里最后的“十一、附录一:双拼映射表”是推荐的打法,目的是尽可能的提高双手左右互击。

根据这个表格用 rime 可以实现 https://github.com/azuwis/.config_fcitx_rime/blob/master/double_pinyin_c.schema.yaml

请问 Fcitx5 是否可以做到类似的实现?

作为参考,下面是 C双拼在手心输入法中的配置,除了声母和韵母的影射外,还有一部分配置是根据音节来做影射的:

[Info]
name=C
version=2
[ShengMu]
q=q
w=w
r=r
t=t
y=y
ch=u|;
sh=i
p=p
s=s
d=d
f=f
g=g
h=h
j=j
k=k
l=l
z=z
x=x
c=c
zh=o|v
b=b
n=n
m=m
[YunMu]
iu=q
ian=w
e=e
uan=r
in=t
ua=a|m
ie=y
u=u
i=i
o=o
ou=o
uo=p|b
a=a
ia=l
ong=l
ei=s
eng=d
ing=f
ang=g
iang=g
ai=h
ao=j
iao=j
en=k
iong=l
ue=;
uang=z
uai=x
un=c
ui=;
v=v
an=n
[YinJie]
e=ee|e;
er=er
ei=ei
eng=eg
en=en
ou=ou
o=oh|o;
ai=ai
ao=ao
a=ah|a;
ang=ag
an=an
shi=is|ih
shen=ak|it
zhen=ot
chen=ut
hen=hd
ken=kd
zhong=os
chong=us
kong=ks
jiong=js
de=dk
ce=cy
se=sy
re=ry
ze=zy
te=ty
ge=gi
li=ld
ji=jd
yi=ei
ni=nz
mi=mz
pi=pe
zhi=oh
biao=bb
niao=nb
nao=nb
miao=mb
mao=mb
diao=db
ting=tp
bing=bp
ying=ep
qing=qp
xing=xp
yin=ek
xin=xk
bin=bk
yu=eu
yao=ej
chao=ub
yong=el
chu=uf
shu=if
zhu=of
ku=kf
hu=hf
guang=gf
wei=wi
fei=fi
xiang=xh
qiang=qh
bang=bm
yang=eg
fang=fh
tang=tm
rang=rh
tian=tk
bian=bl
qian=qn
xian=xn
fa=fj|f;
wa=wj|w;
za=zm   
zuan=zm
xuan=xm
suan=sm
duan=dm
guan=gm
quan=qm
yuan=em
tuan=tm
zhuan=vm
mo=mq|mc
po=pb|pc|pq
chou=uq
zhou=oq
shou=iq
lou=lq
kou=kq
mou=mq
hou=hq
you=eo|yq
hua=ha|ht
kua=ka|kt
shua=it
zhua=ot
gua=ga
guai=gh
han=hw
kan=kw
yan=yw
chan=uw
shan=iw
zhan=ow
jia=ja
pia=pa
dia=dx|dl
jie=je
mie=me
nie=ne
lie=lz
pie=pz
mu=mv
lu=lv
nu=nv
dui=d;
tui=t;
rui=r;|rv
sui=s;|sv
cui=c;|cv
gui=g;
zui=z;|zv
hui=hv
chui=uv
shui=iv
zhui=ov
kui=kv
qiu=qo
xiu=xo
lue=lb
yue=yb|e;
jue=jb
men=md
er=eh
nai=nx
mai=mx
chai=ux
shai=ix
zhai=ox
pai=px
lai=lx
bei=b;
tun=t;
run=r;
qun=q;
zun=z;
xun=x;
cun=c;
gun=g;
sun=s;
dun=d;
zeng=zk
ceng=ck
deng=dv
leng=lk
geng=gk
yan=en
wengxt commented 4 years ago

自定义音节的已经加上了

https://github.com/fcitx/libime/blob/9e409f5bdf7be216cba6f759f6dbe5d811b9c6f8/test/testshuangpinprofile.cpp#L155 试试测试里写的这个,根据 fcitx 的语法我进行了修改

azuwis commented 4 years ago

好快,我试下编译。

azuwis commented 4 years ago

发现一个 bug ,输入框空的时候,; 开头的打不出来,比如

;ihj 吃好

输入框非空的时候是可以的,比如

hj;i 好吃
azuwis commented 4 years ago

@wengxt 是跟 punctuation 模块有关系吗,如何绕开这个问题?

azuwis commented 4 years ago

还有一个是:

[音节]
ju=jv

jv 打不出 ju

完整的方案是:

[方案]
方案名称=自定义

[零声母标识]
=

[声母]

[韵母]

[音节]
fa=fj
bang=bm
bei=b;
ji=jd
bin=bk
cou=co
cuan=cm
gun=g;
wa=wj
cang=cg
fei=fi
li=ld
jin=jt
chou=uq
chuan=ur
qun=q;
za=zm
tang=tm
gei=gs
mi=mz
lin=lt
dou=do
duan=dm
run=r;
wang=wg
hei=hs
ni=nz
min=mt
fou=fo
guan=gm
sun=s;
a=ah
chang=ug
lei=ls
pi=pe
nin=nt
gou=go
huan=hr
tun=t;
dang=dg
mei=ms
pin=pt
hou=hq
juan=jr
cun=cc
fang=fh
nei=ns
qin=qk
kou=kq
kuan=kr
chun=uc
cha=ua
gang=gg
pei=ps
xin=xk
lou=lq
luan=lr
dun=dc
hang=hg
wei=wi
shi=is
yin=ek
mou=mq
nuan=nr
hun=hc
kang=kg
zei=z;
bing=bp
nou=nq
quan=qm
jun=jc
lang=lg
ben=bk
ding=df
pou=pq
ruan=rm
kun=kc
mang=mg
cen=ck
yi=ei
jing=jf
rou=ro
suan=sm
lun=lc
nang=ng
chen=ut
ling=lf
sou=so
shuan=ir
shun=ic
pang=pg
fen=fk
zhi=vi
ming=mf
shou=iq
tuan=tm
xun=xc
rang=rh
gen=gk
dia=dx
ning=nf
tou=to
xuan=xm
yun=yc
sang=sg
hen=hd
xia=xl
ping=pf
you=eo
yuan=em
zun=zc
sha=ia
shang=ig
ken=kd
lia=lx
qing=qp
zou=zo
zuan=zm
zhun=oc
yang=eg
men=md
jia=ja
ting=tp
zhou=oq
zhuan=or
cuo=cp
zang=zg
nen=nk
qia=ql
xing=xp
er=eh
chuang=uz
chuo=up
zha=oa
zhang=og
pen=pk
bian=bl
ying=ep
guang=gz
duo=dp
bai=bh
bao=bj
ren=rk
tian=tk
jiong=js
huang=hz
guo=gp
cai=ch
cao=cj
sen=sk
dian=dw
qiong=ql
chu=uf
kuang=kz
huo=hb
chai=ux
chao=ub
shen=it
jian=jw
xiong=xl
shuang=iz
kuo=kb
dai=dh
dao=dj
wen=wk
lian=lw
diu=dq
zhuang=oz
luo=lb
gai=gh
gao=gj
zen=zk
mian=mw
jiu=jq
jue=jb
nuo=np
hai=hh
hao=hj
zhen=ot
nian=nw
liu=lq
hu=hf
lue=lb
ruo=rp
kai=kh
kao=kj
beng=bd
pian=pw
miu=mq
ju=jv
nue=n;
suo=sp
lai=lh
lao=lj
ceng=ck
qian=qn
niu=nq
ku=kf
que=q;
shuo=ib
mai=mx
mao=mb
cheng=ud
xian=xn
qiu=qo
lu=lv
xue=x;
tuo=tp
nai=nx
nao=nb
deng=dd
jiang=jg
xiu=xo
mu=mv
yue=e;
zuo=zp
pai=ph
pao=pj
feng=fd
liang=lg
nu=nv
cui=c;
zhuo=ob
sai=sh
rao=rj
geng=gk
niang=ng
sui=s;
shai=ix
sao=sj
heng=hd
qiang=qh
ang=ag
pu=pv
zui=z;
tai=th
shao=aj
keng=kd
xiang=xh
mo=mq
chui=uv
wai=wh
tao=tj
leng=lk
biao=bb
po=pq
dui=d;
zai=zh
yao=ej
meng=md
diao=db
gui=g;
zhai=ox
zao=zj
neng=nd
jiao=jj
shu=if
hui=hv
ban=bn
zhao=oj
peng=pd
liao=lz
o=oh
kui=kv
can=cn
ge=gi
reng=rd
miao=mb
rui=r;
chan=uw
ce=cy
seng=sk
niao=nb
yo=eo
shui=iv
dan=dn
che=ue
sheng=id
piao=pj
cong=cl
yu=eu
tui=t;
fan=fn
de=dk
teng=td
qiao=qj
chong=us
zhui=ov
gan=gn
e=e;
weng=wd
tiao=tj
dong=dl
zhu=of
han=hw
zeng=zk
xiao=xj
gong=gl
gua=ga
kan=kw
zheng=od
bie=by
hong=hl
hua=ha
lan=ln
die=dy
kong=ks
kua=km
man=mn
jie=je
long=ll
shua=im
nan=nn
lie=lz
nong=nl
zhua=om
pan=pn
re=ry
chi=;i
mie=me
rong=rl
chuai=ux
ran=rn
se=sy
nie=ne
song=sl
guai=gh
san=sn
she=ie
pie=pz
tong=tl
huai=hx
shan=iw
te=ty
qie=qy
yong=el
kuai=kx
tan=tn
tie=ty
zong=zl
shuai=ix
wan=wn
ze=zy
xie=xy
zhong=os
zhuai=ox
yan=en
zhe=oe
zan=zn
zhan=ow
wengxt commented 4 years ago

你再试试,应该都解决了

azuwis commented 4 years ago

jv 能打出 ju 了,但 ; 开头的还是打不出来,输入框空的时候,会直接打出

wengxt commented 4 years ago

还得更新chineseaddons

Zhong Jianxin notifications@github.com于2020年10月13日 周二19:29写道:

jv 能打出 ju 了,但 ; 开头的还是打不出来,输入框空的时候,会直接打出 ;。

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/fcitx/libime/issues/13#issuecomment-708116018, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB7MZG7WOZDI2ROO3Y2DFTSKUEJ5ANCNFSM4RWOI2IA .

azuwis commented 4 years ago

fcitx5-chinese-addons 在 Debian Unstable 上编译出错了:

/srv/build/fcitx5-chinese-addons-0.0~git20201013.c1124e8/modules/cloudpinyin/cloudpinyin.h:69:5: error: template argument 1 is invalid
   69 |     FCITX_ADDON_EXPORT_FUNCTION(CloudPinyin, toggleKey);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/srv/build/fcitx5-chinese-addons-0.0~git20201013.c1124e8/modules/cloudpinyin/cloudpinyin.h:69:5: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘int’ in initialization
   69 |     FCITX_ADDON_EXPORT_FUNCTION(CloudPinyin, toggleKey);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/srv/build/fcitx5-chinese-addons-0.0~git20201013.c1124e8/modules/cloudpinyin/cloudpinyin.cpp: In member function ‘virtual void GoogleBackend::prepareRequest(CurlQueue*, const string&)’:
/srv/build/fcitx5-chinese-addons-0.0~git20201013.c1124e8/modules/cloudpinyin/cloudpinyin.cpp:31:9: error: ‘UniqueCPtr’ was not declared in this scope
   31 |         UniqueCPtr<char, curl_free> escaped(
      |         ^~~~~~~~~~
/srv/build/fcitx5-chinese-addons-0.0~git20201013.c1124e8/modules/cloudpinyin/cloudpinyin.cpp:31:20: error: expected primary-expression before ‘char’
   31 |         UniqueCPtr<char, curl_free> escaped(
      |                    ^~~~
/srv/build/fcitx5-chinese-addons-0.0~git20201013.c1124e8/modules/cloudpinyin/cloudpinyin.cpp:34:16: error: ‘escaped’ was not declared in this scope
   34 |         url += escaped.get();
      |                ^~~~~~~

似乎先要升级 fcitx5 ,先等几天看看发行版会不会升级。

azuwis commented 4 years ago

测试过了,好用。