Module:cdo-pron

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

Min Dong pronunciation module.


local export = {}

local gsub = mw.ustring.gsub
local sub = mw.ustring.sub
local len = mw.ustring.len
local match = mw.ustring.match
local lower = mw.ustring.lower

local split_tone = {
	 = "a".."̆",  = "e".."̆",  = "i".."̆",  = "o".."̆",  = "u".."̆",
	 = "a".."̄",  = "e".."̄",  = "i".."̄",  = "o".."̄",  = "u".."̄",
	 = "a".."́",  = "e".."́",  = "i".."́",  = "o".."́",  = "u".."́",
	 = "a".."̀",  = "e".."̀",  = "i".."̀",  = "o".."̀",  = "u".."̀",
	 = "a".."̂",  = "e".."̂",  = "i".."̂",  = "o".."̂",  = "u".."̂",
}

local tone_from_mark = {
	 = 1,  = 1,  = 7,  = 7,
	 = 2,
	 = 3,
	 = "4A",  = "4B",
	 = 5,
	 = 6
}

local initial_ipa = {
	 = {  = "p",  = "<sup>(p-)</sup>β",  = "<sup>(p-)</sup>m" },
	 = {  = "pʰ",  = "<sup>(pʰ-)</sup>β",  = "<sup>(pʰ-)</sup>m" },
	 = {  = "m",  = "m",  = "m" },
	 = {  = "t",  = "<sup>(t-)</sup>l",  = "<sup>(t-)</sup>n" },
	 = {  = "tʰ",  = "<sup>(tʰ-)</sup>l",  = "<sup>(tʰ-)</sup>n" },
	 = {  = "nˡ",  = "nˡ",  = "nˡ" },
	 = {  = "l̃",  = "l̃",  = "<sup>(l-)</sup>nˡ" },
	 = {  = "k",  = "<sup>(k-)</sup>",  = "<sup>(k-)</sup>ŋ" },
	 = {  = "kʰ",  = "<sup>(kʰ-)</sup>",  = "<sup>(kʰ-)</sup>ŋ" },
	 = {  = "ŋ",  = "ŋ",  = "ŋ" },
	 = {  = "h",  = "<sup>(h-)</sup>",  = "<sup>(h-)</sup>ŋ" },
	 = {  = "t͡s",  = "<sup>(t͡s-)</sup>ʒ",  = "<sup>(t͡s-)</sup>ʒ" },
	 = {  = "t͡sʰ",  = "<sup>(t͡sʰ-)</sup>ʒ",  = "<sup>(t͡sʰ-)</sup>ʒ" },
	 = {  = "s",  = "<sup>(s-)</sup>l",  = "<sup>(s-)</sup>n" },
	 = {  = "",  = "",  = "<sup>(Ø-)</sup>ŋ" },
}

