Module:User:ObnoxiousCoder/akk-IPA

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

This module generates the phonemic IPA transcription of Akkadian entries. It runs Template:akk-IPA. The testcases are here.

References

  • Huehnergard, John (2005) “Lesson 1”, in A Grammar of Akkadian (Harvard Semitic series; Issue 45), Eisenbrauns, →ISBN, pages 1-4

local export = {}

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

local C = ""
local V = ""
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, c)
	end
	local N = {}
	local i = 0
	for a in string.gmatch(word, "%S+") do
		i = i+1
		N = a
	end
	for a = 1, #N do
		if m(N, C .. "?ˤ?$") ~= nil then --last syllable is ultraheavy (circumflex)
			N = s(N, "%.?(" .. C .. "?ˤ?)$", "ˈ%1") --final stress

		elseif m(N, C .. "?ˤ?" .. C .. "ˤ?$") ~= nil then --again (any long V, + C)
			N = s(N, "%.?(" .. C .. "?ˤ?" .. C .. "ˤ?)$", "ˈ%1") --final stress

		elseif m(s(N, C .. "ˤ?" .. V .. C .. "?ˤ?$", ""), C .. "?ˤ?" .. "%.") ~= nil or m(s(N, C .. "ˤ?" .. V .. C .. "?ˤ?$", ""), C .. "?ˤ?" .. "" .. 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 = s(N, "%.?(" .. C .. "?ˤ?" .. "%." .. n .. C .. "ˤ?" .. V .. C .. "?ˤ?)$", "ˈ%1") --long V
				N = s(s(N, "%.?(" .. C .. "?ˤ?" .. "" .. C .. "ˤ?%." .. n .. C .. "ˤ?" .. V .. C .. "?ˤ?)$", "ˈ%1"), "ˈˈ", "ˈ") --non-circumflex + C
				n = n .. C .. "ˤ?%." --+1 light syllable
			end

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

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

function export.show(frame)
	local results = {}
	table.insert(results, {pron = "/" .. export.pronunciation_phonemic(mw.title.getCurrentTitle().text) .. "/"})
	return "* " .. require("Module:IPA").format_IPA_full { lang = require("Module:languages").getByCode("akk"), items = results }
end 
return export