Nicht angemeldeter Benutzer - Bearbeiten von Seiten ist nur als angemeldeter Benutzer möglich.
Änderungen
Zur Navigation springen
Zur Suche springen
Zeile 1:
Zeile 1:
− +
Zeile 6:
Zeile 6:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Zeile 35:
Zeile 87:
− +
Zeile 44:
Zeile 96:
− +
Zeile 52:
Zeile 104:
− +
Zeile 151:
Zeile 203:
− return "not yet ready" +
+
+
+
+
+
+
Zeile 178:
Zeile 236:
− -- DEBUG:
− if not lucky then
− r = "<span class=\"error\">" .. r .. "</span>"
− end
RELEASE num+latin
--[=[ 2013-10-24
--[=[ 2013-10-25
Sort
Sort
]=]
]=]
local Sort = { }
local Sort = { }
Sort.lex = function ( adjust, apply, adapt )
-- Build ASCII sortkey for text value
-- Precondition:
-- adjust -- string to be aligned
-- apply -- string with base
-- "latin"
-- adapt -- variation, or false
-- "DIN5007m2" -- DIN 5007 mode "2"
local r = adjust
if not r:match( "^[ -~]*$" ) then
local lucky
local collate
if apply then
collate = apply
else
collate = "uni"
end
if adapt then
collate = collate .. adapt
end
collate = "Module:Sort/" .. collate
lucky, collate = pcall( mw.loadData, collate )
if type( collate ) == "table" then
local k, n, s, start
local n = mw.ustring.len( r )
for i = n, 1, -1 do
k = mw.ustring.codepoint( r, i, i )
if k < 127 then -- ASCII
s = ( k < 32 ) -- htab newline whitespace
if s then
s = " "
end
else
s = collate[ k ]
end
if s then
if i > 1 then
s = mw.ustring.sub( r, 1, i - 1 ) .. s
end
r = s .. mw.ustring.sub( r, i + 1 )
end
end -- for i--
else
r = "**ERROR** Sort.lex ** Submodule unavailable " .. collate
end
end
r = r:gsub( " +", " " )
return r
end -- Sort.lex()
local c
local c
if ad then
if ad then
mid = mw.ustring.codepoint( ad, 1 )
mid = mw.ustring.codepoint( ad, 1, 1 )
end
end
if at then
if at then
end
end
for i = 1, n do
for i = 1, n do
c = mw.ustring.codepoint( source, i )
c = mw.ustring.codepoint( source, i, i )
if c > 32 then -- not whitespace
if c > 32 then -- not whitespace
if c >= 48 and c <= 57 then -- digits
if c >= 48 and c <= 57 then -- digits
elseif c == mid then -- decimal separator
elseif c == mid then -- decimal separator
for j = i + 1, n do
for j = i + 1, n do
c = mw.ustring.codepoint( source, j )
c = mw.ustring.codepoint( source, j, j )
if c >= 48 and c <= 57 then -- digits
if c >= 48 and c <= 57 then -- digits
sub = string.format( "%s%c", sub, c )
sub = string.format( "%s%c", sub, c )
-- Template::latin
-- Template::latin
-- {{{1}}}
-- {{{1}}}
-- #invoke
-- v -- variant, omitted or "DIN5007m2"
local lucky, r = pcall( Sort.lex,
frame:getParent().args[ 1 ] or "",
"latin",
frame.args.v )
return r;
end -- p.Tlatin
end -- p.Tlatin
tonumber( frame.args.z ),
tonumber( frame.args.z ),
frame.args.m == "1" )
frame.args.m == "1" )
return r;
return r;
end -- p.Tn
end -- p.Tn