Module:mg-noun/data: Difference between revisions

No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:


local deacuter = {["á"] = "a", ["é"] = "e", ["í"] = "i", ["ó"] = "o", ["ú"] = "u"}
local deacuter = {["á"] = "a", ["é"] = "e", ["í"] = "i", ["ó"] = "o", ["ú"] = "u"}
local cs = "bkdhjlmnñpqrstxzvɡzʧʎ"
local cs = "bcdhjlmnñpqrstxzvgzʧʎ"


local data = {}
local data = {}
Line 17: Line 17:
local stem = data.head; data.decl_type = "o"; local s1 = sub(stem, 1, -2); local inserted = s1
local stem = data.head; data.decl_type = "o"; local s1 = sub(stem, 1, -2); local inserted = s1
local pat = {
local pat = {
{"ch", "ʧ"}, {"il", "ʎ"}, {"c(.)$", "k%1"},
{"ch", "ʧ"}, {"il", "ʎ"},
{"([^" .. cs .. "])([" .. cs .. "]*)(i?)$", "%1i%2%3"}, {"ii", "i"}, {"k$", "qu"}, {"ʎ", "il"}, {"ʧ", "ch"}
{"([^" .. cs .. "])([" .. cs .. "]*)(i?)$", "%1i%2%3"}, {"ii", "i"}, {"c$", "qu"}, {"ʎ", "il"}, {"ʧ", "ch"}
}
}
Line 164: Line 164:
})
})


data["consonant"] = {
data["cons"] = {
params = {
params = {
[1] = {},
[1] = {},
},
},
}
}
setmetatable(data["consonant"], {__call = function(self, args, data)
setmetatable(data["cons"], {__call = function(self, args, data)
local stem = data.head; data.decl_type = "consonant"
local stem = data.head; data.decl_type = "consonant"
local qstem = sub(stem, -1) == "c" and gsub(stem, "c$", "qu") or stem
local qstem = sub(stem, -1) == "c" and gsub(stem, "c$", "qu") or stem