Module:anui-headword: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 17: Line 17:


local consonant = "[ǃǂǁʘʼʇxqrʛɴɬšṣschjklmptŋṉṭṯ]"
local consonant = "[ǃǂǁʘʼʇxqrʛɴɬšṣschjklmptŋṉṭṯ]"
local vowel = "[aeiouàèìòùãĩõũḛḭṵ" .. TILDEB .. "v]"
local vowel = "[aeiouàèìòùãĩõũḛḭṵ" .. TILDEB .. "v@]"


local function m(word)
local function m(word)
word = word:gsub("mʼm", "v")
word = word:gsub("mʼm", "v")
word = word:gsub("(" .. vowel .. ")m", "%1ũ")
word = word:gsub("(" .. vowel .. ")m", "%1ũ")
word = word:gsub("(" .. vowel .. ")ʼ(" .. vowel .. ")", "%1%2")
word = word:gsub("(" .. vowel .. "*)@(" .. vowel .. "*)", "%1@%2")
return word
return word
Line 38: Line 38:
local v = sub(V, 1, 1)
local v = sub(V, 1, 1)
local ejective = C == "tɬʼ" or match(C, "^[ṭcq]ʼ$") ~= nil
local fricative = match(C, "[sšṣɬ][ʇǃǂǁʘ]") ~= nil
local fricative = match(C, "[sšṣɬ][ʇǃǂǁʘ]") ~= nil
local nasal = match(C, "ɴ") ~= nil
local nasal = match(C, "ɴ") ~= nil
Line 43: Line 44:
local uvular = match(C, "x") ~= nil
local uvular = match(C, "x") ~= nil
if (nasal or fricative) or glottal then word = C .. (glottal and "" or v) .. gsub(C, "[sšṣɬ]([ʇǃǂǁʘ])", "%1") .. r2
if ejective then word = C .. C .. r2
elseif (nasal or fricative) or glottal then word = C .. (glottal and "" or v) .. gsub(C, "[sšṣɬ]([ʇǃǂǁʘ])", "%1") .. r2
elseif uvular then word = gsub(C, "([ʇǃǂǁʘ])x", "%1") .. v .. C .. r2
elseif uvular then word = gsub(C, "([ʇǃǂǁʘ])x", "%1") .. v .. C .. r2
else word = C .. v .. C .. r2 end
else word = C .. v .. C .. r2 end
word = word: gsub("v", "mʼm"); word = word:gsub("ũ", "m"); word = word:gsub("@", "ʼ")
word = word: gsub("v", "mʼm"); word = word:gsub("ũ", "m")
return word
return word
Line 56: Line 57:
local args = frame:getParent().args
local args = frame:getParent().args
local word = args["w"] or mw.title.getCurrentTitle().text
local word = args["w"] or mw.title.getCurrentTitle().text
local data = {lang = lang, pos_category = deabb[args[1]], heads = {word}, categories = {}, inflections = {},}
local pos = args[1]; local f = args[2]
local pos = args[1]; local f = args[2]
local data = {lang = lang, pos_category = deabb[pos], heads = {word}, categories = {}, inflections = {},}
if f == '-' then
if f == '-' then
if pos == "adj" then
if pos == "adj" then
table.insert(data.inflections, {label = "not " .. glossary_link("comparable")})
table.insert(data.inflections, {label = "not " .. glossary_link("comparable")})
table.insert(data.categories, lang:getCanonicalName() .. " uncomparable adjectives")
table.insert(data.categories, lang:getCanonicalName() .. " uncomparable " .. deabb[pos])
end
end
elseif pos ~= "v" then
elseif pos ~= "v" then
table.insert(data.inflections, {label = glossary_link("comparative"), redup(word)})
table.insert(data.inflections, {label = glossary_link("comparative"), redup(word)})
if pos == "adverbs" then table.insert(data.categories, lang:getCanonicalName() .. " comparative " .. pos) end
if pos == "adv" then table.insert(data.categories, lang:getCanonicalName() .. " comparative " .. deabb[pos]) end
else
else
table.insert(data.inflections, {label = "[[w:applicative voice|applicative]]", redup(word)})
table.insert(data.inflections, {label = "[[w:applicative voice|applicative]]", redup(word)})