Jump to content

Module:akk-IPA

From Wiktionary, the free dictionary

This module generates the phonemic IPA transcription of Akkadian entries. It runs {{akk-IPA}}.

Testcases

Module:akk-IPA/testcases:

All tests passed. (refresh)

TextExpectedActualComments
test_pron:
Passedabnumˈab.numˈab.num
Passedabumˈa.bumˈa.bum
Passedadiˈa.diˈa.di
Passedagammumaˈɡam.mumaˈɡam.mum
Passedakalumˈa.ka.lumˈa.ka.lum
Passedakālumaˈkaː.lumaˈkaː.lum
Passedalaktumaˈlak.tumaˈlak.tum
Passedalpumˈal.pumˈal.pum
Passedalākumaˈlaː.kumaˈlaː.kum
Passedamtumˈam.tumˈam.tum
Passedamurdinnuma.murˈdin.numa.murˈdin.num
Passedanākuaˈnaː.kuaˈnaː.ku
Passedaplumˈap.lumˈap.lum
Passedaptumˈap.tumˈap.tum
Passedarārumaˈraː.rumaˈraː.rum
Passedattaˈat.taˈat.ta
Passedattiˈat.tiˈat.ti
Passed-atum-a.tum-a.tum
Passedawīltumaˈwiːl.tumaˈwiːl.tum
Passedawīlumaˈwiː.lumaˈwiː.lum
Passedaššatumˈaʃ.ʃa.tumˈaʃ.ʃa.tum
Passedaḫumˈa.χumˈa.χum
Passedaḫûmaˈχuːmaˈχuːm
Passedaḫātumaˈχaː.tumaˈχaː.tum
Passedbirkumˈbir.kumˈbir.kum
PassedBābilimˈbaː.bi.limˈbaː.bi.lim
Passedbābumˈbaː.bumˈbaː.bum
Passedbēltumˈbeːl.tumˈbeːl.tum
Passedbēlumˈbeː.lumˈbeː.lum
Passedbītumˈbiː.tumˈbiː.tum
Passeddamāqumdaˈmaː.qumdaˈmaː.qum
Passeddanānumdaˈnaː.numdaˈnaː.num
Passeddayyānumdajˈjaː.numdajˈjaː.num
Passeddārumˈdaː.rumˈdaː.rum
Passedeleppumeˈlep.pumeˈlep.pum
Passedelēpumeˈleː.pumeˈleː.pum
Passedemūqumeˈmuː.qumeˈmuː.qum
Passedeperumˈe.pe.rumˈe.pe.rum
Passederbumˈer.bumˈer.bum
Passedergilumˈer.ɡi.lumˈer.ɡi.lum
Passederṣetumˈer.sˤe.tumˈer.sˤe.tum
Passedgišimmarumɡiˈʃim.ma.rumɡiˈʃim.ma.rum
Passedidumˈi.dumˈi.dum
Passedilkumˈil.kumˈil.kum
Passediltumˈil.tumˈil.tum
Passedilumˈi.lumˈi.lum
Passedimērumiˈmeː.rumiˈmeː.rum
Passedinaˈi.naˈi.na
Passedittiˈit.tiˈit.ti
Passedišarumˈi.ʃa.rumˈi.ʃa.rum
Passedišdumˈiʃ.dumˈiʃ.dum
PassedIštarˈiʃ.tarˈiʃ.tar
Passedištēniʃˈteːniʃˈteːn
Passediṣumˈi.sˤumˈi.sˤum
Passedkakkabumˈkak.ka.bumˈkak.ka.bum
Passedkalbumˈkal.bumˈkal.bum
Passedkankumˈkan.kumˈkan.kum
Passedkanākumkaˈnaː.kumkaˈnaː.kum
Passedkanīkumkaˈniː.kumkaˈniː.kum
Passedkappumˈkap.pumˈkap.pum
Passedkaspumˈkas.pumˈkas.pum
Passedkašādumkaˈʃaː.dumkaˈʃaː.dum
Passedkirûmkiˈruːmkiˈruːm
Passedkunukkumkuˈnuk.kumkuˈnuk.kum
Passedkāsumˈkaː.sumˈkaː.sum
Passedlamassumlaˈmas.sumlaˈmas.sum
Passedlibbumˈlib.bumˈlib.bum
Passedlûmˈluːmˈluːm
Passedlaːlaː
Passedlīmumˈliː.mumˈliː.mum
Passedlītumˈliː.tumˈliː.tum
Passedmarrumˈmar.rumˈmar.rum
Passedmazzaztummazˈzaz.tummazˈzaz.tum
Passedmidrumˈmid.rumˈmid.rum
Passedmusukkannummu.sukˈkan.nummu.sukˈkan.num
Passedmutumˈmu.tumˈmu.tum
Passedmuškēnummuʃˈkeː.nummuʃˈkeː.num
Passedˈmuːˈmuː
Passedmārtumˈmaːr.tumˈmaːr.tum
Passedmārumˈmaː.rumˈmaː.rum
Passedmātumˈmaː.tumˈmaː.tum
Passedmēsumˈmeː.sumˈmeː.sum
Passednadānumnaˈdaː.numnaˈdaː.num
Passednagbumˈnaɡ.bumˈnaɡ.bum
Passednārumˈnaː.rumˈnaː.rum
Passednīšumˈniː.ʃumˈniː.ʃum
Passedpaššūrumpaʃˈʃuː.rumpaʃˈʃuː.rum
Passedpûmˈpuːmˈpuːm
Passedpān šattimˈpaːn ˈʃat.timˈpaːn ˈʃat.tim
Passedpānumˈpaː.numˈpaː.num
Passedqabûmqaˈbuːmqaˈbuːm
Passedqanûmqaˈnuːmqaˈnuːm
Passedqaqqadumˈqaq.qa.dumˈqaq.qa.dum
Passedqaqqarumˈqaq.qa.rumˈqaq.qa.rum
Passedqarnumˈqar.numˈqar.num
Passedrēšumˈreː.ʃumˈreː.ʃum
Passedsinništumsinˈniʃ.tumsinˈniʃ.tum
Passedsīḫumˈsiː.χumˈsiː.χum
Passeduuu
Passedugārumuˈɡaː.rumuˈɡaː.rum
Passedummumˈum.mumˈum.mum
PassedUrarṭuuˈrar.tˤuuˈrar.tˤu
Passedurrumˈur.rumˈur.rum
Passeduznumˈuz.numˈuz.num
Passedwaklumˈwak.lumˈwak.lum
Passedwalādumwaˈlaː.dumwaˈlaː.dum
Passedwardumˈwar.dumˈwar.dum
Passedwarāqumwaˈraː.qumwaˈraː.qum
Passedwarḫumˈwar.χumˈwar.χum
Passedyâtiˈjaː.tiˈjaː.ti
Passedzikarumˈzi.ka.rumˈzi.ka.rum
Passedzikrumˈzik.rumˈzik.rum
Passedziqqurratumziqˈqur.ra.tumziqˈqur.ra.tum
Passedālikumˈaː.li.kumˈaː.li.kum
Passedālumˈaː.lumˈaː.lum
Passedēkallumeːˈkal.lumeːˈkal.lum
Passedēnumˈeː.numˈeː.num
Passed-iː-iː
Passedīkumˈiː.kumˈiː.kum
Passedīnumˈiː.numˈiː.num
Passedšaʃaʃa
Passedšamaššammumʃa.maʃˈʃam.mumʃa.maʃˈʃam.mum
Passedšammi Šamašˈʃam.mi ˈʃa.maʃˈʃam.mi ˈʃa.maʃ
Passedšammumˈʃam.mumˈʃam.mum
Passedšamnumˈʃam.numˈʃam.num
Passedšamûʃaˈmuːʃaˈmuː
Passedšamšumˈʃam.ʃumˈʃam.ʃum
Passedšarqumˈʃar.qumˈʃar.qum
Passedšarratumˈʃar.ra.tumˈʃar.ra.tum
Passedšarrumˈʃar.rumˈʃar.rum
PassedŠarrum-kīnʃar.rum-ˈkiːnʃar.rum-ˈkiːn
Passedšarrāqumʃarˈraː.qumʃarˈraː.qum
Passedšarāqumʃaˈraː.qumʃaˈraː.qum
Passedšattumˈʃat.tumˈʃat.tum
Passedšinnumˈʃin.numˈʃin.num
Passedšummaˈʃum.maˈʃum.ma
Passedšumumˈʃu.mumˈʃu.mum
Passedšārtumˈʃaːr.tumˈʃaːr.tum
Passedšēdumˈʃeː.dumˈʃeː.dum
Passedšīpātumʃiːˈpaː.tumʃiːˈpaː.tum
Passedšūmūˈʃuː.muːˈʃuː.muː
Passedūmumˈuː.mumˈuː.mum
Passedḫalāqumχaˈlaː.qumχaˈlaː.qum
Passedḫaṣṣinnumχasˤˈsˤin.numχasˤˈsˤin.num
Passedḫurāṣumχuˈraː.sˤumχuˈraː.sˤum
Passedṣerretumˈsˤer.re.tumˈsˤer.re.tum
Passedṣeḫrumˈsˤeχ.rumˈsˤeχ.rum
Passedṣeḫērumsˤeˈχeː.rumsˤeˈχeː.rum
Passedṣuprumˈsˤup.rumˈsˤup.rum
Passedṣuḫārtumsˤuˈχaːr.tumsˤuˈχaːr.tum
Passedṣuḫārumsˤuˈχaː.rumsˤuˈχaː.rum
Passedṣābumˈsˤaː.bumˈsˤaː.bum
Passedṭabtumˈtˤab.tumˈtˤab.tum
Passedṭuppumˈtˤup.pumˈtˤup.pum
Passedṭābumˈtˤaː.bumˈtˤaː.bum

