Module:User:Santi2222/el-IPA

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


local export = {}

function export.show(word, phonetic)
	if type(word) == 'table' then
		do_debug = word.args
		word = word.args
	end
	local orig_word = word
	word = mw.ustring.lower(word or mw.title.getCurrentTitle().text)
	
	local stress = "ˈ"
	local sep = "."
	local orthV = "" -- (orthografic) vowels
	local orthC = "" -- (orthografic) voiced consonants
	local V = "" -- vowels
	local W = "" 
	local C = "" -- consonants
	
	--simple  phonemic transcription (vowels)
	--α
	word = mw.ustring.gsub(word, "αι", "e")
	word = mw.ustring.gsub(word, "αί", "é")
	word = mw.ustring.gsub(word, "αϊ", "a.i")
	word = mw.ustring.gsub(word, "αϋ", "a.i")
	word = mw.ustring.gsub(word, "αΐ", "a.í")
	word = mw.ustring.gsub(word, "αΰ", "a.í")
	word = mw.ustring.gsub(word, "αυ(" .. orthC .. ")", "av%1")
	word = mw.ustring.gsub(word, "αυ(" .. orthV .. ")", "av%1")
	word = mw.ustring.gsub(word, "αυ", "af")
	word = mw.ustring.gsub(word, "αύ(" .. orthC .. ")", "áv%1")
	word = mw.ustring.gsub(word, "αύ(" .. orthV .. ")", "áv%1")
	word = mw.ustring.gsub(word, "αύ", "áf")
	word = mw.ustring.gsub(word, "άι", "áj")
	word = mw.ustring.gsub(word, "άυ", "áj")
	word = mw.ustring.gsub(word, "ά", "á")
	word = mw.ustring.gsub(word, "α", "a")
	--ε
	word = mw.ustring.gsub(word, "ει", "i")
	word = mw.ustring.gsub(word, "εί", "í")
	word = mw.ustring.gsub(word, "εϊ", "e.i")
	word = mw.ustring.gsub(word, "εϋ", "e.i")
	word = mw.ustring.gsub(word, "εΐ", "e.í")
	word = mw.ustring.gsub(word, "εΰ", "ε.í")
	word = mw.ustring.gsub(word, "ευ(" .. orthC .. ")", "ev%1")
	word = mw.ustring.gsub(word, "ευ(" .. orthV .. ")", "ev%1")
	word = mw.ustring.gsub(word, "ευ", "ef")
	word = mw.ustring.gsub(word, "εύ(" .. orthC .. ")", "év%1")
	word = mw.ustring.gsub(word, "εύ(" .. orthV .. ")", "év%1")
	word = mw.ustring.gsub(word, "εύ", "éf")
	word = mw.ustring.gsub(word, "ε", "e")
	word = mw.ustring.gsub(word, "έι", "éj")
	word = mw.ustring.gsub(word, "έυ", "éj")
	word = mw.ustring.gsub(word, "έ", "é")
	--η
	word = mw.ustring.gsub(word, "ηυ(" .. orthC .. ")", "iv%1")
	word = mw.ustring.gsub(word, "ηυ(" .. orthV .. ")", "iv%1")
	word = mw.ustring.gsub(word, "ηυ", "if")
	word = mw.ustring.gsub(word, "ηύ(" .. orthC .. ")", "ív%1")
	word = mw.ustring.gsub(word, "ηύ(" .. orthV .. ")", "ív%1")
	word = mw.ustring.gsub(word, "ηύ", "íf")
	word = mw.ustring.gsub(word, "ή", "í")
	word = mw.ustring.gsub(word, "η", "i")
	--ο
	word = mw.ustring.gsub(word, "οι", "i")
	word = mw.ustring.gsub(word, "οί", "í")
	word = mw.ustring.gsub(word, "οϊ", "o.i")
	word = mw.ustring.gsub(word, "οΐ", "o.í")
	word = mw.ustring.gsub(word, "οϋ", "e.i")
	word = mw.ustring.gsub(word, "οΰ", "o.í")
	word = mw.ustring.gsub(word, "ου", "u")
	word = mw.ustring.gsub(word, "ού", "ú")
	word = mw.ustring.gsub(word, "ο", "o")
	word = mw.ustring.gsub(word, "όι", "ój")
	word = mw.ustring.gsub(word, "όυ", "ój")
	word = mw.ustring.gsub(word, "ό", "ó")
	--υ, ι, ω
	word = mw.ustring.gsub(word, "υι", "i")
	word = mw.ustring.gsub(word, "υ", "i")
	word = mw.ustring.gsub(word, "ύ", "í")
	word = mw.ustring.gsub(word, "ι", "i")
	word = mw.ustring.gsub(word, "ί", "í")
	word = mw.ustring.gsub(word, "ω", "o")
	word = mw.ustring.gsub(word, "ώ", "ó")
	
	--consonants (mp and nt will be dealt with later)
	--γ
	word = mw.ustring.gsub(word, "γγ", "nɡ")
	word = mw.ustring.gsub(word, "γκ", "ɡ")
	word = mw.ustring.gsub(word, "γξ", "nks")
	word = mw.ustring.gsub(word, "γχ", "nx")
	word = mw.ustring.gsub(word, "γ", "ɣ")
	--all others (θ is kept)
	word = mw.ustring.gsub(word, "β", "v")
	word = mw.ustring.gsub(word, "δ", "ð")
	word = mw.ustring.gsub(word, "ζ", "z")
	word = mw.ustring.gsub(word, "κ", "k")
	word = mw.ustring.gsub(word, "λ", "l")
	word = mw.ustring.gsub(word, "μ", "m")
	word = mw.ustring.gsub(word, "ν", "n")
	word = mw.ustring.gsub(word, "ξ", "ks")
	word = mw.ustring.gsub(word, "π", "p")
	word = mw.ustring.gsub(word, "ρ", "ɾ")
	word = mw.ustring.gsub(word, "σ", "s")
	word = mw.ustring.gsub(word, "ς", "s")
	word = mw.ustring.gsub(word, "τ", "t")
	word = mw.ustring.gsub(word, "φ", "f")
	word = mw.ustring.gsub(word, "χ", "x")
	word = mw.ustring.gsub(word, "ψ", "ps")
	
	--simplify orthografic double consonants (needs to be checked)
	word = mw.ustring.gsub(word, "nn", "n")
	word = mw.ustring.gsub(word, "ss", "s")
	word = mw.ustring.gsub(word, "ll", "l")

	--initial mp and nt
	word = mw.ustring.gsub(word,'(.?)mp(.?)',
		function (before, after)
			if before == '' then
				return before .. 'b' .. after
			end
		end)
	word = mw.ustring.gsub(word,'(.?)nt(.?)',
		function (before, after)
			if before == '' then
				return before .. 'd' .. after
			end
		end)
	
	--affricates
	word = mw.ustring.gsub(word, "tz", "ź") --wrong symbol, to be corrected at the end
	word = mw.ustring.gsub(word, "ts", "ś")
	
	--syllable division (needs to be checked)
	for _ = 1, 2 do
		word = mw.ustring.gsub(word,
			"(" .. V .. ")(" .. C .. W .. "?" .. V .. ")",
			"%1.%2")
	end
	for _ = 1, 2 do
		word = mw.ustring.gsub(word,
			"(" .. V .. C .. ")(" .. C .. V .. ")",
			"%1.%2")
	end
	for _ = 1, 2 do
		word = mw.ustring.gsub(word,
			"(" .. V .. C .. ")(" .. C .. C .. V .. ")",
			"%1.%2")
	end
	word = mw.ustring.gsub(word, "(" .. V .. ")(" .. V .. ")", "%1.%2")
	word = mw.ustring.gsub(word, "()%.()", ".%1%2")
	word = mw.ustring.gsub(word, "(" .. C .. ")%.s(" .. C .. ")", "%1s.%2")
	word = mw.ustring.gsub(word, "()()", "%1.%2")
	word = mw.ustring.gsub(word, "()()", "%1.%2")
	word = mw.ustring.gsub(word, "()()", "%1.%2")
	
	--palatals
	word = mw.ustring.gsub(word, "k()", "c%1")
	word = mw.ustring.gsub(word, "ɡ()", "ɟ%1")
	word = mw.ustring.gsub(word, "x()", "ç%1")
	word = mw.ustring.gsub(word, "ɣ()", "ʝ%1")
	
	--symplify "palatal + i + vowel" to "palatal + vowel"
	word = mw.ustring.gsub(word, "()i.()", "%1%2")

	--accentuation
	local syllables = mw.text.split(word, "%.")
	if mw.ustring.find(word, "") then
		for i = 1, #syllables do
			if mw.ustring.find(syllables, "") then
				syllables = "ˈ"..syllables
			end
		end
	end
	
	word = table.concat(syllables,".")
	word = mw.ustring.gsub(word, ".ˈ", "ˈ")

	--vowel quality (if phonetic)
	if phonetic then
		word = mw.ustring.gsub(word, "a", "ɐ")
		word = mw.ustring.gsub(word, "e", "e̞")
		word = mw.ustring.gsub(word, "o", "o̞")
	end
	--remove accents
	if phonetic then
		word = mw.ustring.gsub(word, "á", "ɐˑ")
		word = mw.ustring.gsub(word, "é", "e̞ˑ")
		word = mw.ustring.gsub(word, "ó", "o̞ˑ")
		word = mw.ustring.gsub(word, "ú", "uˑ")
		word = mw.ustring.gsub(word, "í", "iˑ")
	else
		word = mw.ustring.gsub(word, "á", "a")
		word = mw.ustring.gsub(word, "é", "e")
		word = mw.ustring.gsub(word, "ó", "o")
		word = mw.ustring.gsub(word, "ú", "u")
		word = mw.ustring.gsub(word, "í", "i")
	end
	
	--other phonetic stuff
	if phonetic then
		word = mw.ustring.gsub(word, "n.()", "ɲ̟.%1")
		word = mw.ustring.gsub(word, "n.()", "ŋ.%1")
		word = mw.ustring.gsub(word, "m.f", "ɱ.f")
	end
	
	--correct symbols for affricates
	word = mw.ustring.gsub(word, "ź", "d͡z")
	word = mw.ustring.gsub(word, "ś", "t͡s")
	return word
end

function export.phonetic(frame)
	return export.show(frame, true)
end

return export