Module:User:Mofvanes/moh-pron

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


--- I'm gonna be taking inspiration from how de-IPA does it

--- It won't be able to handle i, en, and on at the beginning

local export = {}

local rfind = mw.ustring.find
local rsubn = mw.ustring.gsub
local ulower = mw.ustring.lower
local str_len = mw.ustring.len

local function rsub(term, foo, bar)
	local retval = rsubn(term, foo, bar)
	return retval
end

function export.IPA(text, pos)
	if type(text) == 'table' then
		text, pos = "Kahnawà:ke", "noun"
	end
	text = text or mw.title.getCurrentTitle().text
	text = ulower(text)
	text = mw.ustring.toNFD(text)
	
	text = rsub(text, "t()", "d%1")
	text = rsub(text, "t()", "d%1")
	text = rsub(text, "k()", "g%1")
	text = rsub(text, "s()", "z%1")
	text = rsub(text, ":", "ː")
	text = "/" .. text .. "/"
	return text
end

function export.assign_stress(frame)
	PAGENAME = mw.title.getCurrentTitle().text
	text = frame.args 
	if text == nil or text == "" then
		text = "Kahnawa’ke"
	end
	mod_text = text
	for i = 1, str_len(text) do
		mod_text = rsub(mod_text, "", "V")
		mod_text = rsub(mod_text, "", "L")
		mod_text = rsub(mod_text, "", "C")
	end
	return mod_stress
end

return export