Modul:Test
Erscheinungsbild
Die Dokumentation für dieses Modul kann unter Modul:Test/Doku erstellt werden
local p = {}
function p.hello( frame )
return "Hello, world!"
end
function p.MultiText( frame )
return "Txt [[Datei:Odometer 1.svg|12px]]" .. frame.args[1] -- frame.args[1] ìsch dr 1. Parameter
.. " [[Datei:Odometer 2.svg|12px]]" .. frame.args[2] -- frame.args[2] ìsch dr 2. Parameter
.. " [[Datei:Odometer 3.svg|12px]]" .. frame.args[3] -- frame.args[3] ìsch dr 3. Parameter
end
function p.Lenga( frame )
if #frame.args[1] == 0 then -- d Lenga vu String str = #str
return "Laarer Text"
else -- Üswàhl-Syntax: if then else end
return "Lenga=" .. #frame.args[1] -- String concatenation dur ..
end
end
function p.Verb( frame )
local var
if frame.args[2] then -- Test äb da 2. Parameter existiart
if frame.args[2] == 'sìì' then var = 'ìch bì '
elseif frame.args[2] == 'hàà' then var = 'ìch hà '
else var = ' -- '
end
end
var = "'''" .. frame.args[1] .. ":''' " .. var
if frame.args[3] then -- Test äb da 3. Parameter existiart
var = var .. frame.args[3]
end
return var
end
function p.TextLasa( frame )
local text_in, text_out
text_in = string.lower( frame.args[1] )
text_out = ""
text_out = OrthalRekursion(text_in, text_out)
return text_out
end
function OrthalRekursion(text_in, text_out)
if string.sub( text_in, 1, 3 ) == "sch" then
text_out = text_out .. "ʃ"
text_in = string.sub( text_in, 4)
elseif string.sub( text_in, 1, 2 ) == "sp" then
text_out = text_out .. "ʃp"
text_in = string.sub( text_in, 3)
elseif string.sub( text_in, 1, 2 ) == "st" then
text_out = text_out .. "ʃt"
text_in = string.sub( text_in, 3)
elseif string.sub( text_in, 1, 2 ) == "ch" then
text_out = text_out .. "x"
text_in = string.sub( text_in, 3)
elseif string.sub( text_in, 1, 2 ) == "ie" then
text_out = text_out .. "i"
text_in = string.sub( text_in, 3)
elseif string.sub( text_in, 1, 2 ) == "ìe" then
text_out = text_out .. "e"
text_in = string.sub( text_in, 3)
elseif string.sub( text_in, 1, 1 ) == "à" then
text_out = text_out .. "ɑ"
text_in = string.sub( text_in, 2)
elseif string.sub( text_in, 1, 1 ) == "ä" or string.sub( text_in, 1 ) == "è" then
text_out = text_out .. "ɛ"
text_in = string.sub( text_in, 2)
else
text_out = text_out .. string.sub( text_in, 1, 1 )
text_in = string.sub( text_in, 2)
end
if #text_in > 2 then
return "A:" .. text_out
else
return "B:" .. text_out
end
end
return p