82.367
Bearbeitungen
(StraßeHausnummer2PLZ/Work => StraßeHausnummer2PLZ) |
Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
local p = {} --p stands for package | local p = {} --p stands for package | ||
local c = require( "Module:Common" ) | local c = require("Module:Common") | ||
local str = require("Modul:String") | |||
function p.Faktenbox(frame) | function p.Faktenbox(frame) | ||
local args = c.shallowcopy(frame:getParent().args) | local args = c.shallowcopy(frame:getParent().args) | ||
local hausnr | |||
if args["Hausnummer"] | |||
-- Ned schön, funktioniert aber. Andere Lösung wäre fein! | |||
if not c.isEmpty(args["Hausnummer"]) then | |||
-- Hausnummer ohne Buchstaben extrahieren, um damit PLZ zu ermitteln | |||
hausnr = tonumber(string.match("0" .. args["Hausnummer"], "%d+")) | |||
end | end | ||
args["PLZ"] = frame:expandTemplate{title = 'StraßeHausnummer2PLZ', args= | local streets = str.strip(str.split(args['Straße'], ";")) | ||
args["PLZ"] = frame:expandTemplate{title = 'StraßeHausnummer2PLZ', args={ | |||
['Straße'] = streets[1], ['HausnummerOhneBuchstaben'] = hausnr} | |||
} | |||
local tpl_bild = p.bild(frame, args) | local tpl_bild = p.bild(frame, args) | ||