Module:qhv-noun: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 33: Line 33:


function export.detect_decl(word, number, class)
function export.detect_decl(word, number, class)
local syllables = require("Module:qhv-pron").write_stress(word, true)
if number and class then
if number and class then
local decl = number .. "-" .. class
local decl = number .. "-" .. class
return decl, {sub(word, 1, -(#endings_reverse[decl] + 1))}
return decl, {sub(word, 1, -(#endings_reverse[decl] + 1))}
elseif find(word, "[aāiu]?[aāeēoōīūȳ]s$") then
elseif find(word, "[aāiu]?[aāeēoōīūȳ].$") and (syllables == 1 or syllables == 2) then
if require("Module:qhv-pron").write_stress(word, true) == 1 then
return "5-a", {sub(word, 1, -2)}
end
return "3-s-h", {sub(word, 1, -2)}
return "3-s-h", {sub(word, 1, -2)}
else
else