Module:ce-IPA

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


local export = {}
local PAGENAME = mw.title.getCurrentTitle().text
local m_IPA = require("Module:IPA")
local lang = require("Module:languages").getByCode("ce")

local scripts_IPA_single = {
	 = "a",  = "b",  = "u̯",  = "ɡ",  = "d",  = "e",  = "jo",  = "ʒ", 
	 = "z",  = "i",  = "i̯",  = "k",  = "l",  = "m",  = "n",  = "o", 
	 = "p",  = "r",  = "s",  = "t",  = "u",  = "f",  = "x",  = "t͡s", 
	 = "t͡ʃ",  = "ʃ",  = "ʃt͡ʃ",  = "ʔ",  = "ɨ",  = "ʲ",  = "e",  = "ju", 
	 = "ja",  = "ʕ",  = "eː",  = "aː",  = "oː",  = "oː",  = "ː",
}

local scripts_IPA_double = {
	 = "ʁ",  = "q͡x",  = "q͡xʼ",  = "kʼ",  = "pʼ",  = "tʼ",  = "ħ", 
	 = "h",  = "t͡sʼ",  = "t͡ʃʼ",  = "tː",  = "pː",  = "kː",  = "sː", 
	 = "iː",  = "uː",  = "u̯o",  = "uːo̯",  = "i̯e",  = "iːe̯",  = "æ",
}

local scripts_IPA_triple = {
	 = "q͡xː",  = "r̥",  = "yː",
}

local scripts_IPA_diphthongs = {
	 = "eu̯",  = "ou̯",  = "oi̯",  = "ai̯",
}

function export.to_IPA(word)
    word = mw.ustring.lower(word)
    
    for pat, repl in pairs(scripts_IPA_triple) do
        word = mw.ustring.gsub(word, pat, repl)
    end
    
    for pat, repl in pairs(scripts_IPA_double) do
        word = mw.ustring.gsub(word, pat, repl)
    end
    
    for pat, repl in pairs(scripts_IPA_diphthongs) do
        word = mw.ustring.gsub(word, pat, repl)
    end

    local consonants = ""
    word = mw.ustring.gsub(word, "о̄(" .. consonants .. consonants .. ")", function(post)
        return "ɔ̯a" .. post
    end)
    
    word = "ˈ" .. word
    
    word = mw.ustring.gsub(word, ".", function(char)
        return scripts_IPA_single or char
    end)
    
    return "/" .. word .. "/"
end

function export.pronunciation(frame)
    local args = frame:getParent().args
    local word = args or args or mw.title.getCurrentTitle().text
    
    local ipa = export.to_IPA(word)
    
    local items = { { pron = ipa, note = nil } }
    return m_IPA.format_IPA_full { lang = lang, items = items }
end

return export