Module:User:Bababashqort:ky-translit

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

Language code in page name (User:Bababashqort:ky) not recognized.


local export = {}

local m_IPA = require("Module:IPA")
local lang = require("Module:languages").getByCode("ky")

local C = "" -- consonants
local bV = ""
local fV = ""
local iV = "" -- iotated vowels

local lowerc = {
	="а", ="б", ="в", ="г", ="д", ="е", 
	="ё", ="ж", ="з", ="и", ="й", ="к", 
	="л", ="м", ="н", ="ң", ="о", ="ө", 
	="п", ="р", ="с", ="т", ="у", ="ү", 
	="ф", ="х", ="ц", ="ч", ="ш", ="щ", 
	="ъ", ="ы", ="ь", ="э", ="ю", ="я"
}

local phon = {
="b", ="ɡ", ="d", ="d͡ʒ", ="z", ="j",
="k", ="l̴", ="m", ="n", ="ŋ", ="p", 
="r", ="s", ="t", ="t͡ʃ", ="ʂ", ="e",
="jo", ="ju", ="jɑ", ="ɑ", ="ɯ", ="o", 
="u", ="e", ="i", ="ø", ="y", ="v", 
="f", ="x", ="t͡s", ="t͡ʃ", ="ɕ", ="ʲ"
}

local function phonetic(text)
	text = mw.ustring.gsub(text, '.', lowerc)
    text = mw.ustring.gsub(text, '.', phon)
    
	-- Handle к, г uvularization rules
	text = mw.ustring.gsub(text, "k", "q%1")
	text = mw.ustring.gsub(text, "g", "ʁ%1")
	text = mw.ustring.gsub(text, "k", "%1q")
	text = mw.ustring.gsub(text, "g", "%1ʁ")
	text = mw.ustring.gsub(text, "kq", "q")
	text = mw.ustring.gsub(text, "gʁ", "ʁ")
	text = mw.ustring.gsub(text, "k", "%1q")
	text = mw.ustring.gsub(text, "g", "%1ʁ")
	
	-- Handle ш rules
	text = mw.ustring.gsub(text, "ʂ", "ʃ%1")
	text = mw.ustring.gsub(text, "ʂ", "%1ʃ")
	text = mw.ustring.gsub(text, "ʂʃ", "ʃ")
	text = mw.ustring.gsub(text, "ʃʂ", "ʃ")

	-- Handle l rules
	text = mw.ustring.gsub(text, "l̴", "l%1")
	text = mw.ustring.gsub(text, "l̴", "%1l")
	text = mw.ustring.gsub(text, "ll̴", "l̴")
	text = mw.ustring.gsub(text, "l̴l", "l̴")
	
	-- Handle long vowels
	text = mw.ustring.gsub(text, "ɑ", "ɑː")
	text = mw.ustring.gsub(text, "o", "oː")
	text = mw.ustring.gsub(text, "u", "uː")
	text = mw.ustring.gsub(text, "e", "eː")
	text = mw.ustring.gsub(text, "ø", "øː")
	text = mw.ustring.gsub(text, "y", "yː")
	return text
end

function export.IPA(frame)
	local words = {}

	for _, word in ipairs(frame:getParent().args) do
		table.insert(words, word)
	end

	if #words == 0 then
		words = {mw.title.getCurrentTitle().text}
	end

	local IPA_results = {}
	
	for _, word in ipairs(words) do
		table.insert(IPA_results, { pron = "/" .. phonetic(word) .. "/" })
	end
	
	return m_IPA.format_IPA_full { lang = lang, items = IPA_results }
end

return export