References

  • Huehnergard, John (2018 June 13) “Lesson 1”, in A Grammar of Akkadian (Third Edition) (Harvard Semitic series; Issue 45), Leiden, The Netherlands: Brill, →DOI, →ISBN, pages 1-4

local export = {}

local s = mw.ustring.gsub
local m = mw.ustring.match

local C = "[ʔbdɡχklmnpqrsʃtwjz]"
local V = "[aeiuāēīūâêîû]"
local c = {
	{"ṭ", "tˤ"},
	{"ṣ", "sˤ"},
	{"š", "ʃ"},
	{"y", "j"},
	{"g", "ɡ"},
	{"ḫ", "χ"},
	{"'", "ʔ"},
	{"(" .. V .. C .. "?ˤ?)(" .. C .. "ˤ?)%f" .. V, "%1.%2"}
}
local d = {
	{"[āâ]", "aː"},
	{"[ēê]", "eː"},
	{"[īî]", "iː"},
	{"[ūû]", "uː"}
} 
function export.pronunciation_phonemic(word)
    word = mw.ustring.lower(word)
	for a = 1, #c do
		word = s(word, c[a][1], c[a][2])
	end
	local N = {}
	local i = 0
	for a in string.gmatch(word, "%S+") do
		i = i+1
		N[i] = a
	end
	for a = 1, #N do
		if m(N[a], C .. "?ˤ?[âêîû]$") ~= nil then --last syllable is ultraheavy (circumflex)
			N[a] = s(N[a], "%.?(" .. C .. "?ˤ?[âêîû])$", "ˈ%1") --final stress

		elseif m(N[a], C .. "?ˤ?[āēīūâêîû]" .. C .. "ˤ?$") ~= nil then --again (any long V, + C)
			N[a] = s(N[a], "%.?(" .. C .. "?ˤ?[āēīūâêîû]" .. C .. "ˤ?)$", "ˈ%1") --final stress

		elseif m(s(N[a], C .. "ˤ?" .. V .. C .. "?ˤ?$", ""), C .. "?ˤ?" .. "[āēīūâêîû]%.") ~= nil or m(s(N[a], C .. "ˤ?" .. V .. C .. "?ˤ?$", ""), C .. "?ˤ?" .. "[aeiuāēīū]" .. C .. "ˤ?%.") ~= nil then --otherwise, detects if there is (not where it is) a non-final heavy or ultraheavy syllable (long V, or any non-circumflex + C)
			local n = ""
			for b = 1, 5 do --arbitrary, find how to count syllables
				N[a] = s(N[a], "%.?(" .. C .. "?ˤ?" .. "[āēīūâêîû]%." .. n .. C .. "ˤ?" .. V .. C .. "?ˤ?)$", "ˈ%1") --long V
				N[a] = s(s(N[a], "%.?(" .. C .. "?ˤ?" .. "[aeiuāēīū]" .. C .. "ˤ?%." .. n .. C .. "ˤ?" .. V .. C .. "?ˤ?)$", "ˈ%1"), "ˈˈ", "ˈ") --non-circumflex + C
				n = n .. C .. "ˤ?[aeiu]%." --+1 light syllable
			end

		else --no non-final heavy nor ultraheavy syllable detected, ie. there are only non-final light ones
			N[a] = s(N[a], "^( ?)(" .. C .. "?ˤ?[aeiu]%.)", "%1ˈ%2") --initial stress
		end

	end
	word = table.concat(N, " ")
	for a = 1, #d do
		word = s(word, d[a][1], d[a][2])
	end
	return word
end

function export.show(frame)
	local results = {}
	table.insert(results, {pron = "/" .. export.pronunciation_phonemic(mw.title.getCurrentTitle().text) .. "/"})
	local lang = require("Module:languages").getByCode("akk")
	return "* " .. require("Module:accent_qualifier").format_qualifiers(lang, {'[[w:Akkadian language|Old Babylonian]]'}) .. " " .. require("Module:IPA").format_IPA_full { lang = lang, items = results }
end 
return export