Module:ane-IPA

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

Used by {{ane-IPA}}.


local export = {}
local PAGENAME = mw.title.getCurrentTitle().text

local m_IPA = require("Module:IPA")
local lang = require("Module:languages").getByCode("ane")

-- single characters that map to IPA sounds
local phonetic_chars_map = {
	 = "ɑ",
	 = "ʌ̃",
	 = "ɑ̃",
	 = "ᵐb",
	 = "t͡ʃ",
	 = "ⁿd",
	 = "ɤ",
	 = "e",
	 = "ʌ",
	 = "ɛ",
	 = "ɛ̃",
	 = "f",
	 = "ᵑɡ",
	 = "i",
	 = "ĩ",
	 = "ᶮɟ",
	 = "k",	
	 = "l",
	 = "m",
	 = "n",
	 = "o",
	 = "ɔ",
	 = "ɔ̃",
	 = "p",
	 = "r",
	 = "ç",
	 = "t",
     = "u",
	 = "ɨ̃",
	 = "ɨ",
	 = "ũ",
	 = "v",
	 = "w",
	 = "x",
	 = "j",
}

-- character sequences of two that map to IPA sounds
local phonetic_2chars_map = {
	 = "ɑː",
	 = "ʌ̃ː",
	 = "ɑ̃ː",
	 = "ᵐbʷ",
	 = "ʃ",
	 = "ɤː",
	 = "eː",
	 = "ʌː",
	 = "ɛː",
	 = "ɛ̃ː",
	 = "ᵑɡʷ",
	 = "iː",
	 = "ĩː",
	 = "kʷ",
	 = "mʷ",
     = "ŋ",
	 = "ɲ",
     = "oː",
	 = "ɔː",
	 = "ɔ̃ː",
     = "pʷ",
     = "uː",
	 = "ɨ̃ː",
	 = "ɨː",
	 = "ũː",
     = "xʷ",
}

function export.to_IPA(word)
	word = mw.ustring.lower(word)

	local phonetic = word

	for pat, repl in pairs(phonetic_2chars_map) do
		phonetic = phonetic:gsub(pat, repl)
	end

	phonetic = mw.ustring.gsub(phonetic, '.', phonetic_chars_map)

	return ""
end

function export.pronunciation(word)
	if type(word) == "table" then
		word = word.args or word:getParent().args
	end
	if not word or (word == "") then
		word = PAGENAME
	end
	local items = {}
	table.insert(items, {pron = export.to_IPA(word), note = nil})
	return m_IPA.format_IPA_full { lang = lang, items = items }
end

return export