Skip to content
Snippets Groups Projects
Commit 2c1690b0 authored by jgaimard's avatar jgaimard
Browse files

auteurs courts

parent 539ba965
Branches
Tags
No related merge requests found
......@@ -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)
......
......@@ -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));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment