Module:gd-stem-type

local export = {}

local broad_vowels = {'a','à','o','ò','u','ù','A','À','O','Ò','U','Ù'} local slender_vowels = {'e','è','i','ì','E','È','I','Ì'}

local function has_value(tab, val) for _, value in ipairs(tab) do       if value == val then return true end end return false end

function export._getParameters(frame_args, arg_list) local new_args = {}; local index = 1; local value; for _, arg in ipairs(arg_list) do		value = frame_args[arg] if value == nil then value = frame_args[index]; index = index + 1; end new_args[arg] = value; end return new_args; end

function export.show(frame) local new_args = export._getParameters(frame.args, { 'stem' }); local stem = new_args['stem'] or ''; local stem_rev = string.reverse(stem) for i = 1, #stem_rev do		if has_value(broad_vowels, stem_rev:sub(i,i)) then return 'broad' end if has_value(slender_vowels, stem_rev:sub(i,i)) then return 'slender' end end return "broad" end

return export