Module:User:Saph/dim-IPA

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


local export = {}

--[=[

Dime pronunciation module.
Maybe integrable into a unified Aroid pronunciation module?

]=]--

local m_IPA = require("Module:IPA")
local dim = require("Module:languages").getByCode("dim")
local pagename = mw.loadData("Module:headword/data").pagename

local ulower = mw.ustring.lower

local RETRACT = "\204\160"

local function pron(text)
	text = ulower(text)
	text = text:gsub("dʒ", "j") -- Temporarily encode dʒ for geminate checking
	if text:find("()%1") then error("Invalid geminate.") end
	text = text:gsub("(’?)%1", "%1ː")
		:gsub("n()", "n" .. RETRACT .. "%1")
		:gsub("", { = "ʃ",  = "ʒ",  = "j",  = "ɡ",  = "dʒ"})
		:gsub("p$|(.)p(.)", "%1ɸ%2")
		:gsub("^()", "%1ʰ")
	if text:find("’") then error("Invalid ejective.") end
	return text:gsub("č", "tʃ")
end

function export.make(frame)
	local args = frame:getParent().args
	args = args or pagename
	mw.logObject(pron(args))
	return m_IPA.format_IPA_full{ lang = dim, items = {{ pron = ") .. "]" }} }
end

return export