| 448 | david | 1 | <?php
 | 
        
           |  |  | 2 | // Encodage : UTF-8
 | 
        
           |  |  | 3 | // +-------------------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 4 | /**
 | 
        
           |  |  | 5 | * Découpage des noms latins
 | 
        
           |  |  | 6 | *
 | 
        
           |  |  | 7 | * Description : classe permettant de découper les noms latins.
 | 
        
           |  |  | 8 | *
 | 
        
           |  |  | 9 | //Auteur original :
 | 
        
           |  |  | 10 | * @author       Jean-Pascal MILCENT <jpm@tela-botanica.org>
 | 
        
           |  |  | 11 | * @copyright	Tela-Botanica 1999-2009
 | 
        
           |  |  | 12 | * @licence		GPL v3 & CeCILL v2
 | 
        
           |  |  | 13 | * @version		$Id: DecoupageNomLatin.class.php 1873 2009-03-31 10:07:24Z Jean-Pascal MILCENT $
 | 
        
           |  |  | 14 | */
 | 
        
           |  |  | 15 | // +-------------------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 16 | class DecoupageNomLatin extends Decoupage {
 | 
        
           |  |  | 17 |   | 
        
           |  |  | 18 | 	private $expression_principale = array();
 | 
        
           |  |  | 19 | 	private $expression_complement = array();
 | 
        
           |  |  | 20 |   | 
        
           |  |  | 21 | 	function DecoupageNomLatin()
 | 
        
           |  |  | 22 | 	{
 | 
        
           |  |  | 23 | 		parent::__construct();
 | 
        
           |  |  | 24 |   | 
        
           |  |  | 25 | 		// Genre et nom supragénérique
 | 
        
           |  |  | 26 | 		$this->expression_principale[1] = "/^((?:$this->hyb |)$this->Gen)(?:( $this->Inf)|)$/u";
 | 
        
           |  |  | 27 | 		// Sp
 | 
        
           |  |  | 28 | 		$this->expression_principale[2] = "/^((?:$this->hyb |)$this->Gen) ((?:($this->hyb) |$this->Dou|)(?:$this->Epi|$this->Dou))(?:((?:,| $this->Ran) $this->Inf)| agg\.|)$/u";
 | 
        
           |  |  | 29 | 		// Rang infragénérique et supraspécifique
 | 
        
           |  |  | 30 | 		$this->expression_principale[3] = '/^('.$this->Gen.') ('.$this->Ran.') ('.$this->Gen.'|.'.$this->Epi.')(?:(, '.$this->Inf.')|)$/u';
 | 
        
           |  |  | 31 | 		// Hybride interspécifique
 | 
        
           |  |  | 32 | 		$this->expression_principale[4] = "/^((?:$this->Gen) $this->Epi (?:($this->Ran) $this->Epi )?x $this->Epi(?: ($this->Ran) $this->Epi)?)$/u";
 | 
        
           |  |  | 33 | 		// Aggrégat
 | 
        
           |  |  | 34 | 		$this->expression_principale[5] = "/^($this->Gen) ($this->Epi) (agg\.)(?:( $this->Inf)|)$/u";//
 | 
        
           |  |  | 35 |   | 
        
           |  |  | 36 | 		// Epithète infra-spécifique
 | 
        
           |  |  | 37 | 		$this->expression_complement[1] = "/^ ($this->Ran) ((?:($this->hyb) |$this->Dou|)(?:$this->Epi|$this->Dou))(?:((?:,| $this->Ran) $this->Inf)|)$/Uu";
 | 
        
           |  |  | 38 | 		// Cultivar
 | 
        
           |  |  | 39 | 		$this->expression_complement[5] = "/^ ($this->Ran_ht) ((?:(?:$this->Epi_cv) ?)+)$/u";
 | 
        
           |  |  | 40 |   | 
        
           |  |  | 41 | 	}
 | 
        
           |  |  | 42 |   | 
        
           |  |  | 43 | 	public function decouper($nom_latin)
 | 
        
           |  |  | 44 |     {
 | 
        
           |  |  | 45 |     	$aso_nom_decompo = array(	'nom_genre' => '', 'nom_sp' => '', 'auteur_sp' => '', 'nom_complement' => '',
 | 
        
           |  |  | 46 | 									'type_infrasp' => '', 'nom_infrasp' => '',
 | 
        
           |  |  | 47 | 									'num_nomenc' => '', 'num_taxo' => '', 'rang_taxonomique' => '',
 | 
        
           |  |  | 48 | 									'nom_courant' => '', 'nom_superieur' => '', 'agg' => '');
 | 
        
           |  |  | 49 |     	$aso_nom_decompo['nom_complet'] = $nom_latin;
 | 
        
           |  |  | 50 | 		while ($nom_latin != '') {
 | 
        
           |  |  | 51 | 			$morceau = array();
 | 
        
           |  |  | 52 | 			if (preg_match($this->expression_principale[4], $nom_latin, $morceau)) {// Formule d'hybridation
 | 
        
           |  |  | 53 | 				// Nous tentons de déterminer le rang de l'hybride
 | 
        
           |  |  | 54 | 				if (isset($morceau[2]) && isset($morceau[3]) && $morceau[2] == $morceau[3]) {
 | 
        
           |  |  | 55 | 					$aso_nom_decompo['rang_taxonomique'] = $this->attribuerCodeRang('n-'.$morceau[2]);
 | 
        
           |  |  | 56 | 				} else {
 | 
        
           |  |  | 57 | 					$aso_nom_decompo['rang_taxonomique'] = 260;// Hybride instersp.
 | 
        
           |  |  | 58 | 				}
 | 
        
           |  |  | 59 | 				$aso_nom_decompo['mark_hybride_interspecifique'] = 'x';
 | 
        
           |  |  | 60 | 				$aso_nom_decompo['formule_hybridation'] = $morceau[0];
 | 
        
           |  |  | 61 | 				$nom_latin = '';
 | 
        
           |  |  | 62 | 			} else if (preg_match($this->expression_principale[5], $nom_latin, $morceau)) {// agg.
 | 
        
           |  |  | 63 | 				$aso_nom_decompo['rang_taxonomique'] = 240;// agg.
 | 
        
           |  |  | 64 | 				$aso_nom_decompo['nom_genre'] = $morceau[1];
 | 
        
           |  |  | 65 | 				$aso_nom_decompo['nom_sp'] = $morceau[2];
 | 
        
           |  |  | 66 | 				$aso_nom_decompo['agg'] = $morceau[3];
 | 
        
           |  |  | 67 | 				$nom_latin = $morceau[4];
 | 
        
           |  |  | 68 | 				$aso_nom_decompo['nom_superieur'] = $morceau[1];
 | 
        
           |  |  | 69 | 				$aso_nom_decompo['nom_courant'] = $morceau[2];
 | 
        
           |  |  | 70 | 			} else if (preg_match($this->expression_principale[2], $nom_latin, $morceau)) {// Nom d'sp.
 | 
        
           |  |  | 71 | 				// Nous regardons si nous avons à faire à un hybride
 | 
        
           |  |  | 72 | 				if (preg_match('/^'.$this->hyb.'$/', $morceau[3])) {
 | 
        
           |  |  | 73 | 					$aso_nom_decompo['rang_taxonomique'] = 260;// hybride intersp.
 | 
        
           |  |  | 74 | 					$aso_nom_decompo['mark_hybride_interspecifique'] = strtolower($morceau[3]);
 | 
        
           |  |  | 75 | 				} else if (preg_match('/^'.$this->Epi_nn_hy.'$/', $morceau[2])) {
 | 
        
           |  |  | 76 | 					$aso_nom_decompo['rang_taxonomique'] = 260;// hybride intersp.
 | 
        
           |  |  | 77 | 					$aso_nom_decompo['mark_hybride_interspecifique'] = 'x';
 | 
        
           |  |  | 78 | 				} else {
 | 
        
           |  |  | 79 | 					$aso_nom_decompo['rang_taxonomique'] = 250;// sp.
 | 
        
           |  |  | 80 | 				}
 | 
        
           |  |  | 81 | 				// Nous atribuons le genre
 | 
        
           |  |  | 82 | 				$aso_nom_decompo['nom_genre'] = $morceau[1];
 | 
        
           |  |  | 83 | 				// Nous regardons si nous avons à faire à une phrase non nommé (ex : sp.1, spp., nsp.)
 | 
        
           |  |  | 84 | 				if (preg_match('/^'.$this->Epi_nn.'$/', $morceau[2])) {
 | 
        
           |  |  | 85 | 					$aso_nom_decompo['phrase_nom_non_nomme'] = $morceau[2];// hybride intersp.
 | 
        
           |  |  | 86 | 					$aso_nom_decompo['nom_sp'] = '';
 | 
        
           |  |  | 87 | 				} else {
 | 
        
           |  |  | 88 | 					$aso_nom_decompo['nom_sp'] = $morceau[2];
 | 
        
           |  |  | 89 | 				}
 | 
        
           |  |  | 90 | 				$nom_latin = $morceau[4];
 | 
        
           |  |  | 91 | 				$aso_nom_decompo['nom_superieur'] = $morceau[1];
 | 
        
           |  |  | 92 | 				$aso_nom_decompo['nom_courant'] = $morceau[2];
 | 
        
           |  |  | 93 | 			} else if (preg_match($this->expression_principale[3], $nom_latin, $morceau)) {// Nom infragénérique et supraspécifique
 | 
        
           |  |  | 94 | 				$aso_nom_decompo['nom_genre'] = $morceau[1];
 | 
        
           |  |  | 95 | 				$aso_nom_decompo['rang_taxonomique'] = $this->attribuerCodeRang($morceau[2]);
 | 
        
           |  |  | 96 | 				// Nous regardons si nous avons à faire à un groupe
 | 
        
           |  |  | 97 | 				if (preg_match('/^'.$this->Ran_ig_gr.'$/', $morceau[2])) {
 | 
        
           |  |  | 98 | 					$aso_nom_decompo['nom_sp'] = $morceau[3];
 | 
        
           |  |  | 99 | 				} else {
 | 
        
           |  |  | 100 | 					$aso_nom_decompo['nom_infra_genre'] = $morceau[3];
 | 
        
           |  |  | 101 | 				}
 | 
        
           |  |  | 102 | 				$nom_latin = $morceau[4];
 | 
        
           |  |  | 103 | 				$aso_nom_decompo['nom_superieur'] = $morceau[1];
 | 
        
           |  |  | 104 | 				$aso_nom_decompo['nom_courant'] = $morceau[3];
 | 
        
           |  |  | 105 | 			} else if (preg_match($this->expression_principale[1], $nom_latin, $morceau)) {// Nom de genre et supragénérique
 | 
        
           |  |  | 106 | 				$aso_nom_decompo['rang_taxonomique'] = $this->verifierTerminaisonLatine($nom_latin);
 | 
        
           |  |  | 107 | 				$aso_nom_decompo['nom_suprasp'] = $morceau[1];
 | 
        
           |  |  | 108 | 				$nom_latin = $morceau[2];
 | 
        
           |  |  | 109 | 				$aso_nom_decompo['nom_superieur'] = null;
 | 
        
           |  |  | 110 | 				$aso_nom_decompo['nom_courant'] = $morceau[1];
 | 
        
           |  |  | 111 | 			} else if (preg_match($this->expression_complement[5], $nom_latin, $morceau)) {// Cultivar
 | 
        
           |  |  | 112 | 				$aso_nom_decompo['rang_cultivar'] = $this->attribuerCodeRang($morceau[1]);
 | 
        
           |  |  | 113 | 				// Nous vérifions si nous avons à faire à un cultivar d'hybride
 | 
        
           |  |  | 114 | 				if ($aso_nom_decompo['mark_hybride_interspecifique'] == 'x' && $aso_nom_decompo['rang_cultivar'] == 460) {
 | 
        
           |  |  | 115 | 					$aso_nom_decompo['rang_cultivar'] = 470;
 | 
        
           |  |  | 116 | 				}
 | 
        
           |  |  | 117 | 				$aso_nom_decompo['cultivar'] = $morceau[2];
 | 
        
           |  |  | 118 | 				$nom_latin = '';
 | 
        
           |  |  | 119 | 			} else if (preg_match($this->expression_complement[1], $nom_latin, $morceau)) {// Nom infrasp.
 | 
        
           |  |  | 120 | 				if (preg_match('/^'.$this->hyb.'$/', $morceau[3])) {
 | 
        
           |  |  | 121 | 					$aso_nom_decompo['mark_hybride_interspecifique'] = strtolower($morceau[3]);
 | 
        
           |  |  | 122 | 				}
 | 
        
           |  |  | 123 | 				$aso_nom_decompo['rang_taxonomique'] = $this->attribuerCodeRang($morceau[1]);
 | 
        
           |  |  | 124 | 				$aso_nom_decompo['type_infrasp'] = $morceau[1];
 | 
        
           |  |  | 125 | 				$aso_nom_decompo['nom_infrasp'] = $morceau[2];
 | 
        
           |  |  | 126 | 				$nom_latin = $morceau[4];
 | 
        
           |  |  | 127 | 				$aso_nom_decompo['nom_superieur'] = $aso_nom_decompo['nom_courant'];
 | 
        
           |  |  | 128 | 				$aso_nom_decompo['nom_courant'] = $morceau[2];
 | 
        
           |  |  | 129 | 			} else {// Erreurs
 | 
        
           |  |  | 130 | 				$aso_nom_decompo['erreur_mark'] = 'erreur';
 | 
        
           |  |  | 131 | 				$aso_nom_decompo['erreur_notes'] = $nom_latin;
 | 
        
           |  |  | 132 | 				$nom_latin = '';
 | 
        
           |  |  | 133 | 			}
 | 
        
           |  |  | 134 | 		}
 | 
        
           |  |  | 135 | 		return $aso_nom_decompo;
 | 
        
           |  |  | 136 |     }
 | 
        
           |  |  | 137 |   | 
        
           |  |  | 138 | 	public function verifierTerminaisonLatine($nom_latin)
 | 
        
           |  |  | 139 | 	{
 | 
        
           |  |  | 140 |   | 
        
           |  |  | 141 | 		if (preg_match('/^Plantae$/', $nom_latin)) {// Règne
 | 
        
           |  |  | 142 | 			return 10;
 | 
        
           |  |  | 143 | 		} else if (preg_match('/phyta$/', $nom_latin)) {// Embranchement ou Division
 | 
        
           |  |  | 144 | 			return 30;
 | 
        
           |  |  | 145 | 		} else if (preg_match('/phytina$/', $nom_latin)) {// Sous-Embranchement ou Sous-Division
 | 
        
           |  |  | 146 | 			return 40;
 | 
        
           |  |  | 147 | 		} if (preg_match('/opsida$/', $nom_latin)) {// Classe
 | 
        
           |  |  | 148 | 			return 70;
 | 
        
           |  |  | 149 | 		} else if (preg_match('/idae$/', $nom_latin)) {// Sous-Classe
 | 
        
           |  |  | 150 | 			return 80;
 | 
        
           |  |  | 151 | 		} else if (preg_match('/ales$/', $nom_latin)) {// Ordre
 | 
        
           |  |  | 152 | 			return 100;
 | 
        
           |  |  | 153 | 		} else if (preg_match('/ineae$/', $nom_latin)) {// Sous-Ordre
 | 
        
           |  |  | 154 | 			return 110;
 | 
        
           |  |  | 155 | 		} else if (preg_match('/aceae$/', $nom_latin)) {// Famille
 | 
        
           |  |  | 156 | 			return 120;
 | 
        
           |  |  | 157 | 		} else if (preg_match('/oideae$/', $nom_latin)) {// Sous-Famille
 | 
        
           |  |  | 158 | 			return 130;
 | 
        
           |  |  | 159 | 		} else if (preg_match('/eae$/', $nom_latin)) {// Tribu
 | 
        
           |  |  | 160 | 			return 140;
 | 
        
           |  |  | 161 | 		} else if (preg_match('/inae$/', $nom_latin)) {// Sous-Tribu
 | 
        
           |  |  | 162 | 			return 150;
 | 
        
           |  |  | 163 | 		} else if (preg_match('/^[A-Z]/', $nom_latin)) {// Genre
 | 
        
           |  |  | 164 | 			return 160;
 | 
        
           |  |  | 165 | 		} else {
 | 
        
           |  |  | 166 | 			return 1;
 | 
        
           |  |  | 167 | 		}
 | 
        
           |  |  | 168 | 	}
 | 
        
           |  |  | 169 |   | 
        
           |  |  | 170 | 	static function fournirTableauAbreviationRang($type = 'tout')
 | 
        
           |  |  | 171 | 	{
 | 
        
           |  |  | 172 | 		$rang_supra_sp = array('subgen.', 'subg.', 'sect.');// l'abréviation du rang  est suivi par un nom supra spécifique commençant par une majuscule
 | 
        
           |  |  | 173 | 		$rang_supra_gr = array('gr.');// l'abréviation du rang est suivi par un nom ne commençant pas par une majuscule
 | 
        
           |  |  | 174 | 		$rang_supra_agg = array('agg.');// le nom latin est terminé par l'abréviation du rang
 | 
        
           |  |  | 175 | 		$rang_infra_sp = array(	'subsp.', 'n-subsp.', '[subsp.]', '[n-subsp.]',
 | 
        
           |  |  | 176 | 								'var.', 'nvar.', '[var.]',
 | 
        
           |  |  | 177 | 								'prol.', 'proles', 'n-proles.',
 | 
        
           |  |  | 178 | 								'f.', 'fa', 'fa.', 'forma',
 | 
        
           |  |  | 179 | 								'subvar.', 'convar.',
 | 
        
           |  |  | 180 | 								'cv.', 'Cv.',
 | 
        
           |  |  | 181 | 								'n-f.', 'n-fa', 'n-fa.',
 | 
        
           |  |  | 182 | 								'subf.', 'subfa', 'subfa.');
 | 
        
           |  |  | 183 | 		if ($type == 'supra') {
 | 
        
           |  |  | 184 | 			return $rang_supra_sp;
 | 
        
           |  |  | 185 | 		} else if ($type == 'supra-gr') {
 | 
        
           |  |  | 186 | 			return $rang_supra_gr;
 | 
        
           |  |  | 187 | 		} else if ($type == 'supra-agg') {
 | 
        
           |  |  | 188 | 			return $rang_supra_agg;
 | 
        
           |  |  | 189 | 		} else if ($type == 'infra') {
 | 
        
           |  |  | 190 | 			return $rang_infra_sp;
 | 
        
           |  |  | 191 | 		} else if ($type == 'tout') {
 | 
        
           |  |  | 192 | 			return array_merge($rang_supra_sp, $rang_supra_gr, $rang_supra_agg, $rang_infra_sp);
 | 
        
           |  |  | 193 | 		}
 | 
        
           |  |  | 194 | 	}
 | 
        
           |  |  | 195 |   | 
        
           |  |  | 196 | 	static function actualiserCodeRang($code_rang)
 | 
        
           |  |  | 197 | 	{
 | 
        
           |  |  | 198 | 		$aso_rang = array(	'1' => '10', // Règne
 | 
        
           |  |  | 199 | 							'3' => '20', // Sous-Règne
 | 
        
           |  |  | 200 | 							'5' => '30', // Phylum
 | 
        
           |  |  | 201 | 							'7' => '40', // Sub-Phylum
 | 
        
           |  |  | 202 | 							'9' => '50', // division
 | 
        
           |  |  | 203 | 							'15' => '60', // sous-division
 | 
        
           |  |  | 204 | 							'20' => '70', // classe
 | 
        
           |  |  | 205 | 							'25' => '80', // sous-classe
 | 
        
           |  |  | 206 | 							'30' => '100', // ordre
 | 
        
           |  |  | 207 | 							'35' => '110', // sous-ordre
 | 
        
           |  |  | 208 | 							'40' => '120', // famille
 | 
        
           |  |  | 209 | 							'45' => '130', // sous-famille
 | 
        
           |  |  | 210 | 							'50' => '140', // tribu
 | 
        
           |  |  | 211 | 							'55' => '150', // sous-tribu
 | 
        
           |  |  | 212 | 							'60' => '160', // genre
 | 
        
           |  |  | 213 | 							'62' => '170', // genre hybride (nouveau compatibilité flore Réunion)
 | 
        
           |  |  | 214 | 							'65' => '180', // sous-genre
 | 
        
           |  |  | 215 | 							'65' => '190', // section
 | 
        
           |  |  | 216 | 							'75' => '200', // sous-section
 | 
        
           |  |  | 217 | 							'80' => '210', // série
 | 
        
           |  |  | 218 | 							'85' => '220', // sous-série
 | 
        
           |  |  | 219 | 							'90' => '230', // groupe
 | 
        
           |  |  | 220 | 							'95' => '240', // aggrégat
 | 
        
           |  |  | 221 | 							'100' => '250', // espèce
 | 
        
           |  |  | 222 | 							'102' => '260', // espèce hybride intragénérique
 | 
        
           |  |  | 223 | 							'104' => '260', // espèce hybride intergénérique
 | 
        
           |  |  | 224 | 							'110' => '280', // sous-espèce
 | 
        
           |  |  | 225 | 							'112' => '300', // sous-espèce hybride : hybride entre deux sous-espèces d'une espèce non hybride ; exemple : Polypodium vulgare L. nsubsp. mantoniae (Rothm.) Schidlay (Polypodium vulgare L. subsp. vulgare x Polypodium vulgare L. subsp. prionodes (Aschers.) Rothm.).
 | 
        
           |  |  | 226 | 							'113' => '310', // sous-espèce hybride : sous-espèce d'espèce hybride sans spécification du rang parental (subspecies) (voir ICBN, art. H.12.1).
 | 
        
           |  |  | 227 | 							'114' => '300', // sous-espèce hybride : sous-espèce hybride d'espèce hybride (nothosubspecies) (voir ICBN, art. H.12.1) ; exemple : Mentha x piperita L. nsubsp. piperita (Mentha aquatica L. x Mentha spicata L. subsp. glabrata (Lej. et Court.) Lebeau).
 | 
        
           |  |  | 228 | 							'115' => '300', // sous-espèce hybride
 | 
        
           |  |  | 229 | 							'120' => '1', // infra2
 | 
        
           |  |  | 230 | 							'122' => '330', // prole, race : peu employé souvent issu de nom ancien (antérieur au code).
 | 
        
           |  |  | 231 | 							'124' => '340', // prole, race hybride : peu employé souvent issu de nom ancien (antérieur au code).
 | 
        
           |  |  | 232 | 							'132' => '350', // convarietas : si on le conscidère comme un rang intermédiaire entre la sous-espèce et la variété. Voir aussi n°200.
 | 
        
           |  |  | 233 | 							'130' => '1', // infra3 : niveau infra-spécifique de troisième niveau, sans plus de précision.
 | 
        
           |  |  | 234 | 							'140' => '360', // variété
 | 
        
           |  |  | 235 | 							'142' => '380', // variété : hybride entre deux variétés d'une espèce non hybride.
 | 
        
           |  |  | 236 | 							'143' => '390', // variété : variété d'espèce hybride sans spécification du rang parental (varietas) (voir ICBN, art. H.12.1); exemple : Populus x canadensis Moench var. marilandica (Poir.) Rehder.
 | 
        
           |  |  | 237 | 							'144' => '380', // variété : variété hybride d'espèce hybride (nothovarietas) ; exemple : Salix x sepulcralis Simonk. nvar. chrysocoma (Dode) Meikle.
 | 
        
           |  |  | 238 | 							'145' => '380', // variété hybride
 | 
        
           |  |  | 239 | 							'150' => '410', // sous-variété
 | 
        
           |  |  | 240 | 							'160' => '420', // forme
 | 
        
           |  |  | 241 | 							'162' => '430', // forme : hybride entre deux formes d'une espèce non hybride.
 | 
        
           |  |  | 242 | 							'163' => '430', // forme : forme d'espèce hybride sans spécification du rang parental (forma) (voir ICBN, art. H.12.1); exemple : Mentha x piperita L. f. hirsuta Sole.
 | 
        
           |  |  | 243 | 							'164' => '430', // forme : forme hybride d'espèce hybride (nothoforma).
 | 
        
           |  |  | 244 | 							'170' => '440', // sous-forme
 | 
        
           |  |  | 245 | 							'200' => '450', // groupe de cultivar
 | 
        
           |  |  | 246 | 							'210' => '460', // cultivar
 | 
        
           |  |  | 247 | 							'220' => '470', // cultivar d'hybride
 | 
        
           |  |  | 248 | 							'0' => '480' // clade
 | 
        
           |  |  | 249 | 							);
 | 
        
           |  |  | 250 | 		return $aso_rang[$code_rang];
 | 
        
           |  |  | 251 | 	}
 | 
        
           |  |  | 252 |   | 
        
           |  |  | 253 | 	public function attribuerCodeInfra($str_abreviation_type_infra)
 | 
        
           |  |  | 254 | 	{
 | 
        
           |  |  | 255 | 		$aso_code_infra = array('type' => '', 'code' => 0, 'rang' => 2 );
 | 
        
           |  |  | 256 |   | 
        
           |  |  | 257 | 		switch ($str_abreviation_type_infra) {
 | 
        
           |  |  | 258 | 			case 'subgen.' :
 | 
        
           |  |  | 259 | 			case 'subg.' :
 | 
        
           |  |  | 260 | 				$aso_code_infra['rang'] = 180;
 | 
        
           |  |  | 261 | 				break;
 | 
        
           |  |  | 262 | 			case 'sect.' :
 | 
        
           |  |  | 263 | 				$aso_code_infra['rang'] = 190;
 | 
        
           |  |  | 264 | 				break;
 | 
        
           |  |  | 265 | 			case 'gr.' :
 | 
        
           |  |  | 266 | 				$aso_code_infra['rang'] = 230;
 | 
        
           |  |  | 267 | 				break;
 | 
        
           |  |  | 268 | 			case 'subsp.' :
 | 
        
           |  |  | 269 | 				$aso_code_infra['type'] = 'infra1';
 | 
        
           |  |  | 270 | 				$aso_code_infra['code'] = 1;
 | 
        
           |  |  | 271 | 				$aso_code_infra['rang'] = 280;
 | 
        
           |  |  | 272 | 				break;
 | 
        
           |  |  | 273 | 			case 'n-subsp.' :
 | 
        
           |  |  | 274 | 				$aso_code_infra['type'] = 'infra1';
 | 
        
           |  |  | 275 | 				$aso_code_infra['code'] = 2;
 | 
        
           |  |  | 276 | 				$aso_code_infra['rang'] = 300;
 | 
        
           |  |  | 277 | 				break;
 | 
        
           |  |  | 278 | 			case '[subsp.]' :
 | 
        
           |  |  | 279 | 				$aso_code_infra['type'] = 'infra1';
 | 
        
           |  |  | 280 | 				$aso_code_infra['code'] = 3;
 | 
        
           |  |  | 281 | 				$aso_code_infra['rang'] = 290;
 | 
        
           |  |  | 282 | 				break;
 | 
        
           |  |  | 283 | 			case '[n-subsp.]' :
 | 
        
           |  |  | 284 | 				$aso_code_infra['type'] = 'infra1';
 | 
        
           |  |  | 285 | 				$aso_code_infra['code'] = 4;
 | 
        
           |  |  | 286 | 				$aso_code_infra['rang'] = 310;
 | 
        
           |  |  | 287 | 				break;
 | 
        
           |  |  | 288 | 			case 'var.' :
 | 
        
           |  |  | 289 | 				$aso_code_infra['type'] = 'infra2';
 | 
        
           |  |  | 290 | 				$aso_code_infra['code'] = 1;
 | 
        
           |  |  | 291 | 				$aso_code_infra['rang'] = 360;
 | 
        
           |  |  | 292 | 				break;
 | 
        
           |  |  | 293 | 			case '[var.]' :
 | 
        
           |  |  | 294 | 				$aso_code_infra['type'] = 'infra2';
 | 
        
           |  |  | 295 | 				$aso_code_infra['code'] = 2;
 | 
        
           |  |  | 296 | 				$aso_code_infra['rang'] = 370;
 | 
        
           |  |  | 297 | 				break;
 | 
        
           |  |  | 298 | 			case 'n-var.' :
 | 
        
           |  |  | 299 | 				$aso_code_infra['type'] = 'infra2';
 | 
        
           |  |  | 300 | 				$aso_code_infra['code'] = 3;
 | 
        
           |  |  | 301 | 				$aso_code_infra['rang'] = 380;
 | 
        
           |  |  | 302 | 				break;
 | 
        
           |  |  | 303 | 	        case 'nvar.' :
 | 
        
           |  |  | 304 | 	        	$aso_code_infra['type'] = 'infra2';
 | 
        
           |  |  | 305 | 				$aso_code_infra['code'] = 3;
 | 
        
           |  |  | 306 | 				$aso_code_infra['rang'] = 384;
 | 
        
           |  |  | 307 | 				break;
 | 
        
           |  |  | 308 | 	        case '[n-var.]' :
 | 
        
           |  |  | 309 | 	            $aso_code_infra['type'] = 'infra2';
 | 
        
           |  |  | 310 | 	            $aso_code_infra['code'] = 5;
 | 
        
           |  |  | 311 | 	            $aso_code_infra['rang'] = 390;
 | 
        
           |  |  | 312 | 	        	break;
 | 
        
           |  |  | 313 | 	        case 'prol.' :
 | 
        
           |  |  | 314 | 	        case 'proles' :
 | 
        
           |  |  | 315 | 	            $aso_code_infra['type'] = 'infra3';
 | 
        
           |  |  | 316 | 	            $aso_code_infra['code'] = 2;
 | 
        
           |  |  | 317 | 	            $aso_code_infra['rang'] = 330;
 | 
        
           |  |  | 318 | 	        	break;
 | 
        
           |  |  | 319 | 	        case 'n-proles' :
 | 
        
           |  |  | 320 | 	        case 'n-proles.' :
 | 
        
           |  |  | 321 | 	            $aso_code_infra['type'] = 'infra3';
 | 
        
           |  |  | 322 | 	            $aso_code_infra['code'] = 1;
 | 
        
           |  |  | 323 | 	            $aso_code_infra['rang'] = 340;
 | 
        
           |  |  | 324 | 	        	break;
 | 
        
           |  |  | 325 | 	        case 'f.':
 | 
        
           |  |  | 326 | 			case 'fa':
 | 
        
           |  |  | 327 | 			case 'fa.':
 | 
        
           |  |  | 328 | 			case 'forma':
 | 
        
           |  |  | 329 | 	            $aso_code_infra['type'] = 'infra3';
 | 
        
           |  |  | 330 | 	            $aso_code_infra['code'] = 3;
 | 
        
           |  |  | 331 | 	            $aso_code_infra['rang'] = 420;
 | 
        
           |  |  | 332 | 	        	break;
 | 
        
           |  |  | 333 | 	        case 'subvar.' :
 | 
        
           |  |  | 334 | 	            $aso_code_infra['type'] = 'infra3';
 | 
        
           |  |  | 335 | 	            $aso_code_infra['code'] = 4;
 | 
        
           |  |  | 336 | 	            $aso_code_infra['rang'] = 410;
 | 
        
           |  |  | 337 | 	        	break;
 | 
        
           |  |  | 338 | 	        case 'convar.' :
 | 
        
           |  |  | 339 | 	            $aso_code_infra['type'] = 'infra3';
 | 
        
           |  |  | 340 | 	            $aso_code_infra['code'] = 5;
 | 
        
           |  |  | 341 | 	            $aso_code_infra['rang'] = 350;
 | 
        
           |  |  | 342 | 	        	break;
 | 
        
           |  |  | 343 | 	        case 'cv.':
 | 
        
           |  |  | 344 | 	        case 'Cv.':
 | 
        
           |  |  | 345 | 	            $aso_code_infra['type'] = 'infra3';
 | 
        
           |  |  | 346 | 	            $aso_code_infra['code'] = 6;
 | 
        
           |  |  | 347 | 	            $aso_code_infra['rang'] = 460;
 | 
        
           |  |  | 348 | 	        	break;
 | 
        
           |  |  | 349 | 	        case 'n-f.':
 | 
        
           |  |  | 350 | 	        case 'n-fa':
 | 
        
           |  |  | 351 | 	        case 'n-fa.':
 | 
        
           |  |  | 352 | 	            $aso_code_infra['type'] = 'infra3';
 | 
        
           |  |  | 353 | 	            $aso_code_infra['code'] = 7;
 | 
        
           |  |  | 354 | 	            $aso_code_infra['rang'] = 430;
 | 
        
           |  |  | 355 | 	        	break;
 | 
        
           |  |  | 356 | 	        case 'subf.':
 | 
        
           |  |  | 357 | 	        case 'subfa':
 | 
        
           |  |  | 358 | 	        case 'subfa.':
 | 
        
           |  |  | 359 | 	            $aso_code_infra['type'] = 'infra3';
 | 
        
           |  |  | 360 | 	            $aso_code_infra['code'] = 8;
 | 
        
           |  |  | 361 | 	            $aso_code_infra['rang'] = 440;
 | 
        
           |  |  | 362 | 	        	break;
 | 
        
           |  |  | 363 | 	        default:
 | 
        
           |  |  | 364 | 				$aso_code_infra['erreur_mark'] = 'erreur';
 | 
        
           |  |  | 365 | 				$aso_code_infra['erreur_notes'] =  $str_abreviation_type_infra;
 | 
        
           |  |  | 366 | 				$aso_code_infra['rang'] = 2;
 | 
        
           |  |  | 367 | 	    }
 | 
        
           |  |  | 368 |   | 
        
           |  |  | 369 | 	    return $aso_code_infra;
 | 
        
           |  |  | 370 | 	}
 | 
        
           |  |  | 371 |   | 
        
           |  |  | 372 | 	public function attribuerCodeRang($str_abreviation_type_infra)
 | 
        
           |  |  | 373 | 	{
 | 
        
           |  |  | 374 | 		$aso_code_infra = $this->attribuerCodeInfra($str_abreviation_type_infra);
 | 
        
           |  |  | 375 |     	return $aso_code_infra['rang'];
 | 
        
           |  |  | 376 | 	}
 | 
        
           |  |  | 377 | }
 | 
        
           |  |  | 378 | ?>
 |