15.075
Bearbeitungen
(+ Beruf) |
(+ Prozent-Statistik) |
||
| Zeile 6: | Zeile 6: | ||
function p.AbfrageAuszeichnungen(frame) | function p.AbfrageAuszeichnungen(frame) | ||
-- mw.log("AbfrageAuszeichnungen(frame)") | |||
-- mw.logObject(frame, "frame") | |||
-- Konsolenzeile zum Debuggen: | -- Konsolenzeile zum Debuggen: | ||
-- p.AbfrageAuszeichnungen{pargs={["Aufschlüsselung"]="Auszeichnungen"}} | -- p.AbfrageAuszeichnungen{pargs={["Aufschlüsselung"]="Auszeichnungen"}} | ||
| Zeile 66: | Zeile 66: | ||
page_selector_basis = page_selector_basis .. top_prefix .. "[[Beruf::" .. beruf .. "]]" .. top_postfix | page_selector_basis = page_selector_basis .. top_prefix .. "[[Beruf::" .. beruf .. "]]" .. top_postfix | ||
end | end | ||
-- Geburtsort-Selektoren | -- Geburtsort-Selektoren | ||
page_selector_ort_fuerth = top_prefix .. "[[Geburtsort::Fürth]]" .. top_postfix | page_selector_ort_fuerth = top_prefix .. "[[Geburtsort::Fürth]]" .. top_postfix | ||
| Zeile 75: | Zeile 74: | ||
page_selector_ort = top_prefix .. "[[Geburtsort::!Fürth]]" .. top_postfix | page_selector_ort = top_prefix .. "[[Geburtsort::!Fürth]]" .. top_postfix | ||
end | end | ||
-- Geschlecht-Selektoren | -- Geschlecht-Selektoren | ||
page_selector_maennlich = top_prefix .. "[[Geschlecht::männlich]]" .. top_postfix | page_selector_maennlich = top_prefix .. "[[Geschlecht::männlich]]" .. top_postfix | ||
| Zeile 84: | Zeile 81: | ||
page_selector_geschlecht = top_prefix .. "[[Geschlecht::" .. attr["Geschlecht"] .. "]]" .. top_postfix | page_selector_geschlecht = top_prefix .. "[[Geschlecht::" .. attr["Geschlecht"] .. "]]" .. top_postfix | ||
end | end | ||
-- Statistik | -- Statistik | ||
local n_basis_ort_geschlecht = mw.smw.ask(page_selector_basis .. page_selector_ort .. page_selector_geschlecht .. "| format=count | limit=10000") | |||
t = t .. "<br>'''".. n_basis_ort_geschlecht .. " " | |||
if attr["Aufschlüsselung"] == "Personen" then | if attr["Aufschlüsselung"] == "Personen" then | ||
t = t .. "Personen mit " | t = t .. "Personen mit " | ||
| Zeile 96: | Zeile 90: | ||
t = t .. "Auszeichnungen gefunden" | t = t .. "Auszeichnungen gefunden" | ||
if attr["Geschlecht"] == nil then | if attr["Geschlecht"] == nil then | ||
local n_basis_ort_weiblich = mw.smw.ask(page_selector_basis .. page_selector_ort .. page_selector_weiblich .. "| format=count | limit=10000") | |||
local n_basis_ort_maennlich = mw.smw.ask(page_selector_basis .. page_selector_ort .. page_selector_maennlich .. "| format=count | limit=10000") | |||
local n_basis_ort_divers = mw.smw.ask(page_selector_basis .. page_selector_ort .. page_selector_divers .. "| format=count | limit=10000") | |||
local p_basis_ort_weiblich = math.floor(n_basis_ort_weiblich / n_basis_ort_geschlecht * 100 + 0.5) | |||
local p_basis_ort_maennlich = math.floor(n_basis_ort_maennlich / n_basis_ort_geschlecht * 100 + 0.5) | |||
local p_basis_ort_divers = math.floor(n_basis_ort_divers / n_basis_ort_geschlecht * 100 + 0.5) | |||
t = t .. "; davon " .. n_basis_ort_weiblich .. " (" .. p_basis_ort_weiblich.. "%) Frauen" | |||
t = t .. ", " .. n_basis_ort_maennlich .. " (" .. p_basis_ort_maennlich.. "%) Männer" | |||
t = t .. " und " .. n_basis_ort_divers .. " (" .. p_basis_ort_divers.. "%) Divers '''(ggf. Rest nicht angegeben)'''" | |||
end | end | ||
if attr["Geburtsort"] == nil then | if attr["Geburtsort"] == nil then | ||
local n_basis_fuerth_geschlecht = mw.smw.ask(page_selector_basis .. page_selector_ort_fuerth .. page_selector_geschlecht .. "| format=count | limit=10000") | |||
local p_basis_fuerth_geschlecht = math.floor(n_basis_fuerth_geschlecht / n_basis_ort_geschlecht * 100 + 0.5) | |||
t = t .. "; davon " .. n_basis_fuerth_geschlecht .. " (" .. p_basis_fuerth_geschlecht.. "%) gebürtige Fürther" | |||
end | end | ||
t = t .. "<br>'''" | t = t .. "<br>'''" | ||