Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 344 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
344 jpm 1
<?php
2
// Encodage : UTF-8
3
// +-------------------------------------------------------------------------------------------------------------------+
4
/**
5
* Découpage
6
*
7
* Description : classe abstraite mettant en comun des expressions régulière pour le découpage des 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: Decoupage.class.php 1873 2009-03-31 10:07:24Z Jean-Pascal MILCENT $
14
*/
15
// +-------------------------------------------------------------------------------------------------------------------+
16
abstract class Decoupage {
17
 
18
	protected $min = '[a-z\x{E0}-\x{FF}\x{153}]';// Lettres minuscules : a à z et &#224; à &#255 et &#339;
19
	protected $maj = "[A-Z'\x{C0}-\x{DF}\x{152}]";// Lettres majuscules : A à Z, ' et &#192; à &#223; et &#338;
20
	protected $hyb = '[+xX]';
21
 
22
	protected $SupraSp;// Nom de type suprasp.
23
	protected $GenHy;// Hybride intergénérique
24
	protected $Gen;// Genre
25
	protected $Dou = '(?:\(\?\)|\?)';// Doute
26
	protected $Epi_cv;// Epithete de cultivar
27
	protected $Epi_nn_hy = '(?:nsp\.|)';// Epithète non nommé hybride
28
	protected $Epi_nn = '(?:sp\.[1-9]?|spp\.|)';// Epithète non nommé
29
	protected $Epi;// Epithete
30
	//------------------------------------------------------------------------------------------------------------//
31
	protected $Ran_ig = '[Ss]ect\.|subg(?:en|)\.|ser\.|subser\.';// Rang taxonomique infragénérique de type : sous-genre
32
	protected $Ran_ig_gr = 'gr\.';// Rang taxonomique infragénérique de type : groupe
33
	protected $Ran_ig_agg = 'agg\.';// Rang taxonomique infragénérique de type : aggrégat
34
	protected $Ran_bo_i1 = 'subsp\.';// Rang taxonomique infraspécifique de niveau 1
35
	protected $Ran_bo_i2 = 'var\.|subvar\.';// Rang taxonomique infraspécifique de niveau 2
36
	protected $Ran_bo_i3 = 'f\.|fa\.|fa|forma';// Rang taxonomique infraspécifique de niveau 3
37
	protected $Ran_bo_i4 = 'race|prole|proles|prol\.';// Rang taxonomique infraspécifique de niveau 4
38
	protected $Ran_bo;// Rang taxonomique infraspécifique botanique non hybride
39
	protected $Ran_hy_i1 = 'n-subsp\.|\[subsp\.\]|\[n-subsp\.\]';// Rang taxonomique infraspécifique hybride de niveau 1
40
	protected $Ran_hy_i2 = '\[var\.\]|n-var\.|\[n-var\.\]';// Rang taxonomique infraspécifique hybride de niveau 2
41
	protected $Ran_hy_i3 = '';// Rang taxonomique infraspécifique hybride de niveau 3
42
	protected $Ran_hy_i4 = 'n-proles\.';// Rang taxonomique infraspécifique hybride de niveau 4
43
	protected $Ran_hy;// Rang taxonomique infraspécifique hybridre
44
	protected $Ran_ht = 'convar\.|[cC]v\.';// Rang taxonomique horticole
45
	protected $Ran;// Rang taxonomique infraspécifique non hybride, hybride et horticole
46
	//------------------------------------------------------------------------------------------------------------//
47
	protected $Ini;// Initiale de prénoms
48
	protected $Pre;// Prénoms
49
	protected $Par = '(?i:de|des|le|la|de la|von|van|st\.|el)';// Particules
50
	protected $ParSsEs = "(?i:st\.-|d)";// Particules sans espace après
51
	protected $Nom; // Abreviation d'un nom d'auteur. Le "f." c'est pour "filius" et c'est collé au nom
52
	protected $NomSpe = '(?:[A-Z]\. (?:DC\.|St\.-Hil\.))|\(?hort\.\)?|al\.';// Prénom + nom spéciaux : "hort." est utilisé comme un nom d'auteur mais cela signifie "des jardins". "DC." est une exception deux majuscule suivi d'un point.
53
	protected $Int;// Intitulé d'auteurs (Prénom + Nom)
54
	//------------------------------------------------------------------------------------------------------------//
55
	protected $AutNo;// Intitulé auteur sans "ex", ni "&", ni "et", ni parenthèses
56
	protected $AutNoTa;// Intitulé auteur sans "ex", ni "&", ni "et" mais avec parenthèses possible pour la nomenclature
57
	protected $AutEx;// Intitulé auteur avec "ex"
58
	protected $et = '(?:&|et)';
59
	protected $AutExEt;// Intitulé auteur avec "ex" et "&" ou "et"
60
	protected $AutEt;// Intitulé auteur avec "&" ou "et" et sans parenthèse spécifique à la nomenclature
61
	protected $AutEtTa;// Intitulé auteur avec "&" ou "et" et avec ou sans parenthèse spécifique à la nomenclature
62
	protected $AutBib;// Intitulés auteurs pour la biblio
63
	protected $AutInc = 'AUTEUR\?';// Intitulé auteur spéciaux pouvant être trouvés entre parenthèses
64
	protected $AutSpe;// Intitulé auteur spéciaux pouvant être trouvés entre parenthèses
65
	protected $AutSpeSe;// Intitulé auteur spéciaux type "sensu"
66
	protected $AutSpeTa;// Intitulé auteur spéciaux propre à la nomenclature
67
	protected $Aut;// Tous les intitulés auteurs possibles
68
	protected $Auteur;// Tous les intitulés auteurs possibles
69
	//------------------------------------------------------------------------------------------------------------//
70
	protected $ComEmend;// Commentaires nomenclaturaux
71
	protected $ComPp = 'p\.p\.';// Commentaires nomenclaturaux
72
	protected $Com;// Intitulé auteur spéciaux type "sensu"
73
	protected $ComNom = '\(?(?:hort\. non .*|sensu .*|auct\..*|comb\.\s*(?:nov\.|ined\.)|comb?\.\s*nov\.\s*provis\.|stat\.\s*provis\.|nov\.\s*stat\.|stat\.\s*nov\.|p\.p\.|emend\.)\)?';
74
	//------------------------------------------------------------------------------------------------------------//
75
	protected $In;// In auteur
76
	protected $AneMoCo = 'janvier|fevrier|mars|avril|mai|juin|juillet|ao\x{FB}t|septembre|octobre|novembre|decembre'; //Mois devant l'année
77
	protected $AneMoAb = 'janv\.|f[e\x{E9}]v\.|sept\.|oct\.|d\x{E9}c\.'; //Mois devant l'année
78
	protected $AneBaSi = '(?:\d{4}|\d{4} ?\?|DATE \?)';// Date
79
	protected $AneBaCo = '(?:\d{4}-\d{4}|\d{4}-\d{2})';// Date
80
	protected $AneDo = '\?';// Doute
81
	protected $AneBa;// Date
82
	protected $AneSpe;// Date
83
	protected $Ane;// Date
84
	//------------------------------------------------------------------------------------------------------------//
85
    // Spécial BDNFF :
86
    protected $Date = ' \[.*\]';
87
	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
89
 
90
	//------------------------------------------------------------------------------------------------------------//
91
	protected $BibBa;// Biblio de base : \x{B0} = ° \x{AB}\x{BB} = «» \x{26} = &
92
	protected $Bib;// Biblio de taxon
93
	protected $BibAu = '.+';// Biblio supplémentaire
94
	//------------------------------------------------------------------------------------------------------------//
95
	protected $ErrDet;// Biblio à exclure base
96
	//------------------------------------------------------------------------------------------------------------//
97
	protected $HomNon = 'non';// Homonymes à exclure : négation
98
	protected $HomBa;// Homonymes à exclure base
99
	protected $Hom;// Homonymes à exclure avec non et nec
100
	protected $HomCourt;// Homonymes à exclure avec non et nec avec expression régulière plus courte!
101
	//------------------------------------------------------------------------------------------------------------//
102
	protected $Inf = '.*';// Informations supplémentaires
103
 
104
	public function __construct()
105
	{
106
		//mb_internal_encoding('UTF-8');
107
		//mb_regex_encoding('UTF-8');
108
		//setlocale(LC_ALL, 'fr-fr');
109
 
110
		$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->Gen = "$this->SupraSp|$this->GenHy";
113
		$this->Epi_cv = "$this->maj.(?:$this->min|-)+";// Epithete de cultivar
114
		$this->Epi_nn = $this->Epi_nn.$this->Epi_nn_hy;
115
		$this->Epi = "(?:(?:$this->min|-|')+|$this->Epi_nn)";// Epithete
116
 
117
		$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_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
 
122
		$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->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
 
127
		$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->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->AutEt = "$this->Int $this->et $this->Int";// Intitulé auteur avec "&" ou "et" et sans parenthèse spécifique à la nomenclature
132
		$this->AutEtTa = "\($this->Int\) $this->Int $this->et $this->Int|\($this->Int $this->et $this->Int\) $this->Int|$this->AutEt";// Intitulé auteur avec "&" ou "et" et avec ou sans parenthèse spécifique à la nomenclature
133
		$this->AutBib = "(?:$this->AutNo|$this->AutEt)";// Intitulés auteurs pour la biblio
134
		$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->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->Auteur = $this->Int.'|'.$this->Int.' '.$this->et.' '.$this->Int.'|(?:'.$this->Int.', )+'.$this->Int.' '.$this->et.' '.$this->Int;// Intitulé auteur avec "&" ou "et";
139
 
140
		$this->ComEmend = "emend\. $this->AutBib";// Commentaires nomenclaturaux
141
		$this->Com = "$this->ComEmend|$this->ComPp";// Intitulé auteur spéciaux type "sensu"
142
 
143
		$this->In = "[iI]n $this->AutBib";// In auteur
144
		$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->Ane = "$this->AneBa||$this->AneDo|$this->AneSpe";// Date
147
 
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->Bib = "([^:]+):(.+?)\(($this->Ane)\)";// Biblio de taxon
150
 
151
		$this->ErrDet = "($this->AutSpe,? non $this->Aut): ($this->Bib;?)+";// Biblio à exclure base
152
 
153
		$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->HomCourt = "$this->HomNon .+?(?: nec .+?)*?";// Homonymes à exclure avec non et nec avec expression régulière plus courte!
156
 
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
	}
159
}
160
?>