diff --git a/library/Class/Indexation.php b/library/Class/Indexation.php index 245d1732de4e63c74b1a9ff553d623d2e7b681e0..442553563f8b8086daf0f6114363da1e6210a7e5 100644 --- a/library/Class/Indexation.php +++ b/library/Class/Indexation.php @@ -35,7 +35,7 @@ class Class_Indexation { // Lire formes rejetées $this->articles=array("L'","LE ","LA ","LES ","UN ","UNE "); - $this->inclu=array("AN","AS","OR","U2","AI","LU","XO"); + $this->inclu=array("AN","AS","OR","U2","AI","LU","XO","DO","RE","MI","FA","SI","AC","DC","H","K","M","Z","L","YU","UT","LI","OC","PI","ZU","WU","TO","OZ","ZZ"); $this->exclu = array("LES","DES","MES","TES","ENTRE","CHEZ","SES","LEUR","MON","ENTRE","POUR","ELLE","ILS","COMME","DANS","EUX","CEUX","MAIS","MEME","SANS", "TOME","VERS","VOUS","CECI","CES","ETC","PARCE","QUE","QUEL","QUELLE","QUELS","QUELLES","PAS","QUI","QUOI","VOS","AFIN","CECI","CELA","LUI","PAR","PUIS","SOI"); @@ -175,6 +175,7 @@ class Class_Indexation if( strLen($mot[$i]) < 3 And intVal($mot[$i])==false) { if( in_array( $mot[$i], $this->inclu) == false) continue; + if(strlen($mot[$i])==1) $mot[$i].=$mot[$i]; // mots d'1 lettre : on double la lettre } // Retirer mots vides if( in_array($mot[$i], $this->exclu ) == true ) continue; @@ -252,7 +253,15 @@ class Class_Indexation return true; } - // --------------------------------------------------- +// --------------------------------------------------- +// Rend true si mot inclu +// --------------------------------------------------- + public function isMotInclu($mot) + { + return in_array($mot, $this->inclu); + } + +// --------------------------------------------------- // Othographe approchante // --------------------------------------------------- function phonetix($sIn) diff --git a/library/Class/Notice.php b/library/Class/Notice.php index 9cdef96509fc62a8f4c79276a8f81c0c8a1c97d5..544691faebd46b010a82b1870b8b3ecfa9851a0a 100644 --- a/library/Class/Notice.php +++ b/library/Class/Notice.php @@ -786,6 +786,7 @@ class Class_Notice extends Storm_Model_Abstract { // ---------------------------------------------------------------- public function getAuteurs($auteurPrincipal=false, $getFonction=false) { + $indexation=new Class_Indexation(); $auteur = array(); $zones = array("700", "710", "720", "730", "701", "702", "711", "712", "721", "722"); foreach ($zones as $zone) @@ -807,7 +808,7 @@ class Class_Notice extends Storm_Model_Abstract { } $nm = $nom . "|" . $prenom; if ($getFonction == true) $nm.="|" . $fonction . "|" . $fonction_pergame; - if (strlen($nm) > 2 and striPos($nm, "ANONYME") === false) // On elimine les auteurs avec 1 seule lettre et les anonymes + if((strlen($nm) > 2 or $indexation->isMotInclu($nom))and striPos($nm,"ANONYME") === false) // On elimine les auteurs avec 1 seule lettre { $auteur[] = $nm; if ($auteurPrincipal == true) return array(trim($prenom . " " . $nom));