Module:acn-IPA

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


-- UNDER CONSTRUCTION.
-- Start getting monosyllabic words to work first, then move onto polysyllabic words.

local export = {}

local m_IPA = require("Module:IPA")
local m_str_utils = require("Module:string utilities")
local m_a = require("Module:accent qualifier")
local m_table = require("Module:table")
local lang = require("Module:languages").getByCode("acn")


local gsub = m_str_utils.gsub
local len = m_str_utils.len
local match = m_str_utils.match
local sub = m_str_utils.sub
local find = m_str_utils.find
local char = m_str_utils.char
local upper = m_str_utils.upper
local lower = m_str_utils.lower

-- version of gsub() that discards all but the first return value
local function gsub1(term, foo, bar)
	local retval = gsub(term, foo, bar)
	return retval
end

-- version of gsub() that returns a 2nd argument boolean indicating whether
-- a substitution was made.
local function gsubb(term, foo, bar)
	local retval, nsubs = gsub(term, foo, bar)
	return retval, nsubs > 0
end

-- apply gsub1() repeatedly until no change
local function gsub_repeatedly(term, foo, bar)
	while true do
		local new_term = gsub1(term, foo, bar)
		if new_term == term then
			return term
		end
		term = new_term
	end
end

local function format_accent(qual)
	return m_a.format_qualifiers(lang, {qual})
end

local function squareb(text)
	return ""
end

function IPA(text)
	local ipa = text
	
	-- Tones marked with final consonant letters; default is mid tone
	if not find(ipa, "%f") then
		ipa = gsub(ipa, "(%a)(%A)", "%1˧%2")
	else
		ipa = gsub(ipa, "h%f", "˦")
		ipa = gsub(ipa, "s%f", "˧˩")
	end
	if not find(ipa, "$") then
		ipa = ipa .. "˧"
	end
	
	-- Basic multigraphs
	ipa = gsub(ipa, "ph", "pʰ")
	ipa = gsub(ipa, "th", "tʰ")
	ipa = gsub(ipa, "ts", "tsʰ")
	ipa = gsub(ipa, "ch", "tʃʰ")
	ipa = gsub(ipa, "kh", "kʰ")
	ipa = gsub(ipa, "ng", "ŋ")
	ipa = gsub(ipa, "sh", "ʃ")
	ipa = gsub(ipa, "oeu", "ɯu")
	ipa = gsub(ipa, "oe", "ɯ")
	ipa = gsub(ipa, "uo", "uʌ")
	ipa = gsub(ipa, "ai", "ɑi")
	ipa = gsub(ipa, "au", "ɑu")
	
	-- Monographs
	ipa = gsub(ipa, "c", "cʰ")
	ipa = gsub(ipa, "g", "ɡ")
	ipa = gsub(ipa, "z", "dz")
	ipa = gsub(ipa, "j", "dʒ")
	ipa = gsub(ipa, "y", "j")
	ipa = gsub(ipa, "o", "ɔ")
	ipa = gsub(ipa, "e", "ɛ")
	ipa = gsub(ipa, "v", "aˑ")
	ipa = gsub(ipa, "q", "ʔ")
	
	-- Tense voice; marked with -h- after l, y, and n. The Inglises say it's different from creaky voice, but they still transcribe with creaky diacritics
	ipa = gsub(ipa, "()h(?)", "%1%2̰")
	ipa = gsub(ipa, "(̰)()", "%1%2̰")
	
	-- Syllable breaks
	ipa = gsub(ipa, " ", ".")
	ipa = gsub(ipa, "-", ".")
	
	-- Assimilate n before coda k into a velar nasal
	ipa = gsub(ipa, "nk%f", "ŋk")
	
	-- Render medial -y- as palatalization
	ipa = gsub(ipa, "()j", "%1ʲ")

	return ipa
end

function export.show(frame)
	local parent_args = frame:getParent().args
	local params = {
	 = {},
	 = {},
	 = {},
	 = {},
	 = {},
	}
	local args = require("Module:parameters").process(parent_args, params)
	
	input = args or mw.title.getCurrentTitle().text
	kac_ipa = "/" .. IPA(input) .. "/"
	kac_ipa = m_IPA.format_IPA(lang, kac_ipa)
	ipa = "*" .. format_accent("Myanmar") .. " " .. kac_ipa
	
	-- For Chinese dialects. 
	-- Their pronunciations do not neatly align with the Burmese dialect and its orthography; thus they must be specified manually
	
	if args then
		ipa = ipa .. "\n* " .. format_accent("Lianghe") .. " " .. m_IPA.format_IPA(lang, squareb(args))
	end
	if args then
		ipa = ipa .. "\n* " .. format_accent("Longchuan") .. " " .. m_IPA.format_IPA(lang, squareb(args))
	end
	if args then
		ipa = ipa .. "\n* " .. format_accent("Luxi") .. " " .. m_IPA.format_IPA(lang, squareb(args))
	end
	if args then
		ipa = ipa .. "\n* " .. format_accent("Xiandao") .. " " .. m_IPA.format_IPA(lang, squareb(args))
	end
	
	return ipa
end

return export