local final_ipa = {
		= {  = "a",		 = "ɑ"	}, 
		= {  = "ɛ",		 = "ɑ"	}, 
		= {  = "œ",		 = "ɔ"	}, 
		= {  = "øyʔ",	 = "ɔyʔ"	},--see ]
		= {  = "øyʔ",	 = "ɔyʔ"	},
		= {  = "øyŋ",	 = "ɔyŋ"	}, 
		= {  = "aʔ",	 = "ɑʔ"	}, 
		= {  = "ɛʔ",	 = "ɑʔ"	}, 
		= {  = "ai",	 = "ɑi"	}, 
		= {  = "ɛiʔ",	 = "aiʔ"	}, 
		= {  = "ɛiŋ",	 = "aiŋ"	}, 
		= {  = "ɛu",	 = "ɑu"	}, 
		= {  = "aʔ",	 = "ɑʔ"	}, 
		= {  = "aŋ",	 = "ɑŋ"	}, 
		= {  = "au",	 = "ɑu"	}, 
		= {  = "ouʔ",	 = "ɑuʔ"	}, 
		= {  = "ouŋ",	 = "ɑuŋ"	}, 
		= {  = "i",		 = "ɛi"	}, 
		= {  = "œ",		 = "ɔ"	}, 
		= {  = "ɛiʔ",	 = "ɛiʔ"	},--see ]
		= {  = "œʔ",	 = "œʔ"	}, 
		= {  = "ɛiʔ",	 = "aiʔ"	}, 
		= {  = "iʔ",	 = "ɛiʔ"	}, 
		= {  = "øyʔ",	 = "ɔyʔ"	}, 
		= {  = "ɛiŋ",	 = "aiŋ"	}, 
		= {  = "iŋ",	 = "ɛiŋ"	}, 
		= {  = "øyŋ",	 = "ɔyŋ"	}, 
		= {  = "ɛu",	 = "ɑu"	}, 
		= {  = "ieu",	 = "iɛu"	}, 
		= {  = "y",		 = "øy"	}, 
		= {  = "yʔ",	 = "øyʔ"	}, 
		= {  = "yŋ",	 = "øyŋ"	}, 
		= {  = "i",		 = "ɛi"	}, 
		= {  = "ia",	 = "iɑ"	}, 
		= {  = "iaʔ",	 = "iɑʔ"	}, 
		= {  = "iaʔ",	 = "iɑʔ"	}, 
		= {  = "iaŋ",	 = "iɑŋ"	}, 
		= {  = "iau",	 = "iau"	}, 
		= {  = "ie",	 = "iɛ"	}, 
		= {  = "ieʔ",	 = "iɛʔ"	}, 
		= {  = "ieʔ",	 = "iɛʔ"	}, 
		= {  = "ieŋ",	 = "iɛŋ"	}, 
		= {  = "ieu",	 = "iɛu"	}, 
		= {  = "iʔ",	 = "ɛiʔ"	}, 
		= {  = "iʔ",	 = "ɛiʔ"	}, 
		= {  = "iŋ",	 = "ɛiŋ"	}, 
		= {  = "yo",	 = "yɔ"	}, 
		= {  = "yoʔ",	 = "yɔʔ"	}, 
		= {  = "yoʔ",	 = "yɔʔ"	}, 
		= {  = "yoŋ",	 = "yɔŋ"	}, 
		= {  = "ieu",	 = "iɛu"	}, 
		= {  = "ŋ̍",		 = "ŋ̍"	},
		= {  = "u",		 = "ou"	}, 
		= {  = "o",		 = "ɔ"	}, 
		= {  = "uʔ",	 = "ouʔ"	}, 
		= {  = "oʔ",	 = "ɔʔ"	}, 
		= {  = "øy",	 = "ɔy"	}, 
		= {  = "ui",	 = "ui"	}, 
		= {  = "øy",	 = "ɔy"	}, 
		= {  = "ouʔ",	 = "ɔuʔ"	}, 
		= {  = "uʔ",	 = "ouʔ"	}, 
		= {  = "oʔ",	 = "ɔʔ"	}, --see ]
		= {  = "ouŋ",	 = "ɔuŋ"	}, 
		= {  = "uŋ",	 = "ouŋ"	}, 
		= {  = "u",		 = "ou"	}, 
		= {  = "y",		 = "øy"	}, 
		= {  = "ua",	 = "uɑ"	}, 
		= {  = "uaʔ",	 = "uɑʔ"	}, 
		= {  = "uai",	 = "uɑi"	}, 
		= {  = "uaʔ",	 = "uɑʔ"	}, 
		= {  = "uaŋ",	 = "uɑŋ"	}, 
		= {  = "ui",	 = "ui"	}, 
		= {  = "uʔ",	 = "ouʔ"	}, 
		= {  = "yʔ",	 = "øyʔ"	}, 
		= {  = "uŋ",	 = "ouŋ"	}, 
		= {  = "yŋ",	 = "øyŋ"	}, 
		= {  = "uo",	 = "uɔ"	}, 
		= {  = "uoʔ",	 = "uɔʔ"	}, 
		= {  = "ui",	 = "ui"	}, 
		= {  = "uoʔ",	 = "uɔʔ"	}, 
		= {  = "uoŋ",	 = "uɔŋ"	}, 
}

local tone_ipa = {
	 = "⁵⁵", --陰平
	 = "³³", --上聲
	 = "²¹³", --陰去
	 = "²⁴", --陰入-甲 (-k)
	 = "²⁴", --陰入-乙 (-h)
	 = "⁵³", --陽平
	 = "²⁴²", --陽去
	 = "⁵", --陽入
	 = "²¹", --半陰去
	 = "³⁵", --半陽去
	 = "⁻",
	 = "⁽",
	 = "⁾",
}

local tone_sandhi = {
	 = "1",  = "1",  = "5",  = "5",
	 = "8",  = "8",  = "9",  = "1",
	 = "1",  = "2",  = "2",  = "8",

	 = "8-1",  = "8-1",  = "8-5",  = "8-5",
	 = "8-8",  = "8-8",  = "8-9",  = "8-1",
	
	 = "8-1",  = "8-1",  = "8-5",  = "8-5",
	 = "8-8",  = "8-8",  = "8-9",  = "8-1",
	
	 = "8-1",  = "8-1",  = "8-5",  = "8-5",
	 = "8-8",  = "8-8",  = "8-9",  = "8-1",
	
	 = "1-1",  = "1-1",  = "5-2",  = "5-8",
	 = "9-2",  = "9-2",  = "9-2",  = "1-8",
	 = "2-2",  = "2-2",  = "2-2",  = "8-8",
}

local sylcat = {
	 = {
		 = "A",  = "A",  = "A",  = "A",
		 = "B",  = "B",
		 = "C",  = "C"
	},
	 = {
		 = "I", 
		 = "II",  = "II",
		 = "III",
		 = "IV",  = "IV",  = "IV",  = "IV"
	}
}

local diminutive_sandhi = {
	 = "2",  = "2",  = "2",
	 = "8",  = "8",  = "8",  = "8",
	 = "7"
}

