(Literally: "Does this follow/realize the gismu-form?")
Premise
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.
Information
For our purposes, the Lojban alphabet is:
abcdefgijklmnoprstuvxz
That is, the Roman alphabet without hqwy
.
This alphabet can be divided into four categories:
Vowels
aeiou
Sonorant consonants
lmnr
Unvoiced consonants
ptkfcsx
. When voiced, these become respectively the...Voiced consonants
bdgvjz
(No voiced consonant corresponds tox
.)
To be a valid gismu, a 5-char-long string must:
Be in one of the consonant-vowel patterns
CVCCV
orCCVCV
, 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.
Challenge
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.
Test cases
Valid:
gismu
cfipu
ranxi
mupno
rimge
zosxa
Invalid:
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.
s
andk
are part of the language, what pronunciation doesc
has? \$\endgroup\$j
is not pronounced as English J, but rather as French J (without the plosive at the beginning.) From one of the linked pagesThe regular English pronunciation of “James”, which is [dʒɛjmz], would Lojbanize as “djeimz.”, which contains a forbidden consonant pair......[additional rule to avoid this]
so we see that the plosive D needs to be added in. The unvoiced version of French J is indeed SH. The IPA symbols (for those who understand them) are on the wikipedia page. \$\endgroup\$