This module will generate entry names for Mariupol Greek language text.
The module should preferably not be called directly from templates or other modules.
To use it from a template, use {{entryname}}
.
Within a module, use Module:languages#Language:makeEntryName.
For testcases, see Module:grk-mar-entryname/testcases.
makeEntryName(text, lang, sc)
text
written in the script specified by the code sc
, and language specified by the code lang
.nil
.local export = {}
local u = mw.ustring.char
local remove_diacritics = u(0x030C) .. u(0x0324) .. u(0x032E) -- caron, diaeresis below, breve below
function export.makeEntryName(text, lang, sc)
text = mw.ustring.toNFD(text) -- decompose
if sc == "Cyrl" then -- if script is Cyrillic, remove acute accents
text = mw.ustring.gsub(text, "", "")
end
return mw.ustring.toNFC(mw.ustring.gsub(text, "", "")) -- remove appropriate diacritics, then recompose again
end
return export