local dual_rimes = {
	 = true,  = true,
	 = true,  = true,
	 = true,
	 = true,
}

local neg_assim = {
	 = "<sup>(ŋ̍-)</sup>m̩",
	 = "<sup>(ŋ̍-)</sup>n̩",
	 = "<sup>(ŋ̍-)</sup>ŋ̍",
	 = "<sup>(ŋ̍-)</sup>ŋ̍/m̩/n̩",
}

local neg_type = {
	 = "labial",  = "labial",  = "labial",
	 = "dental",  = "dental",  = "dental",  = "dental",  = "dental",  = "dental",
	 = "alone",
}

local initial_string = "^(??)"

function export.rom(text)
	return (text
		:gsub("/", " / ")
		:gsub("", "")
		:gsub(">(+)", "<sup>→%1</sup>"))
end

function export.sentence(text)
	local sentence = {}
	text = gsub(text, "", "")
	for word in mw.text.gsplit(lower(text), " ", true) do
		table.insert(sentence, export.ipa(word))
	end
	return table.concat(sentence, " ")
end

local function determ_tone(text)
	local tone = gsub(gsub(text, ".", split_tone), "^*(?)*(?)$", function(tone_symbol, coda)
		return tone_from_mark end)
	return tone
end

function export.ipa(text, feature)
	if type(text) == "table" then
		text = text.args
	end
	text = lower(text)
	local phrase_result = {}
	local words = mw.text.split(text, "/")
	for _, word in ipairs(words) do
		local word_result = {}
		local parts = mw.text.split(word, " ")
		for _, part in ipairs(parts) do
			local initial, final, tone, tone_conv, ipa, exc = {}, {}, {}, {}, {}, {}
			local lenition_blocked, ablaut_blocked, diminutive = {}, {}, {}
			local syllables = mw.text.split(part, "-")
			for index, syllable in ipairs(syllables) do
				syllable = gsub(syllable, "\\$", function(diminutive_syllable) diminutive = true return "" end)
				syllable = gsub(syllable, "!$", function(ablaut_syllable) ablaut_blocked = true return "" end)
				syllable = gsub(syllable, "%*", function(captured_initial) lenition_blocked = true return "" end)
				if match(syllable, ">") then
					tone = determ_tone(gsub(gsub(gsub(syllable, ">+$", ""), initial_string, ""), ".", split_tone))
					syllable = gsub(syllable, "+>", "")
					exc = determ_tone(gsub(syllable, initial_string, ""))
				end
				initial = match(syllable, initial_string)
				final = sub(syllable, len(initial) + 1, -1)
				final = gsub(final, ".", split_tone)
				tone = exc and tone or determ_tone(final)
				final = gsub(final, "", "")
				if dual_rimes] and match(tostring(tone), "") then
					final = final .. "2"
				end
				final = match(initial .. final, "h?io") and gsub(final, "io", "uo") or final
				if (initial .. final) == "ng" then
					initial, final = "", "ng"
				end
			end
			
			if #syllables == 1 or feature == "no_sandhi" then
				tone_conv = tone
			
			elseif #syllables == 2 then
				tone_conv = {
					tone.."-"..(tone_sandhi or tone].."-"..sylcat]]),
					tone
				}
		
			elseif #syllables == 3 then
				sandhi = mw.text.split(tone_sandhi or tone].."-"..
					sylcat or tone].."-"..sylcat]], "-")
				tone_conv = {
					tone.."-"..sandhi,
					tone.."-"..sandhi,
					tone
				}
		
			elseif #syllables == 4 then
				tone_conv = {
					tone.."-"..tone_sandhi or tone].."-"..sylcat]],
					tone.."(-8)",
					tone.."-"..tone_sandhi or tone].."-"..sylcat]],
					tone
				}
				
			end
			
			for index = 1, #syllables do
				if diminutive then tone_conv = gsub(tone_conv, "%-.+$", "-" .. diminutive_sandhi]) end
				if (match(tostring(tone_conv), "?$") and (#syllables == 1 or index == #syllables)) or ablaut_blocked then
					final = final_ipa]
				else
					final = final_ipa]
				end
				local initial_state = (index == 1 or match(syllables, "k!?\\?$") or lenition_blocked)
					and "unchanged" or (match(final, "$") and "nasal" or "lenited")
					
				initial = initial_ipa]
				if final == "ŋ̍" then
					final = neg_assim or "✘", 1, 1)] or "velar"]
				end
				tone_conv = gsub(tone_conv, "(+)%-(+)", function(original, sandhi)
					if original == sandhi then
						return original
					end end)
				tone_conv = gsub(tone_conv, "(?)", tone_ipa)
				ipa = initial .. final .. tone_conv
			end
			table.insert(word_result, table.concat(ipa, " "))
		end
		table.insert(phrase_result, table.concat(word_result, " "))
	end
	return table.concat(phrase_result, "/, /")
end

return export