45,640
edits
m (Sware moved page Module:anui-adj to Module:anui-headword without leaving a redirect) |
No edit summary |
||
Line 1: | Line 1: | ||
local match = mw.ustring.match | |||
local u = mw. ustring.char | |||
local gsub = mw.ustring.gsub | |||
local TILDEA = u(0x0303) -- COMBINING TILDE ̃◌ | |||
local TILDEB = u(0x0330) -- COMBINING TILDE BELOW ̰◌ | |||
local export = {} | local export = {} | ||
local lang = require("Module:languages").getByCode("art-nui") | local lang = require("Module:languages").getByCode("art-nui") | ||
local data = {lang = lang, pos_category = | local args = frame:getParent().args | ||
local deabb = {["adj"] = "adjectives", ["v"] = "verb", ["adv"] = "adverb",} | |||
local data = {lang = lang, pos_category = deabb[args[1]], categories = {}, inflections = {},} | |||
local function glossary_link(entry, text) | local function glossary_link(entry, text) | ||
Line 10: | Line 19: | ||
local function redup(word) | local function redup(word) | ||
word = word:gsub("([ḛḭṵaɔ]" .. TILDEB .. "?)", {["ḛ"] = "è", ["ḭ"] = "ì", ["ṵ"] = "ù", ["a" .. TILDEBELOW] = "à", ["ɔ" .. TILDEBELOW] = "ò"}) | |||
local consonant = "[ǃǂǁʘʼxqrʛɴɬšṣchjklmptŋṉṭṯ]" | |||
local vowel = "[aeiouàèìòùʼ]" | |||
local C = match(word, consonant .. "*") | |||
return | return word | ||
end | end | ||
function export.show() | function export.show() | ||
local word = mw.title.getCurrentTitle().text or args["w"] | local word = mw.title.getCurrentTitle().text or args["w"] | ||
local pos = args[1]; local f = args[2] | |||
if | if f == '-' then | ||
table.insert(data.inflections, {label = "not " .. glossary_link("comparable")}) | if pos == "adj" then | ||
table.insert(data.inflections, {label = "not " .. glossary_link("comparable")}) | |||
table.insert(data.categories, lang:getCanonicalName() .. " uncomparable adjectives") | |||
end | |||
elseif not pos == "v" then | |||
table.insert(data.inflections, {label = glossary_link("comparative"), redup(word)}) | |||
if pos == "adverbs" then table.insert(data.categories, lang:getCanonicalName() .. " comparative " .. pos) end | |||
else | else | ||
table.insert(data.inflections, {label = glossary_link(" | table.insert(data.inflections, {label = glossary_link("applicative"), redup(word)}) | ||
end | end | ||