Module:tdd-headword

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

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

local old_tones = {
	-- uses combining marks
	 = u(0x0308), -- tone 2
	 = u(0x030C), -- tone 3
	 = u(0x0300), -- tone 4
	 = u(0x0307), -- tone 5
	 = u(0x0301), -- tone 1
	-- unmarked for  tone 5, else tone 6
}

function export.show(frame)

	local args = frame:getParent().args
	local poscat = frame.args or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
 
	local head = args or PAGENAME
	local tr = args
	
	local data = {lang = lang, pos_category = poscat, categories = {}, heads = {head}, translits = {tr}, inflections = {}}
	
	local old_ortho = {label = "1963 orthography"}
	local old_term = gsub(head, "", old_tones)
	old_term = gsub(old_term, u(0x200C), "")
	old_term = gsub(old_term, "‌", "")
	old_term = gsub(old_term, u(0x200D), "")
	old_term = gsub(old_term, "‍", "")
	table.insert(old_ortho, {term = old_term})
	table.insert(data.inflections, old_ortho)
 
	return require("Module:headword").full_headword(data)

end

return export