Module:lo-alt

Hello, you have come here looking for the meaning of the word Module:lo-alt. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:lo-alt, but we will also tell you about its etymology, its characteristics and you will know how to say Module:lo-alt in singular and plural. Everything you need to know about the word Module:lo-alt you have here. The definition of the word Module:lo-alt will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:lo-alt, 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 links = require("Module:links")
local gsub = mw.ustring.gsub

local lang = require("Module:languages").getByCode("lo")
local script = require("Module:scripts").getByCode("Laoo")
local PAGENAME = mw.title.getCurrentTitle().text

local conCls1 = ""
local conCls2 = "ຫ"
local toneCls = "?"

-- This must be imperfect since ຍ could appear at any position.
local datedSeq = {
	 = "%1ຽ", -- oey
	 = "%1ຽ",
	)ຍ"] = "%1ຽ", -- uay, oay, aay
	)ຍ"] = "%1ຽ",
	"..toneCls..")ຍ"] = "%1ຽ", -- uey, uuey, uy, uuy
	"..toneCls..")ຍ"] = "%1ຽ",
	 = "ຫນ",
	 = "ຫມ",
	 = "ຫລ",
}

local function preloadDatedForm()

	local pdated = PAGENAME

	for k, v in pairs(datedSeq) do
		pdated = gsub(pdated, k, v)
	end

	return (pdated ~= PAGENAME and pdated or nil)

end

function export.show(frame)

	local args = frame:getParent().args
	local common = args or args or nil
	local dated = args or args or preloadDatedForm()
	local obsolete = args or args or args or nil

	local altForms = {}
	altForms.common = (common and mw.text.split(common, ",", true) or {})
	altForms.dated = (dated and mw.text.split(dated, ",", true) or {})
	altForms.obsolete = (obsolete and mw.text.split(obsolete, ",", true) or {})

	local output = {}

	if common then
		table.insert(altForms.common, 1, "lo")
		table.insert(output, "* " .. frame:expandTemplate{title = "alter", args = altForms.common})
	end
	if dated then
		table.insert(altForms.dated, 1, "lo")
		table.insert(altForms.dated, "")
		table.insert(altForms.dated, "dated")
		table.insert(output, "* " .. frame:expandTemplate{title = "alter", args = altForms.dated})
	end
	if obsolete then
		table.insert(altForms.obsolete, 1, "lo")
		table.insert(altForms.obsolete, "")
		table.insert(altForms.obsolete, "obsolete")
		table.insert(output, "* " .. frame:expandTemplate{title = "alter", args = altForms.obsolete})
	end

	return table.concat(output, "\n")

end

return export