(Literally: "Does this follow/realize the gismu-form?")
The language Lojban is a constructed language, meaning in part that all of its words have been created rather than allowed to develop naturally. The semantic base of Lojban are its gismu, or root words, which were synthesized by combining roots from widely spoken natural languages like Chinese, Hindi, and English. All gismu are 5 letters long and follow a certain strict form.
For our purposes, the Lojban alphabet is:
That is, the Roman alphabet without
This alphabet can be divided into four categories:
ptkfcsx. When voiced, these become respectively the...
bdgvjz(No voiced consonant corresponds to
To be a valid gismu, a 5-char-long string must:
Be in one of the consonant-vowel patterns
CCVCV, where C represents a consonant, and V represents a vowel.
Follow consonant-matching rules.
Consonant-matching rules for CCVCV words:
The first two characters must constitute one of the following 48 pairs (source):
ml mr pl pr bl br tr tc ts dr dj dz kl kr gl gr fl fr vl vr cl cr cm cn cp ct ck cf jm jb jd jg jv sl sr sm sn sp st sk sf zm zb zd zg zv xl xr
Note that this looks rather nicer when separated into voiced and unvoiced pairs. In particular, every voiced-voiced pair is valid iff the corresponding unvoiced-unvoiced pair is valid. This does not extend to pairs with a sonorant consonant;
cl is valid but
jl is not.
Consonant-matching rules for CVCCV words (source):
The third and fourth characters must follow the following rules:
It is forbidden for both consonants to be the same [...]
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.
It is forbidden for both consonants to be drawn from the set “c”, “j”, “s”, “z”.
The specific pairs “cx”, “kx”, “xc”, “xk”, and “mz” are forbidden.
Note that there are 179 possible pairs.
Determine if the given string follows the gismu formation rules. This is code-golf, so the shortest solution in bytes wins.
Input: A string of length 5 from the Lojban alphabet.
Output: A truthy value if the string can be a gismu and a falsey value otherwise.
gismu cfipu ranxi mupno rimge zosxa
ejram xitot dtpno rcare pxuja cetvu
More test cases: this text file contains all valid gismu, one per line.
I don't really know Lojban, so I suspect the title translation is wrong. Help is appreciated.