Module:as-IPA

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

Assamese IPA pronunciation module. See {{as-IPA}}.

Testcases

Module:as-IPA/testcases:

4 of 21 tests failed. (refresh)

TextExpectedActualComments
test_all:
Passedমই (moi)mɔɪmɔɪ
Passedদেশ (dex)dɛxdɛx
Passedমোৰ (mür)mʊɹmʊɹ
Passedশক্তি (xokti)xɔk.tixɔk.ti
Passedঔষধ (ouxodh)oʊ.xɔdʱoʊ.xɔdʱ
Failedপৰিয়াল (porial)po.ɹialpɔ.ɹial
Passedসোঁফালে (xü̃phale)xʊ̃.pʰa.lɛxʊ̃.pʰa.lɛ
Passedস্পৰ্শ (sporxo)spɔɹ.xɔspɔɹ.xɔ
Passedনাঙল (naṅol)na.ŋɔlna.ŋɔl
Passedহিংসা (hiṅxa)ɦiŋ.xaɦiŋ.xa
Passedঐতিহাসিক (oitihaxik)oɪ.ti.ɦa.xikoɪ.ti.ɦa.xik
Failedশহা পহু (xoha pohu)xɔ.ɦa po.ɦuxɔ.ɦa pɔ.ɦu
Passedসম্পূৰ্ণ (xompurno)xɔm.puɹ.nɔxɔm.puɹ.nɔ
Failedমগজু (mogozu)mo.ɡo.zumɔ.ɡɔ.zu
Passedবিৱৰণ (biworon)bi.wɔ.ɹɔnbi.wɔ.ɹɔn
Passedৰাজ্য (raizzo)ɹaɪd.ʑɔɹaɪd.ʑɔ
Passedজ্বৰ (zor)zɔɹzɔɹ
Failedঅধিকাৰ (odhikar)o.dʱi.kaɹɔ.dʱi.kaɹ
Passedথকা (thoka)tʰɔ.katʰɔ.ka
Passedখেল (khel)kʰɛlkʰɛl
Passedমানুহ (manuh)ma.nuʱma.nuʱ

local export = {}

local lang = require("Module:languages").getByCode("as")
local sc = require("Module:scripts").getByCode("Beng")
local m_translit = require("Module:as-translit").tr
local m_IPA = require("Module:IPA")

local gsub = mw.ustring.gsub
local gmatch = mw.ustring.gmatch

local correspondences = {
     = "ɡ", 
     = "n",
     = "pʰ",  = "bʱ", 
     = "j",  = "ɹ", 
     = "ɦ",
     = "kʰ",  = "ɡʱ", 
     = "zʱ",  = "tʰ",  = "dʱ", 
     = "ɹʱ",  = "ɹi",
     = "ɔ",  = "ɛ",  = "ʊ",
     = "e",  = "o",  = "oɪ", 
     = "oʊ",
     = "ɔ̃",  = "ɛ̃",  = "ʊ",
     = "ẽ",  = "ɔ̃",  = "a",  = "i",  = "u"
}

local vowels = "aiueoüóéʏɵ"
local syllabify_pattern = "()(+)()"

local function syllabify(text)
	for count = 1, 2 do
		text = gsub(text, syllabify_pattern, function(a, b, c)
			return a .. gsub(gsub(b, "(.)(.+)", "%1.%2"), "^(+)$", ".%1") .. c end)
	end
	return text
end

function export.link(term)
	return require("Module:links").full_link{ term = term, lang = lang, sc = sc }
end

function export.toIPA(text)
	local result = {}
	
	local translit = m_translit(text, lang, sc, "IPA")
	if not translit then
		error('The term "' .. text .. '" could not be transliterated.')
	end
	
    local translit = syllabify(translit)
	
	for character in gmatch(translit, ".") do
		table.insert(result, correspondences or character)
	end
	
	result = table.concat(result)
	result = gsub(result, "()i", "%1ɪ")
	result = gsub(result, "z%.z", "d.ʑ")
	result = gsub(result, "()ɦ", "%1ʱ")
	
	return result
end

function export.make(frame)
	local args = frame:getParent().args
	local pagetitle = mw.title.getCurrentTitle().text
	
	local p, results = {}, {}
	
	if args then
		for index, item in ipairs(args) do
			table.insert(p, (item ~= "") and item or nil)
		end
	else
		p = { pagetitle }
	end
	
	for _, Assamese in ipairs(p) do
		table.insert(results, { pron = "/" .. export.toIPA(Assamese) .. "/" })
	end
	
	return '* ' ..   m_IPA.format_IPA_full { lang = lang, items = results }
end

return export