Module:te-IPA

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


local export = {}

local consonants = {
	='k', ='kʰ', ='ɡ', ='ɡʱ', ='ŋ',
	='t͡ɕ', ='t͡ɕʰ', ='d͡ʑ', ='d͡ʑʱ', ='ɲ',
	='ʈ', ='ʈʰ', ='ɖ', ='ɖʱ', ='ɳ',
	='t̪', ='t̪ʰ', ='d̪', ='d̪ʱ', ='n',
	='p', ='pʰ', ='b', ='bʱ', ='m',
	='j', ='ɾ', ='l', ='ʋ', ='ɭ',
	='ɕ', ='ʂ', ='s', ='h', ='r',
	='ɻ', ='t͡s', ='d͡z', ='d', 
	='q', ='x', ='ɣ', ='z', ='ʒ', ='f', ='ɽ', ='ɽʱ',
	=''
}

local vowel_diacritics = {
	= 'aː', ='i', ='iː', ='u', ='uː',
	= 'ɻ̍', ='ɻ̍ː', ='l̩', ='l̩ː',
	='e', ='eː', ='ai', ='o', ='oː', ='au',
	='',	-- Virama - suppresses the inherent vowel "a"
	 = 'a'	-- No diacritic; inherent vowel
}

local other = {
	-- Independent vowels
	='a', ='aː', ='i', ='iː', ='u', ='uː',
	= 'ɻ̍', ='ɻ̍ː', ='l̩', ='l̩ː',
	='e', ='eː', ='ai',
	='o', ='oː', ='au',
	-- Other symbols
	='m̃', ='h',
	='',	-- Chandrabindu - indicates elided nasal; has no effect on pronunciation
	='n',	-- Nakaara pollu - vowelless n
	=''	-- Avagraha - indicates elided vowel due to sandhi; has no effect on pronunciation
--	=''
}

local adjust1 = {
	-- Assimilate the anusvara
	)']='ŋ%1',
	͡)']='ɲ%1', ='ɲ%1',
	)']='ɳ%1',
	̪)']='n̪%1', ͡)']='n̪%1', ='n̪%1',
	)']='m%1',
	='̃ː',
}

local adjust2 = {
	-- Account for differences in phonemes vs. phones
	)'] = 'ɾi%1', ?)'] = 'ɾu%1',
	)'] = 'li%1', ?)'] = 'lu%1',
	 = 'aj', ='aw',
	='t͡ʃ', ='d͡ʒ',
	='ʃ',
	='nd', ='nd',
}

function export.to_IPA(text)

	text = mw.ustring.gsub(
		text,
		'()(఼?)(?)',
		function(c, n, d)
			return ((consonants or consonants) or c) .. vowel_diacritics
		end)

	text = mw.ustring.gsub(text, '', other)

	for k, v in pairs(adjust1) do
		text = mw.ustring.gsub(text, k, v)
	end

	-- Account for consonant gemination
	text = mw.ustring.gsub(text, "(?)%1", "%1ː")
	text = mw.ustring.gsub(text, "(̪?)%1", "%1ː")
	text = mw.ustring.gsub(text, "(͡?)%1", "%1ː")
	text = mw.ustring.gsub(text, "(͡)%1", "%1ː")
	text = mw.ustring.gsub(text, "()%1", "r")
	text = mw.ustring.gsub(text, "ː?ː?", "rː")
	text = mw.ustring.gsub(text, "ɭː?lː?", "ɭː")
	text = mw.ustring.gsub(text, "lː?ɭː?", "ɭː")

	-- If an independent vowel is after another vowel, assume diphthong
	text = mw.ustring.gsub(text, "(ː?)•", "%1")

	-- Phonetic transcription
	text2 = text
	for k, v in pairs(adjust2) do
		text2 = mw.ustring.gsub(text2, k, v)
	end

	return (text == text2 and { text } or { text, text2 })

end

function export.show(frame)
	local args = frame:getParent().args
	local page_title = mw.title.getCurrentTitle().text
	local text = args or page_title
	local qualifier = args or nil

	local transcriptions = export.to_IPA(text)
	local IPA_text
	if not transcriptions then
		IPA_text = require("Module:IPA").format_IPA_full {
			lang = require("Module:languages").getByCode("te"),
			items = {{ pron = "/" .. transcriptions .. "/" }},
		}
	else
		IPA_text = require("Module:IPA").format_IPA_full {
			lang = require("Module:languages").getByCode("te"),
			items = {{ pron = "/" .. transcriptions .. "/" }, { pron = " .. "]" }},
		}
	end

	return (qualifier and require("Module:qualifier").format_qualifier{qualifier} .. " " or "")
		.. IPA_text
end

return export