Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 135 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 135 Rev 137
Line 75... Line 75...
75
		return $noms;
75
		return $noms;
76
	}
76
	}
Line 77... Line 77...
77
 
77
 
78
	private function surlignerMotsMasqueRecherche($nom) {
78
	private function surlignerMotsMasqueRecherche($nom) {
-
 
79
		$mots = explode(' ', $this->masqueRecherche);
79
		$mots = explode(' ', $this->masqueRecherche);
80
		$surligneur = new Surligneur();
80
		foreach ($mots as $mot) {
81
		$surligneur->setTexte($nom);
81
			$nom = $this->surlignerMotDansTxt($mot, $nom);
-
 
82
		}
82
		$nom = $surligneur->surlignerMots($mots);
83
		return $nom;
83
		return $nom;
Line 84... Line 84...
84
	}
84
	}
85
 
85
 
Line 163... Line 163...
163
			$urls[$id] = $url;
163
			$urls[$id] = $url;
164
		}
164
		}
165
		return $urls;
165
		return $urls;
166
	}
166
	}
Line 167... Line -...
167
 
-
 
168
	private function surlignerNomsPourDetermination($noms) {
-
 
169
		foreach ($noms as $idNom => $nom) {
-
 
170
			$nom['nom_sci_retenu'] = $this->surlignerMotsMasqueRecherche($nom['nom_sci_retenu']);
-
 
171
			if (isset($nom['synonymes'])) {
-
 
172
				foreach ($nom['synonymes'] as $idSyn => $synonyme) {
-
 
173
					$nom['synonymes'][$idSyn]['nom_sci'] = $this->surlignerMotsMasqueRecherche($synonyme['nom_sci']);
-
 
174
				}
-
 
175
			}
-
 
176
			$noms[$idNom] = $nom;
-
 
177
		}
-
 
178
		return $noms;
-
 
179
	}
-
 
180
 
167
 
181
	private function extraireNomsPourDetermination($noms) {
168
	private function extraireNomsPourDetermination($noms) {
182
		$nomsSansCorrespondance = array();
169
		$nomsSansCorrespondance = array();
183
		$nomsAvecCorrespondance = array();
170
		$nomsAvecCorrespondance = array();
184
		foreach ($noms as $idNomCourant => $nom) {
171
		foreach ($noms as $idNomCourant => $nom) {
Line 227... Line 214...
227
		}
214
		}
228
		$noms = Tableau::trierMD($noms, array('score' => SORT_DESC));
215
		$noms = Tableau::trierMD($noms, array('score' => SORT_DESC));
229
		return $noms;
216
		return $noms;
230
	}
217
	}
Line -... Line 218...
-
 
218
 
-
 
219
	private function surlignerNomsPourDetermination($noms) {
-
 
220
		foreach ($noms as $idNom => $nom) {
-
 
221
			$nom['nom_sci_retenu'] = $this->surlignerMotsMasqueRecherche($nom['nom_sci_retenu']);
-
 
222
			if (isset($nom['synonymes'])) {
-
 
223
				foreach ($nom['synonymes'] as $idSyn => $synonyme) {
-
 
224
					$nom['synonymes'][$idSyn]['nom_sci'] = $this->surlignerMotsMasqueRecherche($synonyme['nom_sci']);
-
 
225
				}
-
 
226
			}
-
 
227
			$noms[$idNom] = $nom;
-
 
228
		}
-
 
229
		return $noms;
-
 
230
	}
231
 
231
 
232
	private function genererListeDecompo($noms) {
232
	private function genererListeDecompo($noms) {
233
		return '<p>À réaliser</p>';
233
		return '<p>À réaliser</p>';
234
	}
234
	}
235
}
235
}
236
?>
236
?>