Module:yue-pron/Yulin

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



-- This module is for 玉林話 (Yulin Yue), a lect of Yue Chinese
-- Romanisation: Jyutping++ (referred to as jpp below)
-- References:
-- 1. 玉林话研究 (2010) by 梁忠东
-- Also see ]

-- Special features:
--- Tone sandhi (e.g. fung1-ce1)
--- Diminutive (e.g. da4-bek1*)

local export = {}

-- as with Jyutping, we use analysis that groups glide with initial
-- special note: 月 is njoet /ɲœt̚/
local initials = {
	b = "p",  p = "pʰ",  m = "m",  f = "f",
	d = "t",  t = "tʰ",  n = "n",  sl = "ɬ", l = "l",
	z = "t͡ʃ", c = "t͡ʃʰ", nj = "ɲ", s = "ʃ",
	g = "k",  k = "kʰ",  ng = "ŋ", h = "h",
	gw = "kʷ",  kw = "kʰʷ",
	j = "j",  w = "w",
	 = "", -- glottal stop?
}

-- <oeu> /əu/
local finals = {
	a="a", ai="ai", au="au", am="am", an="an", ang="aŋ", ap="ap̚", at="at̚", ak="ak̚",
	e="ɛ",          eu="ɛu", em="ɛm", en="ɛn", eng="ɛŋ", ep="ɛp̚", et="ɛt̚", ek="ɛk̚",
	oe="œ",        oeu="əu",                  oeng="œŋ",         oet="œt̚",oek="œk̚",
	o="ɔ", oi="ɔi", ou="ɔu", om="ɔm", on="ɔn", ong="ɔŋ", op="ɔp̚", ot="ɔt̚", ok="ɔk̚",
	oo="o",        
	i="i",          iu="iu", im="im",="in",        ip="ip̚", it="it̚",
	u="u", ui="ui",                   un="un", ung="ʊŋ",          ut="ut̚", uk="ʊk̚",
	yu="y",                          yun="yn",                   yut="yt̚",
	m="m̩", ng="ŋ̍"
}

-- transforms the coda for diminutives
local function diminutive_coda(text)
	text = text:gsub("()\204\154$",{p="m",t="n",k="ŋ"})
	return text
end

local entering_tone = {
	 = "7",  = "8",  = "9",  = "0"
}

local tones = {
	 = "54", --陰平/上陰入(7)
	 = "33", --陰上/下陰入(8)
	 = "42", --陰去
	 = "32", --陽平/上陽入(9)
	 = "24", --陽上
	 = "21", --陽去/下陽入(0)
	-- for internal use only
	 = "5",
	 = "3",
	 = "2",
	 = "1",
}

local tone_sandhi = {
	="33",="33",="33",="42",="42",="42",="33",="33",="42",="42",
	="21",="21",="21",="21",="21",="21",="21",="21",="21",="21",
	="33",="33",="33",="33",="33",
	="1",="1",="1",="1",="1",="1",="1",="1",="1",="1",
}

local function tone_superscript(text)
	return text:gsub("",{="¹",="²",="³",="⁴",="⁵"})
end

local function validate(text)
	if text:match("%-%l+%d%-") then
		error("Yulin: Only two-syllable sandhi is supported.")
	end
	if text:match("%*%-") then
		error("Yulin: The diminutive sign cannot be placed on the first syllable of a sandhi chain.")
	end
	if text:match("") then
		error("Yulin: Wrong tone (use 1, 2, 4, 6 for entering tones).")
	end
	if text:match("%d%d") then
		error("Yulin: Please use a hyphen to incidate tone sandhi.")
	end
	text = text:gsub(""," ")
	if text:sub(1,1) == " " or text:sub(-1,-1) == " " or text:match("  ") then
		error("Yulin: Empty syllable detected.")
	end
end

function export.jpp_to_ipa(text)
	validate(text)
	text = text:gsub("%f", entering_tone)
	 :gsub("%-(%l+)(%d)", "%2 %1%2")
	 :gsub("+",function(syllable)
		local a,b,c,d = syllable:match("^(??)(%l*)()(?%*?)$")
		if not a then
			error("Yulin: Invalid syllable: " .. syllable)
		end
		a = initials or error("Yulin: Unrecognised initial: " .. a)
		b = finals or error("Yulin: Unrecognised final: " .. b)
		if d == "*" then
			b = diminutive_coda(b)
		end
		local tone2 = (d == "*" and "35" or d ~= "" and tone_sandhi)
		return a .. b .. tones .. (tone2 and ("⁻"..tone2) or "")
	end)
		:gsub(",", "/, /")
	return "/" .. tone_superscript(text) .. "/"
end

return export