.i xu .e'o lo zunsnagri cu drani loka jboge'a
给定输入由两个字符组成的字符串,输出是否在Lojban中是有效的辅音簇。
这是CLL 3.6的引文,详细列出了有效辅音对(或无效对)的规则:
1) It is forbidden for both consonants to be the same, as this would
violate the rule against double consonants.
2) It is forbidden for one consonant to be voiced and the other unvoiced.
The consonants “l”, “m”, “n”, and “r” are exempt from this restriction.
As a result, “bf” is forbidden, and so is “sd”, but both “fl” and “vl”,
and both “ls” and “lz”, are permitted.
3) It is forbidden for both consonants to be drawn from the set “c”, “j”,
“s”, “z”.
4) The specific pairs “cx”, “kx”, “xc”, “xk”, and “mz” are forbidden.
该引用引用了“发声”和“清声”辅音。这是一张清音辅音及其配音的表格(同样来自CLL 3.6):
UNVOICED VOICED
p b
t d
k g
f v
c j
s z
x -
请注意,{x}没有浊音对方。为了完整起见,未在此列表中的其余辅音(为了引用而可以发声或不发声)为lmnr
。(y
是元音,hqw
不使用字母
。)
输入必须是单个字符串,但是您可以假定它将始终完全由两个辅音组成,如果需要,还可以选择包含尾随换行符。输出可能是任何真实值或虚假值。
这是code-golf,因此以字节为单位的最短代码获胜。
测试用例(将所有可能的输入字符串放在适当的类别中):
Valid consonant clusters:
bd bg bj bl bm bn br bv bz cf ck cl cm cn cp cr ct db dg dj dl dm dn dr dv
dz fc fk fl fm fn fp fr fs ft fx gb gd gj gl gm gn gr gv gz jb jd jg jl jm
jn jr jv kc kf kl km kn kp kr ks kt lb lc ld lf lg lj lk lm ln lp lr ls lt
lv lx lz mb mc md mf mg mj mk ml mn mp mr ms mt mv mx nb nc nd nf ng nj nk
nl nm np nr ns nt nv nx nz pc pf pk pl pm pn pr ps pt px rb rc rd rf rg rj
rk rl rm rn rp rs rt rv rx rz sf sk sl sm sn sp sr st sx tc tf tk tl tm tn
tp tr ts tx vb vd vg vj vl vm vn vr vz xf xl xm xn xp xr xs xt zb zd zg zl
zm zn zr zv
Invalid consonant clusters:
bb bc bf bk bp bs bt bx cb cc cd cg cj cs cv cx cz dc dd df dk dp ds dt dx
fb fd ff fg fj fv fz gc gf gg gk gp gs gt gx jc jf jj jk jp js jt jx jz kb
kd kg kj kk kv kx kz ll mm mz nn pb pd pg pj pp pv pz rr sb sc sd sg sj ss
sv sz tb td tg tj tt tv tz vc vf vk vp vs vt vv vx xb xc xd xg xj xk xv xx
xz zc zf zj zk zp zs zt zx zz