Module:anui-headword: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 38: Line 38:
local v = sub(V, 1, 1)
local v = sub(V, 1, 1)
local pref = match(C, "[sšṣ]") ~= nil
local pref = match(C, "[sšṣɬ][ʇǃǂǁʘ]") ~= nil
local nasal = match(C, "ɴ") ~= nil
local nasal = match(C, "ɴ") ~= nil
local glottal = match(C, "[ʇǃǂǁʘṭcɬq]ʼ") ~= nil
local glottal = match(C, "[ʇǃǂǁʘṭcɬq]ʼ") ~= nil
local uvular = match(C, "x") ~= nil
local uvular = match(C, "x") ~= nil
if (nasal or pref) or glottal then word = C .. (glottal and "" or v) .. gsub(C, "[sšṣ]([ʇǃǂǁʘ])", "%1") .. r
if (nasal or pref) or glottal then word = C .. (glottal and "" or v) .. gsub(C, "[sšṣɬ]([ʇǃǂǁʘ])", "%1") .. r
elseif uvular then word = gsub(C, "([ʇǃǂǁʘ])x", "%1") .. v .. C .. r
elseif uvular then word = gsub(C, "([ʇǃǂǁʘ])x", "%1") .. v .. C .. r
else word = C .. v .. C .. r end
else word = C .. v .. C .. r end