1,25 → 1,26 |
<?php |
// Encodage : UTF-8 |
// +-------------------------------------------------------------------------------------------------------------------+ |
// declare(encoding='UTF-8'); |
/** |
* Découpage des noms latins |
* |
* Description : classe permettant de découper les noms latins. |
* |
//Auteur original : |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
* @copyright Tela-Botanica 1999-2009 |
* @licence GPL v3 & CeCILL v2 |
* @version $Id: DecoupageNomLatin.class.php 1873 2009-03-31 10:07:24Z Jean-Pascal MILCENT $ |
*/ |
// +-------------------------------------------------------------------------------------------------------------------+ |
* Classe de découpage des noms latins. |
* |
* @internal Mininum PHP version : 5.2 |
* @category CEL |
* @package Services |
* @subpackage Bibliothèques |
* @version 0.1 |
* @author Mathias CHOUET <mathias@tela-botanica.org> |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
* @author Aurelien PERONNET <aurelien@tela-botanica.org> |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt> |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt> |
* @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org> |
*/ |
class DecoupageNomLatin extends Decoupage { |
|
private $expression_principale = array(); |
private $expression_complement = array(); |
|
function DecoupageNomLatin() |
{ |
public function __construct() { |
parent::__construct(); |
|
// Genre et nom supragénérique |
32,21 → 33,20 |
$this->expression_principale[4] = "/^((?:$this->Gen) $this->Epi (?:($this->Ran) $this->Epi )?x $this->Epi(?: ($this->Ran) $this->Epi)?)$/u"; |
// Aggrégat |
$this->expression_principale[5] = "/^($this->Gen) ($this->Epi) (agg\.)(?:( $this->Inf)|)$/u";// |
|
|
// Epithète infra-spécifique |
$this->expression_complement[1] = "/^ ($this->Ran) ((?:($this->hyb) |$this->Dou|)(?:$this->Epi|$this->Dou))(?:((?:,| $this->Ran) $this->Inf)|)$/Uu"; |
// Cultivar |
$this->expression_complement[5] = "/^ ($this->Ran_ht) ((?:(?:$this->Epi_cv) ?)+)$/u"; |
|
|
} |
|
public function decouper($nom_latin) |
{ |
$aso_nom_decompo = array( 'nom_genre' => '', 'nom_sp' => '', 'auteur_sp' => '', 'nom_complement' => '', |
'type_infrasp' => '', 'nom_infrasp' => '', |
'num_nomenc' => '', 'num_taxo' => '', 'rang_taxonomique' => '', |
'nom_courant' => '', 'nom_superieur' => '', 'agg' => ''); |
$aso_nom_decompo['nom_complet'] = $nom_latin; |
|
public function decouper($nom_latin) { |
$aso_nom_decompo = array('nom_genre' => '', 'nom_sp' => '', 'auteur_sp' => '', 'nom_complement' => '', |
'type_infrasp' => '', 'nom_infrasp' => '', |
'num_nomenc' => '', 'num_taxo' => '', 'rang_taxonomique' => '', |
'nom_courant' => '', 'nom_superieur' => '', 'agg' => ''); |
$aso_nom_decompo['nom_complet'] = $nom_latin; |
while ($nom_latin != '') { |
$morceau = array(); |
if (preg_match($this->expression_principale[4], $nom_latin, $morceau)) {// Formule d'hybridation |
134,10 → 134,8 |
} |
return $aso_nom_decompo; |
} |
|
public function verifierTerminaisonLatine($nom_latin) |
{ |
|
|
public function verifierTerminaisonLatine($nom_latin) { |
if (preg_match('/^Plantae$/', $nom_latin)) {// Règne |
return 10; |
} else if (preg_match('/phyta$/', $nom_latin)) {// Embranchement ou Division |
166,20 → 164,19 |
return 1; |
} |
} |
|
static function fournirTableauAbreviationRang($type = 'tout') |
{ |
$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 |
|
static function fournirTableauAbreviationRang($type = 'tout') { |
$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 |
$rang_supra_gr = array('gr.');// l'abréviation du rang est suivi par un nom ne commençant pas par une majuscule |
$rang_supra_agg = array('agg.');// le nom latin est terminé par l'abréviation du rang |
$rang_infra_sp = array( 'subsp.', 'n-subsp.', '[subsp.]', '[n-subsp.]', |
'var.', 'nvar.', '[var.]', |
'prol.', 'proles', 'n-proles.', |
'f.', 'fa', 'fa.', 'forma', |
'subvar.', 'convar.', |
'cv.', 'Cv.', |
'n-f.', 'n-fa', 'n-fa.', |
'subf.', 'subfa', 'subfa.'); |
$rang_infra_sp = array('subsp.', 'n-subsp.', '[subsp.]', '[n-subsp.]', |
'var.', 'nvar.', '[var.]', |
'prol.', 'proles', 'n-proles.', |
'f.', 'fa', 'fa.', 'forma', |
'subvar.', 'convar.', |
'cv.', 'Cv.', |
'n-f.', 'n-fa', 'n-fa.', |
'subf.', 'subfa', 'subfa.'); |
if ($type == 'supra') { |
return $rang_supra_sp; |
} else if ($type == 'supra-gr') { |
193,67 → 190,64 |
} |
} |
|
static function actualiserCodeRang($code_rang) |
{ |
$aso_rang = array( '1' => '10', // Règne |
'3' => '20', // Sous-Règne |
'5' => '30', // Phylum |
'7' => '40', // Sub-Phylum |
'9' => '50', // division |
'15' => '60', // sous-division |
'20' => '70', // classe |
'25' => '80', // sous-classe |
'30' => '100', // ordre |
'35' => '110', // sous-ordre |
'40' => '120', // famille |
'45' => '130', // sous-famille |
'50' => '140', // tribu |
'55' => '150', // sous-tribu |
'60' => '160', // genre |
'62' => '170', // genre hybride (nouveau compatibilité flore Réunion) |
'65' => '180', // sous-genre |
'65' => '190', // section |
'75' => '200', // sous-section |
'80' => '210', // série |
'85' => '220', // sous-série |
'90' => '230', // groupe |
'95' => '240', // aggrégat |
'100' => '250', // espèce |
'102' => '260', // espèce hybride intragénérique |
'104' => '260', // espèce hybride intergénérique |
'110' => '280', // sous-espèce |
'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.). |
'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). |
'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). |
'115' => '300', // sous-espèce hybride |
'120' => '1', // infra2 |
'122' => '330', // prole, race : peu employé souvent issu de nom ancien (antérieur au code). |
'124' => '340', // prole, race hybride : peu employé souvent issu de nom ancien (antérieur au code). |
'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. |
'130' => '1', // infra3 : niveau infra-spécifique de troisième niveau, sans plus de précision. |
'140' => '360', // variété |
'142' => '380', // variété : hybride entre deux variétés d'une espèce non hybride. |
'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. |
'144' => '380', // variété : variété hybride d'espèce hybride (nothovarietas) ; exemple : Salix x sepulcralis Simonk. nvar. chrysocoma (Dode) Meikle. |
'145' => '380', // variété hybride |
'150' => '410', // sous-variété |
'160' => '420', // forme |
'162' => '430', // forme : hybride entre deux formes d'une espèce non hybride. |
'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. |
'164' => '430', // forme : forme hybride d'espèce hybride (nothoforma). |
'170' => '440', // sous-forme |
'200' => '450', // groupe de cultivar |
'210' => '460', // cultivar |
'220' => '470', // cultivar d'hybride |
'0' => '480' // clade |
); |
static function actualiserCodeRang($code_rang) { |
$aso_rang = array('1' => '10', // Règne |
'3' => '20', // Sous-Règne |
'5' => '30', // Phylum |
'7' => '40', // Sub-Phylum |
'9' => '50', // division |
'15' => '60', // sous-division |
'20' => '70', // classe |
'25' => '80', // sous-classe |
'30' => '100', // ordre |
'35' => '110', // sous-ordre |
'40' => '120', // famille |
'45' => '130', // sous-famille |
'50' => '140', // tribu |
'55' => '150', // sous-tribu |
'60' => '160', // genre |
'62' => '170', // genre hybride (nouveau compatibilité flore Réunion) |
'65' => '180', // sous-genre |
'65' => '190', // section |
'75' => '200', // sous-section |
'80' => '210', // série |
'85' => '220', // sous-série |
'90' => '230', // groupe |
'95' => '240', // aggrégat |
'100' => '250', // espèce |
'102' => '260', // espèce hybride intragénérique |
'104' => '260', // espèce hybride intergénérique |
'110' => '280', // sous-espèce |
'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.). |
'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). |
'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). |
'115' => '300', // sous-espèce hybride |
'120' => '1', // infra2 |
'122' => '330', // prole, race : peu employé souvent issu de nom ancien (antérieur au code). |
'124' => '340', // prole, race hybride : peu employé souvent issu de nom ancien (antérieur au code). |
'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. |
'130' => '1', // infra3 : niveau infra-spécifique de troisième niveau, sans plus de précision. |
'140' => '360', // variété |
'142' => '380', // variété : hybride entre deux variétés d'une espèce non hybride. |
'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. |
'144' => '380', // variété : variété hybride d'espèce hybride (nothovarietas) ; exemple : Salix x sepulcralis Simonk. nvar. chrysocoma (Dode) Meikle. |
'145' => '380', // variété hybride |
'150' => '410', // sous-variété |
'160' => '420', // forme |
'162' => '430', // forme : hybride entre deux formes d'une espèce non hybride. |
'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. |
'164' => '430', // forme : forme hybride d'espèce hybride (nothoforma). |
'170' => '440', // sous-forme |
'200' => '450', // groupe de cultivar |
'210' => '460', // cultivar |
'220' => '470', // cultivar d'hybride |
'0' => '480' // clade |
); |
return $aso_rang[$code_rang]; |
} |
|
public function attribuerCodeInfra($str_abreviation_type_infra) |
{ |
public function attribuerCodeInfra($str_abreviation_type_infra) { |
$aso_code_infra = array('type' => '', 'code' => 0, 'rang' => 2 ); |
|
switch ($str_abreviation_type_infra) { |
case 'subgen.' : |
case 'subg.' : |
300,79 → 294,76 |
$aso_code_infra['code'] = 3; |
$aso_code_infra['rang'] = 380; |
break; |
case 'nvar.' : |
$aso_code_infra['type'] = 'infra2'; |
case 'nvar.' : |
$aso_code_infra['type'] = 'infra2'; |
$aso_code_infra['code'] = 3; |
$aso_code_infra['rang'] = 384; |
break; |
case '[n-var.]' : |
$aso_code_infra['type'] = 'infra2'; |
$aso_code_infra['code'] = 5; |
$aso_code_infra['rang'] = 390; |
break; |
case 'prol.' : |
case 'proles' : |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 2; |
$aso_code_infra['rang'] = 330; |
break; |
case 'n-proles' : |
case 'n-proles.' : |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 1; |
$aso_code_infra['rang'] = 340; |
break; |
case 'f.': |
case '[n-var.]' : |
$aso_code_infra['type'] = 'infra2'; |
$aso_code_infra['code'] = 5; |
$aso_code_infra['rang'] = 390; |
break; |
case 'prol.' : |
case 'proles' : |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 2; |
$aso_code_infra['rang'] = 330; |
break; |
case 'n-proles' : |
case 'n-proles.' : |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 1; |
$aso_code_infra['rang'] = 340; |
break; |
case 'f.': |
case 'fa': |
case 'fa.': |
case 'forma': |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 3; |
$aso_code_infra['rang'] = 420; |
break; |
case 'subvar.' : |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 4; |
$aso_code_infra['rang'] = 410; |
break; |
case 'convar.' : |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 5; |
$aso_code_infra['rang'] = 350; |
break; |
case 'cv.': |
case 'Cv.': |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 6; |
$aso_code_infra['rang'] = 460; |
break; |
case 'n-f.': |
case 'n-fa': |
case 'n-fa.': |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 7; |
$aso_code_infra['rang'] = 430; |
break; |
case 'subf.': |
case 'subfa': |
case 'subfa.': |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 8; |
$aso_code_infra['rang'] = 440; |
break; |
default: |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 3; |
$aso_code_infra['rang'] = 420; |
break; |
case 'subvar.' : |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 4; |
$aso_code_infra['rang'] = 410; |
break; |
case 'convar.' : |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 5; |
$aso_code_infra['rang'] = 350; |
break; |
case 'cv.': |
case 'Cv.': |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 6; |
$aso_code_infra['rang'] = 460; |
break; |
case 'n-f.': |
case 'n-fa': |
case 'n-fa.': |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 7; |
$aso_code_infra['rang'] = 430; |
break; |
case 'subf.': |
case 'subfa': |
case 'subfa.': |
$aso_code_infra['type'] = 'infra3'; |
$aso_code_infra['code'] = 8; |
$aso_code_infra['rang'] = 440; |
break; |
default: |
$aso_code_infra['erreur_mark'] = 'erreur'; |
$aso_code_infra['erreur_notes'] = $str_abreviation_type_infra; |
$aso_code_infra['rang'] = 2; |
} |
|
return $aso_code_infra; |
} |
return $aso_code_infra; |
} |
|
public function attribuerCodeRang($str_abreviation_type_infra) |
{ |
|
public function attribuerCodeRang($str_abreviation_type_infra) { |
$aso_code_infra = $this->attribuerCodeInfra($str_abreviation_type_infra); |
return $aso_code_infra['rang']; |
return $aso_code_infra['rang']; |
} |
} |
?> |
} |