Module:yue-pron/Taishanese

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


local export = {}

local hsv_initial = {
	 = "p",  = "pʰ",  = "ᵐb",  = "f",  = "v",
	 = "t",  = "tʰ",  = "ⁿd",  = "l",  = "ɬ",
	 = "k",  = "kʰ",  = "ᵑɡ", 
	 = "t͡s",  = "t͡sʰ",
	 = "j",  = "s",  = "h",  = ""
}

local hsv_final = {
	 = "a",  = "ai",  = "au",  = "am",
	 = "an",  = "aŋ",  = "ap̚",  = "at̚",
	 = "ak̚", 

	 = "i",  = "iu",  = "im",  = "in", 
	 = "ip̚",  = "it̚",

	 = "iɛ",  = "iau",  = "iam",  = "iaŋ", 
	 = "iap̚",  = "iak̚",

	 = "u",  = "ui",  = "un",  = "ut̚", 

	 = "ə",  = "ei",  = "eu",  = "em",  = "en", 
	 = "ɵŋ",  = "ep̚",  = "et̚",  = "ɵk̚",  = "ɵt̚",

	 = "ᵘɔ",  = "ᵘɔi",  = "ᵘɔn",  = "ɔŋ", 
	 = "ᵘɔt̚",  = "ɔk̚", 
	
	 = "m̩"
}

local hsv_tone = { ="³³", ="⁵⁵", ="²²", ="²¹", ="³²" }

function export.hoisanva_to_ipa(text)
	if text:match("2%*") or text:match("()%-%1") then
		error("Invalid Taishanese tone.")
	end
	
	text = text:gsub("+",function(syllable)
		local initial, final, tone, tone_ch = syllable:match("^(*)(*)()(??%*?)$")
		if final == "" then initial, final = "", initial end
		initial, final, tone = hsv_initial, hsv_final, hsv_tone
		if not initial or not final then
			error("Invalid Taishanese syllable: " .. syllable)
		end
		local tone2 = false
		if tone_ch == "*" then
			tone2 = tone .. "⁵"
		elseif tone_ch:match("^%-%*?$") then
			tone2 = hsv_tone
				.. (tone_ch:sub(3,3) == "*" and "⁵" or "")
		elseif tone_ch ~= "" then
			error("Invalid Taishanese syllable: " .. syllable)
		end
		return initial..final..tone..(tone2 and ("⁻"..tone2) or "")
	end)
		:gsub(",","/, /")
	return "/" .. text .. "/"
end

return export