This module generates the IPA transcription of Hausa entries. It runs Template:ha-IPA. It displays the phonemic transcription as well as the Standard Kano Hausa phonetic transcription.
|niger
is set to 1
, the Standard Kano Hausa pronunciation is currently removed, later replaced with the Nigerien pronunciation.local export = {}
local m_IPA = require("Module:IPA")
local m_a = require("Module:accent qualifier")
local lang = require("Module:languages").getByCode("ha")
local s = mw.ustring.gsub
local C = ""
local V = ""
local i = { --mid-open realizations of <e, o> in borrowings
{"E", "ɛ́"},
{"Ḕ", "ɛ̀ː"},
{"È", "ɛ̀"},
{"Ê", "E"},--don't change this...
{"O", "ɔ́"},
{"Ṑ", "ɔ̀ː"},
{"Ò", "ɔ̀"},
{"Ô", "O"},--...see rules 62&63 of c
{"R", "r̃"}
}
local c = { --phoneMic Correspondences (from spelling)
{"ʼ", "'"},
{"()%1()", "%1%2%1%2"},
{"tts(h?)", "ts%1ts%1"},
{"ssh", "shsh"},
{"ffy", "fyfy"},
{"cch'", "ch'ch'"},
{"''y", "'y'y"},
{"gw", "ɡʷ"},
{"gy", "ɟ"},
{"kw", "kʷ"},
{"ch'", "Tʼ"},
{"c", "T"},
{"ky", "c"},
{"ƙw", "kʷʼ"},
{"ƙy", "cʼ"},
{"tsh", "Tʼ"},
{"sh", "ʃ"},
{"ts", "Sʼ"},
{"fy", "fʲ"},
{"j", "D"},
{"'y", "J"},
{"y", "j"},
{"ƴ", "J"},
{"g", "ɡ"},
{"ƙ", "kʼ"},
{"r̃", "R"},
{"r", "ɽ"},
{"R", "r"},
{"'", "ʔ"},
{"a", "á"},
{"ā̀", "àː"},
{"ā", "áː"},
{"e", "é"},
{"ḕ", "èː"},
{"ē", "éː"},
{"i", "í"},
{"ī̀", "ìː"},
{"ī", "íː"},
{"o", "ó"},
{"ṑ", "òː"},
{"ō", "óː"},
{"u", "ú"},
{"ū̀", "ùː"},
{"ū", "úː"},
{"()", "%1ː"},
{"^(" .. V .. ")", "ʔ%1"},
{"(.)(" .. V .. ")", "%1ʔ%2"},
{"(.)(.)", "%1%2"},
{"(" .. V .. "ː?" .. C .. "??ʼ?)(" .. C .. "?ʼ?)%f" .. V, "%1.%2"},
{"(ː?)", "%1i"},
{"(ː?)", "%1u"},
{"âː()", "â%1"},
{"()ː(" .. C .. "?ʼ?%.)", "%1%2"},
{"()ː(" .. C .. "?ʼ?)$", "%1%2"},
{"T(ʼ?)w", "Tʷ%1"},
{"^(" .. C .. ")(ʼ?)w", "%1ʷ%2"},
{"( " .. C .. ")(ʼ?)w", "%1ʷ%2"},
{"T", "t͡ʃ"},
{"S", "(t)s"},
{"D", "(d)ʒ"},
{"J", "j̰"},
{"E", "ɛ̂"},
{"O", "ɔ̂"},
}
local idk = { --turns a copy of "word" string, got after c, into an actual phoneMic tr (no phoneMic mid-open), whereas the value of "word" preserves the mid-open distinction for the phoneTic tr
{"ɛ́", "é"},
{"ɛ̀", "è"},
{"ɛ̂", "ê"},
{"ɔ́", "ó"},
{"ɔ̀", "ò"},
{"ɔ̂", "ô"}
}
local SKH = { --Standard Kano Hausa phoneTic correspondences (from phoneMic tr)
{"%(d%)ʒ", "d͡ʒ"},
{"f", "ɸ"},
{"k(ʼ?)", "c%1"},
{"ɡ()", "ɟ%1"},
{"()(ʼ?)", "%1ʷ%2"},
{"d͡ʒ%.d͡ʒ", "d.d͡ʒ"},
{"t͡ʃ%.t͡ʃ", "t.t͡ʃ"},
{"%.(ʷ?ʼ?)", "%1.%1"},
{"%(t%)sʼ", "sʼ"},
{"n(?)", "m%1"},
{"n(?)", "ɲ%1"},
{"n(?)()", "%2%1%2"},
{"n(?)", "ŋ%1"},
{"$", "ŋ"},
{"ŋ(?)", "n%1"},
{"á(%.?)", "ɛ́%1"},
{"à(%.?)", "ɛ̀%1"},
{"â(%.?)", "ɛ̂%1"},
{"(ʼ?)á()", "%1ɛ́%2"},
{"(ʼ?)à()", "%1ɛ̀%2"},
{"(ʼ?)â()", "%1ɛ̂%2"},
{"(ʼ?)á$", "%1ɛ́"},
{"(ʼ?)à$", "%1ɛ̀"},
{"(ʼ?)â$", "%1ɛ̂"},
{"()á()", "%1ə́%2"},
{"()à()", "%1ə̀%2"},
{"()â()", "%1ə̂%2"},
{"()á$", "%1ə́"},
{"()à$", "%1ə̀"},
{"()â$", "%1ə̂"},
{"hó(" .. C .. "?ʼ?)", "hɔ́%1"},
{"hò(" .. C .. "?ʼ?)", "hɔ̀%1"},
{"hô(" .. C .. "?ʼ?)", "hɔ̂%1"},
{"hó(" .. C .. "?ʼ?)$", "hɔ́%1"},
{"hò(" .. C .. "?ʼ?)$", "hɔ̀%1"},
{"hô(" .. C .. "?ʼ?)$", "hɔ̂%1"},
{"(" .. C .. "?ʼ?)", "á%1"},
{"(" .. C .. "?ʼ?)", "à%1"},
{"(" .. C .. "?ʼ?)", "â%1"},
{"(" .. C .. "?ʼ?)$", "á%1"},
{"(" .. C .. "?ʼ?)$", "à%1"},
{"(" .. C .. "?ʼ?)$", "â%1"},
{"í()", "ɪ́%1"},
{"ì()", "ɪ̀%1"},
{"î()", "ɪ̂%1"},
{"í$", "ɪ́"},
{"ì$", "ɪ̀"},
{"î$", "ɪ̂"},
{"ú(%.?j)", "í%1"},
{"ù(%.?j)", "ì%1"},
{"û(%.?j)", "î%1"},
{"(ʼ?)ú()", "%1ɪ́%2"},
{"(ʼ?)ù()", "%1ɪ̀%2"},
{"(ʼ?)û()", "%1ɪ̂%2"},
{"ɪ́(%.?w)", "ú%1"},
{"ɪ̀(%.?w)", "ù%1"},
{"ɪ̂(%.?w)", "û%1"},
{"(ʼ?)ú$", "%1ɪ́"},
{"(ʼ?)ù$", "%1ɪ̀"},
{"(ʼ?)û$", "%1ɪ̂"},
{"ú()", "ʊ́%1"},
{"ù()", "ʊ̀%1"},
{"û()", "ʊ̂%1"},
{"ú$", "ʊ́"},
{"ù$", "ʊ̀"},
{"û$", "ʊ̂"},
{"()ái", "%1éi"},
{"()ài", "%1èi"},
{"(%.)âi", "%1êi"},
{"()âi%.", "%1êi."},
{"M", "m"}
}
function export.pronunciation_phonemic(word, ideo)
if ideo == "1" then
word = s(word, "f$", "p")
end
for a = 1, #i do
word = s(word, i, i)
end
word = mw.ustring.lower(word)
for a = 1, #c do
word = s(word, c, c)
end
return word
end
function export.idk(word) --see var
for a = 1, #idk do
word = s(word, idk, idk)
end
return word
end
function export.pronunciation_phonetic(word, dialect, ideo)
if dialect == "SKH" then --see var
if ideo == "1" then
word = s(word, "m$", "M")
end
for a = 1, #SKH do
word = s(word, SKH, SKH)
end
end
return word
end
function export.show(frame)
local args = frame:getParent().args
local p, results, results_ha = {}, {}, {}
if not args or (args == "") then
error("Please put the word as the first positional parameter!")
else
for index, item in ipairs(args) do
table.insert(p, (item ~= "") and item or nil)
end
end
for _, word in ipairs(p) do
word = export.pronunciation_phonemic(word, args)
table.insert(results, {pron = "/" .. export.idk(word) .. "/"}) --see var
table.insert(results_ha, {pron = ") .. "]"})
end
if args == "1" then
return m_IPA.format_IPA_full { lang = lang, items = results }
else
return m_IPA.format_IPA_full { lang = lang, items = results } .. "\n** " .. m_a.format_qualifiers(lang, {"Standard Kano Hausa"}) .. " " .. m_IPA.format_IPA_full { lang = lang, items = results_ha }
end
end
return export