Module:anui-headword: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 27: Line 27:


local function redup(word, grave)
local function redup(word, grave)
word = word:gsub("([ḛḭṵaɔ]" .. TILDEB .. "?)", {["ḛ"] = "è", ["ḭ"] = "ì", ["ṵ"] = "ù", ["a" .. TILDEB] = "à", ["o" .. TILDEB] = "ò"})
word = m(word)
word = m(word)
local consonant = "[ǃǂǁʘʼʇxqrʛɴɬšṣschjklmptŋṉṭṯ]"
local consonant = "[ǃǂǁʘʼʇxqrʛɴɬšṣschjklmptŋṉṭṯ]"
local vowel = "[aeiouàèìòùʼãĩõᴍ]"
local vowel = "[aeiouàèìòùʼãĩõᴍ" .. TILDEB .. "]"
-- CV > C₁(v)C₂V
-- CV > C₁(v)C₂V
local C = match(word, "^" .. vowel .. "?(" .. consonant .. "*)")
local C = match(word, "^" .. vowel .. "?(" .. consonant .. "*)")
Line 37: Line 36:
local r2 = match(word, C .. "(.*)")
local r2 = match(word, C .. "(.*)")
local v = gsub(sub(V, 1, 1), "[àèìòù]", {["à"] = "a", ["è"] = "e", ["ì"] = "i", ["ò"] = "o", ["ù"] = "u"})
local v = sub(V, 1, 1)
local pref = match(C, "[sšṣɬ][ʇǃǂǁʘ]") ~= nil
local pref = match(C, "[sšṣɬ][ʇǃǂǁʘ]") ~= nil