Module:xal-headword

Hello, you have come here looking for the meaning of the word Module:xal-headword. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:xal-headword, but we will also tell you about its etymology, its characteristics and you will know how to say Module:xal-headword in singular and plural. Everything you need to know about the word Module:xal-headword you have here. The definition of the word Module:xal-headword will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:xal-headword, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

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("xal")
local m_scripts = require("Module:scripts")
local sc = m_scripts.getByCode('Cyrl')
	
local params = {
	 = {},
	 = {list = true},
	 = {list = true}
}
	
local function clearscript(inflections, args)
	if #args < 1 then
		return 
	end
	
	m_links = require("Module:links")

	local xwo_sc = m_scripts.getByCode('Mong')
	local xwo_lang = require("Module:languages").getByCode("xwo")
	
	local spelling = {label = "Clear script spelling", sc = xwo_sc, enable_auto_translit=true}
	
	for i, arg in ipairs(args) do
		table.insert(spelling, {term = arg, lang = xwo_lang, sc = xwo_sc})
	end
	
	table.insert(inflections, spelling)
end

local function categorize(cats)
	if cats == nil then
		return nil
	end
	local categories = {}
	for i, arg in ipairs(cats) do
		table.insert(categories, lang:getCanonicalName() .. " " .. arg)
	end
	return categories
end

function export.basic(frame)
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local inflections = {}
	local categories = categorize(args)
	
	clearscript(inflections, args)
	
	local data = {lang = lang, sc = sc, heads = {args}, genders = nil, inflections = inflections, pos_category = frame.args, categories = categories, sort_key = nil}
	return require("Module:headword").full_headword(data)
end

function export.noun(frame)

	params = {list = true}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	

	
	local inflections = {}
	
	local categories = categorize(args)
	
	clearscript(inflections, args)
	
	if #args > 0 then
		local plurals = {label = "plural"}
		for i, pl in ipairs(args) do
			table.insert(plurals, pl)
		end
		table.insert(inflections, plurals)
	end

	
	local data = {lang = lang, sc = sc, heads = {args}, genders = nil, inflections = inflections, pos_category = "nouns", categories = categories, sort_key = nil}
	return require("Module:headword").full_headword(data)
end

return export