Module:grk-mar-entryname

Hello, you have come here looking for the meaning of the word Module:grk-mar-entryname. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:grk-mar-entryname, but we will also tell you about its etymology, its characteristics and you will know how to say Module:grk-mar-entryname in singular and plural. Everything you need to know about the word Module:grk-mar-entryname you have here. The definition of the word Module:grk-mar-entryname will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:grk-mar-entryname, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

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.

Functions

makeEntryName(text, lang, sc)
Generates an entry name for a given piece of text written in the script specified by the code sc, and language specified by the code lang.
When entry name generation fails, returns 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