Modul:ar-entryname
Penampilan
- Modul ini kekurangan sublaman pendokumenan. Sila mencipta laman pendokumenan berkaitan.
- Pautan berguna: senarai sublaman • pautan • transklusi • kes ujian • kotak pasir
local m_str_utils = require("Module:string utilities")
local find = m_str_utils.find
local gsub = m_str_utils.gsub
local U = m_str_utils.char
local taTwiil = U(0x640)
local waSla = U(0x671)
-- diacritics ordinarily removed by entry_name replacements
local Arabic_diacritics = U(0x64B, 0x64C, 0x64D, 0x64E, 0x64F, 0x650, 0x651, 0x652, 0x670)
-- replace alif waṣl with alif
-- remove tatweel and diacritics: fathatan, dammatan, kasratan, fatha,
-- damma, kasra, shadda, sukun, superscript (dagger) alef
local replacements = {
from = {U(0x0671), "[" .. U(0x0640, 0x064B) .. "-" .. U(0x0652, 0x0670, 0x0656) .. "]"},
to = {U(0x0627)}
}
local export = {}
function export.makeEntryName(text, lang, sc)
if text == waSla or find(text, "^" .. taTwiil .. "?[" .. Arabic_diacritics .. "]" .. "$") then
return text
end
for i, from in ipairs(replacements.from) do
local to = replacements.to[i] or ""
text = gsub(text, from, to)
end
return text
end
return export
Kategori:
- Arab modules
- Modul Entry name-generating
- Yemeni Arabic modules
- South Levantine Arabic modules
- Karakhanid modules
- North Mesopotamian Arabic modules
- Najdi Arabic modules
- Gulf Arabic modules
- Tunisian Arabic modules
- Omani Arabic modules
- Dhofari Arabic modules
- Tajiki Arabic modules
- Libyan Arabic modules
- Egyptian Arabic modules
- Moroccan Arabic modules
- Uzbeki Arabic modules
- Hijazi Arabic modules
- North Levantine Arabic modules
- Algerian Arabic modules
- Baharna Arabic modules
- Arab Sudan modules
- Old Anatolian Turkish modules
- Iraqi Arabic modules
- Templat dan modul yang memerlukan pendokumenan