| Line 1... |
Line 1... |
| 1 |
<?php
|
1 |
<?php
|
| 2 |
// Encodage : UTF-8
|
2 |
// declare(encoding='UTF-8');
|
| 3 |
// +-------------------------------------------------------------------------------------------------------------------+
|
- |
|
| 4 |
/**
|
3 |
/**
|
| 5 |
* Découpage
|
- |
|
| 6 |
*
|
- |
|
| 7 |
* Description : classe abstraite mettant en comun des expressions régulière pour le découpage des noms latins.
|
4 |
* Classe abstraite mettant en comun des expressions régulière pour le découpage des noms latins.
|
| 8 |
*
|
5 |
*
|
| - |
|
6 |
* @internal Mininum PHP version : 5.2
|
| - |
|
7 |
* @category CEL
|
| - |
|
8 |
* @package Services
|
| - |
|
9 |
* @subpackage Bibliothèques
|
| 9 |
//Auteur original :
|
10 |
* @version 0.1
|
| - |
|
11 |
* @author Mathias CHOUET <mathias@tela-botanica.org>
|
| 10 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
12 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
| 11 |
* @copyright Tela-Botanica 1999-2009
|
13 |
* @author Aurelien PERONNET <aurelien@tela-botanica.org>
|
| 12 |
* @licence GPL v3 & CeCILL v2
|
14 |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
|
| 13 |
* @version $Id: Decoupage.class.php 1873 2009-03-31 10:07:24Z Jean-Pascal MILCENT $
|
15 |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
|
| - |
|
16 |
* @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org>
|
| 14 |
*/
|
17 |
*/
|
| 15 |
// +-------------------------------------------------------------------------------------------------------------------+
|
- |
|
| 16 |
abstract class Decoupage {
|
18 |
abstract class Decoupage {
|
| 17 |
|
19 |
|
| 18 |
protected $min = '[a-z\x{E0}-\x{FF}\x{153}]';// Lettres minuscules : a à z et à à ÿ et œ
|
20 |
protected $min = '[a-z\x{E0}-\x{FF}\x{153}]';// Lettres minuscules : a à z et à à ÿ et œ
|
| 19 |
protected $maj = "[A-Z'\x{C0}-\x{DF}\x{152}]";// Lettres majuscules : A à Z, ' et À à ß et Œ
|
21 |
protected $maj = "[A-Z'\x{C0}-\x{DF}\x{152}]";// Lettres majuscules : A à Z, ' et À à ß et Œ
|
| 20 |
protected $hyb = '[+xX]';
|
22 |
protected $hyb = '[+xX]';
|
| 21 |
|
23 |
|
| 22 |
protected $SupraSp;// Nom de type suprasp.
|
24 |
protected $SupraSp;// Nom de type suprasp.
|
| 23 |
protected $GenHy;// Hybride intergénérique
|
25 |
protected $GenHy;// Hybride intergénérique
|
| 24 |
protected $Gen;// Genre
|
26 |
protected $Gen;// Genre
|
| 25 |
protected $Dou = '(?:\(\?\)|\?)';// Doute
|
27 |
protected $Dou = '(?:\(\?\)|\?)';// Doute
|
| 26 |
protected $Epi_cv;// Epithete de cultivar
|
28 |
protected $Epi_cv;// Epithete de cultivar
|
| Line 80... |
Line 82... |
| 80 |
protected $AneDo = '\?';// Doute
|
82 |
protected $AneDo = '\?';// Doute
|
| 81 |
protected $AneBa;// Date
|
83 |
protected $AneBa;// Date
|
| 82 |
protected $AneSpe;// Date
|
84 |
protected $AneSpe;// Date
|
| 83 |
protected $Ane;// Date
|
85 |
protected $Ane;// Date
|
| 84 |
//------------------------------------------------------------------------------------------------------------//
|
86 |
//------------------------------------------------------------------------------------------------------------//
|
| 85 |
// Spécial BDNFF :
|
87 |
// Spécial BDNFF :
|
| 86 |
protected $Date = ' \[.*\]';
|
88 |
protected $Date = ' \[.*\]';
|
| 87 |
protected $Num = '[0-9]|3\*|4\*';# Gestion des numéros de flore
|
89 |
protected $Num = '[0-9]|3\*|4\*';# Gestion des numéros de flore
|
| 88 |
protected $NumAuteur;# Gestion des numéros de flore mélangés ou pas au nom d'auteur
|
90 |
protected $NumAuteur;# Gestion des numéros de flore mélangés ou pas au nom d'auteur
|
| 89 |
|
91 |
|
| 90 |
//------------------------------------------------------------------------------------------------------------//
|
92 |
//------------------------------------------------------------------------------------------------------------//
|
| 91 |
protected $BibBa;// Biblio de base : \x{B0} = ° \x{AB}\x{BB} = «» \x{26} = &
|
93 |
protected $BibBa;// Biblio de base : \x{B0} = ° \x{AB}\x{BB} = «» \x{26} = &
|
| 92 |
protected $Bib;// Biblio de taxon
|
94 |
protected $Bib;// Biblio de taxon
|
| 93 |
protected $BibAu = '.+';// Biblio supplémentaire
|
95 |
protected $BibAu = '.+';// Biblio supplémentaire
|
| 94 |
//------------------------------------------------------------------------------------------------------------//
|
96 |
//------------------------------------------------------------------------------------------------------------//
|
| Line 98... |
Line 100... |
| 98 |
protected $HomBa;// Homonymes à exclure base
|
100 |
protected $HomBa;// Homonymes à exclure base
|
| 99 |
protected $Hom;// Homonymes à exclure avec non et nec
|
101 |
protected $Hom;// Homonymes à exclure avec non et nec
|
| 100 |
protected $HomCourt;// Homonymes à exclure avec non et nec avec expression régulière plus courte!
|
102 |
protected $HomCourt;// Homonymes à exclure avec non et nec avec expression régulière plus courte!
|
| 101 |
//------------------------------------------------------------------------------------------------------------//
|
103 |
//------------------------------------------------------------------------------------------------------------//
|
| 102 |
protected $Inf = '.*';// Informations supplémentaires
|
104 |
protected $Inf = '.*';// Informations supplémentaires
|
| 103 |
|
105 |
|
| 104 |
public function __construct()
|
106 |
public function __construct() {
|
| 105 |
{
|
- |
|
| 106 |
//mb_internal_encoding('UTF-8');
|
107 |
//mb_internal_encoding('UTF-8');
|
| 107 |
//mb_regex_encoding('UTF-8');
|
108 |
//mb_regex_encoding('UTF-8');
|
| 108 |
//setlocale(LC_ALL, 'fr-fr');
|
109 |
//setlocale(LC_ALL, 'fr-fr');
|
| 109 |
|
110 |
|
| 110 |
$this->SupraSp = '(?:'.$this->maj.$this->min.'+|'.$this->maj.$this->min.'+-'.$this->maj.$this->min.'+)';// Nom de type suprasp.
|
111 |
$this->SupraSp = '(?:'.$this->maj.$this->min.'+|'.$this->maj.$this->min.'+-'.$this->maj.$this->min.'+)';// Nom de type suprasp.
|
| 111 |
$this->GenHy = "[Xx] $this->SupraSp";// Hybride intergénérique
|
112 |
$this->GenHy = "[Xx] $this->SupraSp";// Hybride intergénérique
|
| 112 |
$this->Gen = "$this->SupraSp|$this->GenHy";
|
113 |
$this->Gen = "$this->SupraSp|$this->GenHy";
|
| 113 |
$this->Epi_cv = "$this->maj.(?:$this->min|-)+";// Epithete de cultivar
|
114 |
$this->Epi_cv = "$this->maj.(?:$this->min|-)+";// Epithete de cultivar
|
| 114 |
$this->Epi_nn = $this->Epi_nn.$this->Epi_nn_hy;
|
115 |
$this->Epi_nn = $this->Epi_nn.$this->Epi_nn_hy;
|
| 115 |
$this->Epi = "(?:(?:$this->min|-|')+|$this->Epi_nn)";// Epithete
|
116 |
$this->Epi = "(?:(?:$this->min|-|')+|$this->Epi_nn)";// Epithete
|
| 116 |
|
117 |
|
| 117 |
$this->Ran_ig = $this->Ran_ig.'|'.$this->Ran_ig_gr;
|
118 |
$this->Ran_ig = $this->Ran_ig.'|'.$this->Ran_ig_gr;
|
| 118 |
$this->Ran_bo = "$this->Ran_bo_i1|$this->Ran_bo_i2|$this->Ran_bo_i3|$this->Ran_bo_i4";// Rang taxonomique infraspécifique botanique non hybride
|
119 |
$this->Ran_bo = "$this->Ran_bo_i1|$this->Ran_bo_i2|$this->Ran_bo_i3|$this->Ran_bo_i4";// Rang taxonomique infraspécifique botanique non hybride
|
| 119 |
$this->Ran_hy = "$this->Ran_hy_i1|$this->Ran_hy_i2|$this->Ran_hy_i3|$this->Ran_hy_i4";// Rang taxonomique infraspécifique hybridre
|
120 |
$this->Ran_hy = "$this->Ran_hy_i1|$this->Ran_hy_i2|$this->Ran_hy_i3|$this->Ran_hy_i4";// Rang taxonomique infraspécifique hybridre
|
| 120 |
$this->Ran = "(?:$this->Ran_ig|$this->Ran_bo|$this->Ran_hy|$this->Ran_ht)";// Rang taxonomique infraspécifique non hybride, hybride et horticole
|
121 |
$this->Ran = "(?:$this->Ran_ig|$this->Ran_bo|$this->Ran_hy|$this->Ran_ht)";// Rang taxonomique infraspécifique non hybride, hybride et horticole
|
| 121 |
|
122 |
|
| 122 |
$this->Ini = '(?:'.$this->maj.'[.]|'.$this->maj.$this->min.'+[.]?)';// Initiale de prénoms
|
123 |
$this->Ini = '(?:'.$this->maj.'[.]|'.$this->maj.$this->min.'+[.]?)';// Initiale de prénoms
|
| 123 |
$this->Pre = $this->Ini.'{1,3}|'.$this->Ini.'[\- ]'.$this->Ini;// Prénoms
|
124 |
$this->Pre = $this->Ini.'{1,3}|'.$this->Ini.'[\- ]'.$this->Ini;// Prénoms
|
| 124 |
$this->Nom = '(?:'.$this->maj."'".$this->maj.'|'.$this->maj.'|'.$this->maj.$this->min."+'".$this->min.'+)'.$this->min.'*[.]?(?: ?f\.|)';
|
125 |
$this->Nom = '(?:'.$this->maj."'".$this->maj.'|'.$this->maj.'|'.$this->maj.$this->min."+'".$this->min.'+)'.$this->min.'*[.]?(?: ?f\.|)';
|
| 125 |
$this->Int = "(?:(?:$this->Pre ?|)(?:$this->Par |$this->ParSsEs|)(?:$this->Nom|$this->Nom".'[\- .]'."$this->Nom)|$this->NomSpe)";// Intitulé d'auteurs (Prénom + Nom)
|
126 |
$this->Int = "(?:(?:$this->Pre ?|)(?:$this->Par |$this->ParSsEs|)(?:$this->Nom|$this->Nom".'[\- .]'."$this->Nom)|$this->NomSpe)";// Intitulé d'auteurs (Prénom + Nom)
|
| 126 |
|
127 |
|
| 127 |
$this->AutNo = "$this->Int";// Intitulé auteur sans "ex", ni "&", ni "et", ni parenthèses
|
128 |
$this->AutNo = "$this->Int";// Intitulé auteur sans "ex", ni "&", ni "et", ni parenthèses
|
| 128 |
$this->AutNoTa = "$this->AutNo|$this->NomSpe $this->Int|\($this->Int\) $this->Int";// Intitulé auteur sans "ex", ni "&", ni "et" mais avec parenthèses possible pour la nomenclature
|
129 |
$this->AutNoTa = "$this->AutNo|$this->NomSpe $this->Int|\($this->Int\) $this->Int";// Intitulé auteur sans "ex", ni "&", ni "et" mais avec parenthèses possible pour la nomenclature
|
| 129 |
$this->AutEx = "\($this->Int\) $this->Int ex $this->Int|\($this->Int ex $this->Int\) $this->Int|$this->Int ex $this->Int";// Intitulé auteur avec "ex"
|
130 |
$this->AutEx = "\($this->Int\) $this->Int ex $this->Int|\($this->Int ex $this->Int\) $this->Int|$this->Int ex $this->Int";// Intitulé auteur avec "ex"
|
| 130 |
$this->AutExEt = "$this->Int $this->et $this->Int ex $this->Int|$this->Int $this->et $this->Int ex $this->Int $this->et $this->Int|$this->Int ex $this->Int $this->et $this->Int|\($this->Int ex $this->Int $this->et $this->Int\) $this->Int|\($this->Int ex $this->Int\) $this->Int $this->et $this->Int|\($this->Int $this->et $this->Int\) $this->Int ex $this->Int|$this->NomSpe $this->Int ex $this->Int";// Intitulé auteur avec "ex" et "&" ou "et"
|
131 |
$this->AutExEt = "$this->Int $this->et $this->Int ex $this->Int|$this->Int $this->et $this->Int ex $this->Int $this->et $this->Int|$this->Int ex $this->Int $this->et $this->Int|\($this->Int ex $this->Int $this->et $this->Int\) $this->Int|\($this->Int ex $this->Int\) $this->Int $this->et $this->Int|\($this->Int $this->et $this->Int\) $this->Int ex $this->Int|$this->NomSpe $this->Int ex $this->Int";// Intitulé auteur avec "ex" et "&" ou "et"
|
| 131 |
$this->AutEt = "$this->Int $this->et $this->Int";// Intitulé auteur avec "&" ou "et" et sans parenthèse spécifique à la nomenclature
|
132 |
$this->AutEt = "$this->Int $this->et $this->Int";// Intitulé auteur avec "&" ou "et" et sans parenthèse spécifique à la nomenclature
|
| Line 134... |
Line 135... |
| 134 |
$this->AutSpe = "(?:sensu |)auct\.|auct\. mult\.|$this->AutInc";// Intitulé auteur spéciaux pouvant être trouvés entre parenthèses
|
135 |
$this->AutSpe = "(?:sensu |)auct\.|auct\. mult\.|$this->AutInc";// Intitulé auteur spéciaux pouvant être trouvés entre parenthèses
|
| 135 |
$this->AutSpeSe = "sensu $this->AutBib";// Intitulé auteur spéciaux type "sensu"
|
136 |
$this->AutSpeSe = "sensu $this->AutBib";// Intitulé auteur spéciaux type "sensu"
|
| 136 |
$this->AutSpeTa = "$this->AutSpe|\((?:$this->AutSpe)\)|$this->AutSpeSe";// Intitulé auteur spéciaux propre à la nomenclature
|
137 |
$this->AutSpeTa = "$this->AutSpe|\((?:$this->AutSpe)\)|$this->AutSpeSe";// Intitulé auteur spéciaux propre à la nomenclature
|
| 137 |
$this->Aut = "(?:$this->AutExEt|$this->AutEx|$this->AutEtTa|$this->AutSpeTa|$this->AutNoTa)";// Tous les intitulés auteurs possibles
|
138 |
$this->Aut = "(?:$this->AutExEt|$this->AutEx|$this->AutEtTa|$this->AutSpeTa|$this->AutNoTa)";// Tous les intitulés auteurs possibles
|
| 138 |
$this->Auteur = $this->Int.'|'.$this->Int.' '.$this->et.' '.$this->Int.'|(?:'.$this->Int.', )+'.$this->Int.' '.$this->et.' '.$this->Int;// Intitulé auteur avec "&" ou "et";
|
139 |
$this->Auteur = $this->Int.'|'.$this->Int.' '.$this->et.' '.$this->Int.'|(?:'.$this->Int.', )+'.$this->Int.' '.$this->et.' '.$this->Int;// Intitulé auteur avec "&" ou "et";
|
| 139 |
|
140 |
|
| 140 |
$this->ComEmend = "emend\. $this->AutBib";// Commentaires nomenclaturaux
|
141 |
$this->ComEmend = "emend\. $this->AutBib";// Commentaires nomenclaturaux
|
| 141 |
$this->Com = "$this->ComEmend|$this->ComPp";// Intitulé auteur spéciaux type "sensu"
|
142 |
$this->Com = "$this->ComEmend|$this->ComPp";// Intitulé auteur spéciaux type "sensu"
|
| 142 |
|
143 |
|
| 143 |
$this->In = "[iI]n $this->AutBib";// In auteur
|
144 |
$this->In = "[iI]n $this->AutBib";// In auteur
|
| 144 |
$this->AneBa = "$this->AneBaSi|$this->AneBaCo";// Date
|
145 |
$this->AneBa = "$this->AneBaSi|$this->AneBaCo";// Date
|
| 145 |
$this->AneSpe = "(?:$this->AneBa ?\[$this->AneBa\]|(?:$this->AneMoCo|$this->AneMoAb) $this->AneBaSi|$this->AneBaSi $this->AneBaSi)";// Date
|
146 |
$this->AneSpe = "(?:$this->AneBa ?\[$this->AneBa\]|(?:$this->AneMoCo|$this->AneMoAb) $this->AneBaSi|$this->AneBaSi $this->AneBaSi)";// Date
|
| 146 |
$this->Ane = "$this->AneBa||$this->AneDo|$this->AneSpe";// Date
|
147 |
$this->Ane = "$this->AneBa||$this->AneDo|$this->AneSpe";// Date
|
| 147 |
|
148 |
|
| 148 |
$this->BibBa = "(?:$this->maj$this->min*[.]?|in|hort\.)(?:$this->min*[.]?|[\d\/\- ,()'\x{B0}\x{26}\x{AB}\x{BB}[\]?])*";// Biblio de base : \x{B0} = ° \x{AB}\x{BB} = «» \x{26} = &
|
149 |
$this->BibBa = "(?:$this->maj$this->min*[.]?|in|hort\.)(?:$this->min*[.]?|[\d\/\- ,()'\x{B0}\x{26}\x{AB}\x{BB}[\]?])*";// Biblio de base : \x{B0} = ° \x{AB}\x{BB} = «» \x{26} = &
|
| 149 |
$this->Bib = "([^:]+):(.+?)\(($this->Ane)\)";// Biblio de taxon
|
150 |
$this->Bib = "([^:]+):(.+?)\(($this->Ane)\)";// Biblio de taxon
|
| 150 |
|
151 |
|
| 151 |
$this->ErrDet = "($this->AutSpe,? non $this->Aut): ($this->Bib;?)+";// Biblio à exclure base
|
152 |
$this->ErrDet = "($this->AutSpe,? non $this->Aut): ($this->Bib;?)+";// Biblio à exclure base
|
| 152 |
|
153 |
|
| 153 |
$this->HomBa = "$this->Aut \($this->Ane\)";// Homonymes à exclure base
|
154 |
$this->HomBa = "$this->Aut \($this->Ane\)";// Homonymes à exclure base
|
| 154 |
$this->Hom = "$this->HomNon $this->HomBa(?: nec $this->HomBa)*?";// Homonymes à exclure avec non et nec
|
155 |
$this->Hom = "$this->HomNon $this->HomBa(?: nec $this->HomBa)*?";// Homonymes à exclure avec non et nec
|
| 155 |
$this->HomCourt = "$this->HomNon .+?(?: nec .+?)*?";// Homonymes à exclure avec non et nec avec expression régulière plus courte!
|
156 |
$this->HomCourt = "$this->HomNon .+?(?: nec .+?)*?";// Homonymes à exclure avec non et nec avec expression régulière plus courte!
|
| 156 |
|
157 |
|
| 157 |
$this->NumAuteur = $this->Num.'|(?:(?:'.$this->Num.'|'.$this->Auteur.'), )+(?:'.$this->Num.'|'.$this->Auteur.')';# Gestion des numéros de flore mélangés ou pas au nom d'auteur
|
158 |
$this->NumAuteur = $this->Num.'|(?:(?:'.$this->Num.'|'.$this->Auteur.'), )+(?:'.$this->Num.'|'.$this->Auteur.')';# Gestion des numéros de flore mélangés ou pas au nom d'auteur
|
| 158 |
}
|
159 |
}
|
| 159 |
}
|
- |
|
| 160 |
?>
|
- |
|
| 161 |
|
160 |
}
|
| - |
|
161 |
|
| 162 |
|
162 |
|