45,647
edits
No edit summary |
No edit summary |
||
Line 16: | Line 16: | ||
local endings = { | local endings = { | ||
["[lr] | ["[lr]"] = "liquid", | ||
["[ptkq] | ["[ptkq]"] = "voiceless-stop", | ||
["[mn] | ["[mn]"] = "nasal", | ||
["[bdg] | ["[bdg]"] = "voiced-stop", | ||
[" | ["lj"] = "palatal", ["ñ"] = "palatal", | ||
["[aeiou]"] = "vowel", | ["[aeiou]"] = "vowel", | ||
["[^l][hszvj] | ["[^l][hszvj]"] = "fricative", ["gh"] = "fricative", | ||
} | } | ||
function export.detect_decl(word, class) | function export.detect_decl(word, class) | ||
local root = sub(word, 1, - | local root = sub(word, 1, -5) | ||
if class then | if class then | ||
local decl = class | local decl = class | ||
return decl, {sub(root, 1, (sub(root, -2) == ("lj" or "gh") and -3 or -2))} | return decl, {sub(root, 1, (sub(root, -2) == ("lj" or "gh") and -3 or -2))} | ||
elseif m_data.astems[word] then return "a", {sub(root, -2)} | elseif m_data.astems[word] then return "a", {sub(root, -2)} | ||
elseif find(root, "[eiou]$") then return "vowel", {sub(root, 1, -2)} | |||
else | else | ||
for ending, decl in pairs(endings) do | for ending, decl in pairs(endings) do |