Module:User:Dixtosa/Swadesh

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

This is a private module sandbox of Dixtosa, for his own experimentation. Items in this module may be added and removed at Dixtosa's discretion; do not rely on this module's stability.


local export = {}

local m_links = require("Module:links")

local English = {"]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "to ]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "to ]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]", "]"}
--array - list of 207 objects in this form {gloss=term}
local data = {}

function export.show(frame)
	local args = frame:getParent().args
	local lang = require("Module:languages").getByCode(args)
	data = mw.loadData("Module:User:Dixtosa/Swadesh/data/" .. args)
	local needsTransliteration = false
	
	local Id = 1
	local table = mw.html.create("table"):addClass("wikitable")
	
	local headers = table:tag("tr")
	for _, text in ipairs { "Id", "English (gloss)", lang:getCategoryName(), "IPA" } do
		headers:tag("th"):node(text)
	end
	
	local makeIPA
	if args == "ka" then
		local IPATranscribe = require("Module:ka-IPA").IPA_transcribe
		function makeIPA(text)
			return '<span class="IPA">' .. IPATranscribe(text) .. '</span>'
		end
	end
	
	for index, value in pairs(data) do
		local row = mw.html.create("tr")
		row:tag("td"):node(Id)
		
		local Englishs = ""
		local Translations = ""
		local IPAs = ""
		for gloss, termData in pairs(value) do
			Englishs = Englishs .. "\n" .. English
			if gloss ~= "1" then
				 Englishs = Englishs .. " (" .. gloss .. ")"
			end
			
			Translations = Translations .. "\n" .. m_links.full_link({lang = lang, term = termData.term, tr = termData.tr})
			
			if makeIPA then
				IPAs = IPAs .. "\n"
					.. termData.term:gsub("%]+)%]%]", makeIPA) -- IPA-ify the contents of links
						:gsub(" '*%(+%)'*", "") -- remove parentheses
			else
				IPAs = IPAs .. "\n" .. (termData.IPA or "")
			end
		end
		
		row:tag("td"):node(Englishs)
		row:tag("td"):node(Translations)
		row:tag("td"):node(IPAs)
		
		table:node(row)
		Id = Id + 1
	end
	
	
	return table;
end

return export