This module generates the phonemic IPA transcription of Lang entries. It runs Template:User:Malku H₂n̥rés/lang-IPA. The testcases are here. It displays the phonemic transcription as well as the dialect1 phonetic transcription.
|param=
is set to something
, this action is done.local export = {}
local m_IPA = require("Module:IPA")
local lang = require("Module:languages").getByCode("lang")
local s = mw.ustring.gsub
local C = ""
local V = ""
local c = {
{"", ""},
{"", ""}
}
local dialect1 = {
{"", ""},
{"", ""}
}
function export.pronunciation_phonemic(word)
word = mw.ustring.lower(word)
for a = 1, #c do
word = s(word, c, c)
end
return word
end
function export.pronunciation_phonetic(word, dialect)
if dialect == "dialect1" then
for a = 1, #dialect1 do
word = s(word, dialect1, dialect1)
end
end
return word
end
function export.show(frame)
local args = frame:getParent().args
local p, results, results_lang = {}, {}, {}
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)
table.insert(results, {pron = "/" .. word .. "/"})
table.insert(results_lang, {pron = ""})
end
return "* " .. m_IPA.format_IPA_full { lang = lang, items = results } .. "\n** " .. m_IPA.format_IPA_full { lang = lang, items = results_lang }
--[=[
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