Geen bewerkingssamenvatting |
k Admin heeft de pagina Module:Format title for sorting hernoemd naar Module:Format for sorting zonder een doorverwijzing achter te laten |
(geen verschil)
| |
Versie van 25 jan 2023 17:10
Module:Format for sorting
Description
Test using main:
hallo hallo d d hello this is 45567 ff
tests using textString
series 45.567.1 ? = Scriptfout: de functie "textString" bestaat niet.
- Roman numeral
Scriptfout: de functie "textString" bestaat niet.
Scriptfout: de functie "textString" bestaat niet.
minimalStrip
Scriptfout: de functie "minimalStrip" bestaat niet.
main
drukkerij uitgeverij sdfsdf de eik antwerpen--[[
-- {{#invoke:Strip title for sorting|main|...}}
]]--
local mDiacritics = require('Module:Diacritics')
local p = {}
local function removePunctuation( str )
local str = str
str = string.gsub( str, "%-?[%p%.]+", "" )
local addchars ={ "‘", "’", "“", "”" }
for i, v in ipairs( addchars ) do
str = string.gsub(str, v, "")
end
if str == nil then
error(" No string received. " )
else
return str
end
end
local function removeDiacritics( str )
str = mDiacritics.strip_diacrits( str )
return str
end
function p.main( frame )
local str = ""
str = mw.text.unstrip(frame.args[1])
str = removeDiacritics( str )
str = string.lower( str )
str = removePunctuation( str )
if str == nil then
error("...")
else
return str
end
end
return p
