local export = {}
local gsub = mw.ustring.gsub
local match = mw.ustring.match
function export.tr(word, sc, lang)
word = gsub(word, "%(+%)", "")
word = gsub(word, "—", "-")
if match(word, "^+$") then
return (gsub(word,
"", {
= "b", = "j", = "d", = "g", = "s",
= "m", = "n", = "/", = "l", = "h",
= "k", = "t", = "ch", = "p",
= "tt", = "pp", = "jj", = "kk", = "ss",
= "yo", = "yeo", = "ya", = "ae", = "e",
= "o", = "eo", = "a", = "i", = "yu",
= "u", = "eu", = "ye", = "yae" }
))
end
if not match(word, "") then
return nil
end
local m_pron = require("Modül:ko-söyleniş")
local revised = m_pron.romanise(word, 2, {}, true)
if not revised then
return nil
end
if match(revised, "") then
revised = mw.ustring.upper(mw.ustring.sub(revised, 1, 1)) .. mw.ustring.sub(revised, 2, -1)
revised = gsub(revised, "() ()", "%1 ^%2")
revised = gsub(revised, "^%'%'%'", "'''^")
end
revised = gsub(revised, "%^%'%'%'", "'''^")
revised = gsub(revised, "%^%l", mw.ustring.upper)
revised = gsub(revised, '%^', '')
revised = gsub(revised, "%-'''%-", "'''-")
revised = gsub(revised, "%-%-", "-")
return revised
end
export.tr_revised = export.tr
return export