Module:syllables: Difference between revisions

From Laenkea
Jump to navigation Jump to search
(Created page with "local export = {} function export.show(frame) local args = frame:getParent().args local language = args[1] local syllables = {} local i = 2 while args[i] do if args[i] ~= "" then table.insert(syllables, args[i]) end end if #syllables > 0 then return "Syllabification: <big>" .. table.concat(syllables, "·") .. "</big>" end error("no syllables given to {{syllables}}") end return export")
(No difference)

Revision as of 12:44, 8 August 2023

Documentation for this module may be created at Module:syllables/documentation

local export = {}

function export.show(frame)
	local args = frame:getParent().args
	local language = args[1]
	local syllables = {}
	local i = 2
	while args[i] do
		if args[i] ~= "" then table.insert(syllables, args[i]) end
	end
	if #syllables > 0 then
		return "Syllabification: <big>" .. table.concat(syllables, "·") .. "</big>"
	end
	error("no syllables given to {{syllables}}")
end

return export