Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. Module:Classification biologique — Wikipédia
Module:Classification biologique — Wikipédia 👆 Click Here! Read More..
Une page de Wikipédia, l'encyclopédie libre.

 Documentation[créer] [purger]
MIT

Ce module ne possède aucune documentation explicative en sous-page, pas même une description succincte.
Vous pouvez créer cette sous-page afin de documenter ce module adéquatement.

La documentation de ce module est générée par le modèle {{Documentation module}}.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.

    • Projet Scribunto Projet Scribunto
-- module (test) to handle classifications (biology)

local p = {}

--
function p.put(frame)
	local classification = frame.args["classification"]
	local ns = frame.args["ns"]
	local auts = frame.args["auteurs"]
	
	if (classification == nil) then
		return "[[Catégorie:Classification scientifique absente]]"
	end
	if (ns == nil) then
		return "[[Catégorie:Classification scientifique appelée sans nom scientifique]]"
	end
	if (auts == nil) then
		auts = ""
	end
	
	-- on récupère le contenu du module de classification
	local ctr = "Module:Classification biologique/" .. classification
	local ccurrent = require (ctr)
	if (ccurrent == nil) then
		return "[[Catégorie:Classification scientifique inconnue]]"
	end

	-- nom scientifique double ?
	tmpx = mw.text.split(ns, " ", true);
	if (tmpx[2] ~= nil) then
		ns = tmpx[1]
		sp = tmpx[2]
	else
		sp = nil
	end
	
	
	-- on cherche le taxon
	local taxon = ccurrent.taxons[ns]
	if (taxon == nil) then
		return "[[Catégorie:Classification scientifique avec nom scientifique inconnu]]"
	end
	
	-- on récupère les éléments d'info
	local t_nom = taxon["nom"]
	local t_article = taxon["article"]
	local t_rang = taxon["rang"]
	
	-- table pour empiler les éléments en cours
	local resu = {}
	
	local tmp = ""
	if (sp == nil) then
		-- on insert le premier
		tmp = "{{Taxobox taxon | " .. ccurrent.domain .. " | " .. t_rang ..
		      " | " .. t_nom .. " | " .. auts .. "}}<br/>"
	else
		-- c'est une espèce, qu'on gère
		tmp = "{{Taxobox taxon | " .. ccurrent.domain .. " | espèce | " ..
		      ns .. " " .. sp .. " | " .. auts .. "}}"
	end
	

	-- on le met dans la table
	table.insert(resu, tmp)
	
	-- si c'est une espèce on insert le genre
	if (sp ~= nil) then
		-- on cherche le taxon
		local z = ccurrent.taxons[ns]
		if (z == nil) then
			table.insert(resu, 1, "Erreur")
			return "Erreur…"
		end
		
		-- on prépare cette ligne (façon simple)
		local txt = ""
		txt = txt .. "{{Taxobox | " .. z["rang"] .. " | " ..
			      z["nom"] .. "}}"
 		-- ajout
 		table.insert(resu, 1, txt)
	end
	
	-- boucle pour chercher les niveaux du dessus
	local cur = t_nom
	while true do
		-- on cherche celui du dessus
		local sup = ccurrent.inclusions[t_nom]
		if (sup == nil) then
			break  -- terminé (ou erreur)
		end
		if (sup == "EOC") then
			break
		end
		
		-- on cherche le taxon
		local z = ccurrent.taxons[sup]
		if (z == nil) then
			return "[[Catégorie:Classification scientifique avec erreur interne]]"
		end
		
		-- on prépare cette ligne (façon simple)
		local txt = ""
		txt = txt .. "{{Taxobox | " .. z["rang"] .. " | " ..
			      z["nom"] .. "}}"
 		-- ajout
 		table.insert(resu, 1, txt)
 		-- suivant
 		t_nom = z["nom"]
	end
	
	-- on construit le résultat final
	local retour = ""
	for i, v in ipairs(resu) do
		retour = retour .. v
	end
	
	return frame:preprocess(retour)
end

