Module:sandbox/kl-pron

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


local export = {}

export.phonetic = function(frame)
	
	local params = {  = {} }
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	local word = ""
	if args == nil or args == "" then
		word = mw.title.getCurrentTitle().subpageText
	else
		word = args
	end
	
	word = word:lower()
	
	-- Trigraphs and retracted /a/
	local map3L = {  = "ŋ.ŋ",  = "ɑːr",  = "ɑːq" }
	
	-- Digraphs and retracted /a/
	local map2L = {  = "ŋ",  = "aː",  = "ɜː",
					 = "iː",  = "ɔː",  = "uː",
					 = "ɑr",  = "ɑq" }
				
	-- Geminates and /t/-affrication
	local mapGL = {  = "ɬ.ɬ",  = "x.x",  = "χ.χ",
					 = "ɬ.ɬ",  = "x.x",  = "f.f",
					 = "f.f",  = "p.p",  = "n.n",
					 = "m.m",  = "t.t",  = "q.q",
					 = "s.s",  = "k.k",  = "t.t͡s",
					 = "t͡si",  = "n.n",  = "m.m",
					 = "p.p",  = "t.t",  = "k.k" }
	-- Monographs
	local map1L = {  = "ɣ",  = "ɜ",  = "ɔ",  = "ʁ",  = "ˈ" }
	
	local vow = {"a", "e", "i", "o", "u"}
	
	for I = 1, #word do
		local let0 = word:sub(I, I)
		local let1 = word:sub(I + 1, I + 1)
		local let2 = word:sub(I + 2, I + 2)
		if contains(let0, vow) and let1 ~= " " and contains(let2, vow) then
			word = word:sub(1, I) .. "." .. word:sub(I + 1)
		elseif contains(let0, vow) and contains(let1, vow) and let0 ~= let1 then
			word = word:sub(1, I) .. "." .. word:sub(I + 1)
		end
	end
	
	for let, res in pairs(map3L) do
		word = mw.ustring.gsub(word, let, res)
	end
	
	for let, res in pairs(map2L) do
		word = mw.ustring.gsub(word, let, res)
	end
	
	for let, res in pairs(mapGL) do
		word = mw.ustring.gsub(word, let, res)
	end
	
	for let, res in pairs(map1L) do
		word = mw.ustring.gsub(word, let, res)
	end
	
	word = mw.ustring.gsub(word, "ː.", "ː")
	
	return ""
	
end

function contains(key, set)
    for k0, val in pairs(set) do
      if val == key then
        return true
      end
    end
    return false
end

return export