Module:qhv-verb: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 16: Line 16:


local endings = {
local endings = {
["[lr]"] = "liquid",
["[lr]a"] = "liquid",
["[ptkq]"] = "voiceless-stop",
["[ptkq]a"] = "voiceless-stop",
["[mn]"] = "nasal",
["[mn]a"] = "nasal",
["[bdg]"] = "voiced-stop",
["[bdg]a"] = "voiced-stop",
["lj"] = "palatal", ["ñ"] = "palatal",
["lja"] = "palatal", ["ña"] = "palatal",
["[aeiou]gon"] = "vowel",
["[aeiou]"] = "vowel",
["[^l][hszvj]"] = "fricative", ["gh"] = "fricative",
["[^l][hszvj]a"] = "fricative", ["gha"] = "fricative",
}
}


function export.detect_decl(word, class)
function export.detect_decl(word, class)
local root = sub(word, 1, -5)
local root = sub(word, 1, -4)
if class then
if class then
local decl = class
local decl = class
Line 35: Line 35:
if find(root, ending .. "$") then
if find(root, ending .. "$") then
return decl, {sub(root, 1, -(#ending + 1))}
return decl, {sub(root, 1, -(#ending + 1))}
elseif find(word, ending .. "$") then
return decl, {sub(root, 1, -2)}
else return "fricative", {root}
else return "fricative", {root}
end
end

Navigation menu