--
function p.put2(frame)
	local classification = frame.args["classification"]
	local ns = frame.args["ns"]
	local auts = frame.args["auteurs"]
	local image = frame.args["image"]
	local legende = frame.args["légende"]
	
	
	if (classification == nil) then
		return "[[Catégorie:Classification scientifique absente]]"
	end
	if (ns == nil) then
		return "[[Catégorie:Classification scientifique appelée sans nom scientifique]]"
	end
	if (auts == nil) then
		auts = ""
	end

	-- on récupère le contenu du module de classification
	local ctr = "Module:Classification biologique/" .. classification
	local ccurrent = require (ctr)
	if (ccurrent == nil) then
		return "[[Catégorie:Classification scientifique inconnue]]"
	end

	-- nom scientifique double ?
	nsx = ns
	tmpx = mw.text.split(ns, " ", true);
	if (tmpx[2] ~= nil) then
		ns = tmpx[1]
		sp = tmpx[2]
	else
		sp = nil
	end
	
	
	-- on cherche le taxon
	local taxon = ccurrent.taxons[ns]
	if (taxon == nil) then
		return "[[Catégorie:Classification scientifique avec nom scientifique inconnu]]"
	end
	
	-- on récupère les éléments d'info
	local t_nom = taxon["nom"]
	local t_article = taxon["article"]
	local t_rang = taxon["rang"]
	
	-- table pour empiler les éléments en cours
	local resu = {}
	
	local tmp = ""
	if (sp == nil) then
		-- on insert le premier
		tmp = "{{Taxobox taxon | " .. ccurrent.domain .. " | " .. t_rang ..
		      " | " .. t_nom .. " | " .. auts .. "}}<br/>"
	else
		-- c'est une espèce, qu'on gère
		tmp = "{{Taxobox taxon | " .. ccurrent.domain .. " | espèce | " ..
		      ns .. " " .. sp .. " | " .. auts .. "}}"
	end
	

	-- on le met dans la table
	table.insert(resu, tmp)
	
	-- si c'est une espèce on insert le genre
	if (sp ~= nil) then
		-- on cherche le taxon
		local z = ccurrent.taxons[ns]
		if (z == nil) then
			table.insert(resu, 1, "Erreur")
			return "Erreur…"
		end
		
		-- on prépare cette ligne (façon simple)
		local txt = ""
		txt = txt .. "{{Taxobox | " .. z["rang"] .. " | " ..
			      z["nom"] .. "}}"
 		-- ajout
 		table.insert(resu, 1, txt)
	end
	
	-- boucle pour chercher les niveaux du dessus
	local cur = t_nom
	while true do
		-- on cherche celui du dessus
		local sup = ccurrent.inclusions[t_nom]
		if (sup == nil) then
			break  -- terminé (ou erreur)
		end
		if (sup == "EOC") then
			break
		end
		
		-- on cherche le taxon
		local z = ccurrent.taxons[sup]
		if (z == nil) then
			return "[[Catégorie:Classification scientifique avec erreur interne]]"
		end
		
		-- on prépare cette ligne (façon simple)
		local txt = ""
		txt = txt .. "{{Taxobox | " .. z["rang"] .. " | " ..
			      z["nom"] .. "}}"
 		-- ajout
 		table.insert(resu, 1, txt)
 		-- suivant
 		t_nom = z["nom"]
	end
	-- on insert taxobox début
	ddd = ""
	-- italiques ou pas ?
	if ((ccurrent.domain == "végétal") or (
		(t_rang == "espèce") or (t_rang == "genre"))
	   ) then
		ddd = "{{Taxobox début | " .. ccurrent.domain .. " | ''" .. nsx .. "'' | "
	else
		ddd = "{{Taxobox début | " .. ccurrent.domain .. " | " .. nsx .. " | "
	end
	if (image ~= nil) then
		ddd = ddd .. image .. " | "
	else
		ddd = ddd .. " | "
	end
	if (legende ~= nil) then
		ddd = ddd .. legende .. " | "
	else
		ddd = ddd .. " | "
	end
	ddd = ddd .. "classification=" .. classification .. " }}"
 	table.insert(resu, 1, ddd)

	-- on construit le résultat final
	local retour = ""
	for i, v in ipairs(resu) do
		retour = retour .. v
	end
	
	return frame:preprocess(retour)
end


--
return p
Ce document provient de « https://fr.teknopedia.teknokrat.ac.id/w/index.php?title=Module:Classification_biologique&oldid=113549939 ».
Catégories :
  • Module sans documentation
  • Module en langage Lua

  • indonesia
  • Polski
  • الرية
  • Deutsch
  • English
  • Español
  • Français
  • Italiano
  • مصر
  • Nederlands
  • 本語
  • Português
  • Sinugboanong Binisaya
  • Svenska
  • Українска
  • Tiếng Việt
  • Winaray
  • 中文
  • Русски
Sunting pranala
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022
Email: pmb@teknokrat.ac.id