Module:anagrams

Definition from Wiktionary, the free dictionary
Jump to: navigation, search

local m_languages = require("Module:languages")
local m_links = require('Module:links')

local export = {}

function export.show(frame)
	local params = {
		[1] = {required = true},
		[2] = {list = true, required = true}
	}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local lang = m_languages.getByCode(args[1])
	
	values = {}

	local n = 1
	for k,v in ipairs(args[2]) do
		values[n] = m_links.full_link({lang = lang, term = v}, nil, false)
		n = n + 1;
	end
	
	return table.concat(values, ', ')
	
end

return export