Module:anagrams

Definition from Wiktionary, the free dictionary
Jump to: navigation, 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 m_languages = require("Module:languages")
local m_links = require('Module:links')

local export = {}

function export.show(frame)
	local params = {
		[1] = {required = true, default = "und"},
		[2] = {required = true, default = "anagram", list = true}
	}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local lang = m_languages.getByCode(args[1])
	
	for i, val in ipairs(args[2]) do
		args[2][i] = m_links.full_link({lang = lang, term = val})
	end
	
	return table.concat(args[2], ', ')
	
end

return export