Module:eo-link

Definition from Wiktionary, the free dictionary
Jump to navigation Jump to search
Text-x-generic with pencil.svg This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

local export = {}
local lang = require("Module:languages").getByCode("eo")

function export.show(frame)
	local lemma = frame:getParent().args[1] or ""
	local alt = frame:getParent().args[2] or ""
	if alt == "" then
		alt = lemma
		lemma = lemma .. " "
		lemma = mw.ustring.gsub(lemma, "[aio]n?t[ao]j?n? ", "i ")
		lemma = mw.ustring.gsub(lemma, "[aio]nte ", "i ")
		lemma = mw.ustring.gsub(lemma, "[aiou]s ", "i ")
		lemma = mw.ustring.gsub(lemma, "u ", "i ")
		lemma = mw.ustring.gsub(lemma, "aj?n? ", "a ")
		lemma = mw.ustring.gsub(lemma, "oj?n? ", "o ")
	end
	return require("Module:links").language_link(lemma, alt, lang)
end

return export