မဝ်ဂျူ:ku-pron
မံက်ပြာကတ်
Documentation for this module may be created at မဝ်ဂျူ:ku-pron/doc
local export = {}
local m_IPA = require("Module:IPA")
local lang = require("Module:languages").getByCode("kmr")
local letters1_phonemes = {
["a"] = "ɑː",
["b"] = "b",
["c"] = "d͡ʒ",
["ç"] = "t͡ʃ",
["d"] = "d",
["e"] = "ɛ",
["ê"] = "eː",
["f"] = "f",
["g"] = "ɡ",
["h"] = "h",
["i"] = "ɪ",
["î"] = "iː",
["j"] = "ʒ",
["k"] = "k",
["l"] = "l",
["m"] = "m",
["n"] = "n",
["o"] = "oː",
["p"] = "p",
["q"] = "q",
["r"] = "ɾ",
["s"] = "s",
["ş"] = "ʃ",
["t"] = "t",
["u"] = "ʊ",
["û"] = "uː",
["v"] = "v",
["w"] = "w",
["x"] = "x",
["y"] = "j",
["z"] = "z",
-- Tîpên taybet (soranî)
["ẍ"] = "ɣ", -- mînak: aẍa
["ḧ"] = "ħ",
["ʿ"] = "ʕ",
["'"] = "ʕ",
-- ["ll"] = "ɫ", -- an jî /lˤ/; bi erebî (ڵ)
-- ["rr"] = "r" bi erebî (ڕ)
-- Kurdiya başûr (kirmaşanî)
["ł"] = "ɫ", -- bnr. "ll"; mînak bał, diɫ
["ň"] = "ŋ", -- mînak: maň, seň
["ř"] = "r", -- bnr. 'rr'; mînak: piř
["ü"] = "yː" -- mînak: tü
}
-- Jihevqetandin
local vowels = "aeiîuûêo"
local vowel = "[" .. vowels .. "]"
local consonant = "[^" .. vowels .. ". -]"
local syllabify_pattern = "(" .. vowel .. ")(" .. consonant .. "?)(" .. consonant .. "?)(" .. vowel .. ")"
local function syllabify(word)
word = mw.ustring.gsub(word, "%-(" .. consonant .. ")%-(" .. consonant .. ")", "%1.%2")
word = string.gsub(word, "%-", ".")
-- Add syllable breaks.
for count = 1, 2 do
word = mw.ustring.gsub(
word,
syllabify_pattern,
function(a, b, c, d)
if c == "" and b ~= "" then
c, b = b, ""
end
return a .. b .. "." .. c .. d
end
)
end
word = mw.ustring.gsub(word, '([aeêiîouûy])([^aeêiîouûy. ])([^aeêiîouûy. ])([^aeêiîouûy. ])', "%1%2%3.%4")
return word
end
local function IPA_word(word)
word = mw.ustring.lower(word) -- nivîsa biçûk
word = syllabify(word)
word = mw.ustring.gsub(word, '.', letters1_phonemes)
word = mw.ustring.gsub(word,'xw','xʷ') -- mînak: maň, seň
word = mw.ustring.gsub(word,'nɡ','ŋɡ') -- minak: ferheng
word = mw.ustring.gsub(word,'nk','ŋk') -- minak: bank
word = mw.ustring.gsub(word, '^ɾ', "r") -- mînak: roj
word = mw.ustring.gsub(word,'ɾɾ','r') -- mînak: pirr; bi erebî (ڕ)
word = mw.ustring.gsub(word, 'll', 'ɫ') -- an jî /lˁ/; mînak: bi soranî gull (گوڵ) (bi kurmancî gul); bi erebî (ڵ)
word = mw.ustring.gsub(word,'ɘj','iː') -- iy → îy
-- + Giranî (stress) li ser kîteya dawî
tab_word = mw.text.split(word, '%.')
if (#tab_word ~= 1) then
tab_word[#tab_word] = "ˈ" .. tab_word[#tab_word]
end
word = table.concat(tab_word, '')
ipa = word
-- Add default stress mark if not present
if not mw.ustring.find(ipa, "") then
ipa = "" .. ipa
end
return ipa
end
function export.IPA(frame)
local words = {}
for _, word in ipairs(frame:getParent().args) do
table.insert(words, word)
end
if #words == 0 then
words = {mw.title.getCurrentTitle().text}
end
for key, word in ipairs(words) do
words[key] = IPA_word(word)
end
return m_IPA.format_IPA_full(lang, {{pron = "/" .. table.concat(words, '/, /') .. "/"}})
end
return export