Changeset 1351


Ignore:
Timestamp:
Sep 11, 2010, 5:59:26 PM (10 years ago)
Author:
roux
Message:

ajout parsing tags pour pjl/rapports

Location:
cpc/trunk/project
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/batch/documents/parse_metas.pl

    r1333 r1351  
    3434$string =~ s/ +/ /g;
    3535$string =~ s/\s+/ /g;
     36$string =~ s/"//g;
    3637if ($dir == "rap") {
    3738  $string =~ s/L\W\W([AÀEÈÉÊIOUYH])/L'\1/g;
     
    115116  $keywords .= $line.".";
    116117}
    117 if ($string =~ /<meta name="MOTS_CLES"([^>]+)>/ && !$categorie) {
     118if ($string =~ /<meta name="MOTS_CLES"([^>]+)>/) {
    118119  $line = $1;
    119120  $line =~ s/^.*content="([^"]+)".*$/\1/;
     
    122123
    123124$keywords = lc $keywords;
     125$keywords =~ s/^\s+//;
     126$keywords =~ s/\s+$//;
     127$keywords =~ s/À/à/g;
     128$keywords =~ s/É/é/g;
     129$keywords =~ s/È/è/g;
     130$keywords =~ s/Ê/ê/g;
     131$keywords =~ s/Î/î/g;
     132$keywords =~ s/Ï/ï/g;
     133$keywords =~ s/Ô/ô/g;
     134$keywords =~ s/Ù/ù/g;
     135$keywords =~ s/Ç/ç/g;
    124136$keywords =~ s/ +\././g;
    125137$keywords =~ s/\. +/./g;
    126 $keywords =~ s/.+/./g;
    127 $keywords =~ s/^.+$//g;
     138$keywords =~ s/\.+/./g;
     139$keywords =~ s/^\.+//g;
     140$keywords =~ s/\.+$//g;
     141$keywords =~ s/([\s\(,\.])l\./\1L/gi;
     142
    128143if ($categorie =~ /Texte de la commission/i && $id =~ /-a0/) {
    129144  $categorie = "";
     
    131146}
    132147$categorie = lc $categorie;
     148$categorie =~ s/^\s+//;
     149$categorie =~ s/\s+$//;
    133150$categorie =~ s/À/à/g;
    134151$categorie =~ s/É/é/g;
     
    139156$categorie =~ s/Ô/ô/g;
    140157$categorie =~ s/Ù/ù/g;
     158$categorie =~ s/Ç/ç/g;
    141159
    142160
  • cpc/trunk/project/config/doctrine/schema.yml

    r1347 r1351  
    567567Texteloi:
    568568  actAs:
    569     Timestampable:
     569    Timestampable: ~
     570    Taggable: ~
    570571  columns:
    571572    id:
  • cpc/trunk/project/lib/model/doctrine/Texteloi.class.php

    r1333 r1351  
    9898        if ($debug) echo $nom."//".$sexe."//".$orga."//".$circo."//".$fonction." => ";
    9999        $depute = Doctrine::getTable('Parlementaire')->findOneByNomSexeGroupeCirco($nom, $sexe, null, $circo, $this);
    100         if (!$depute) print "ERROR: Auteur introuvable in ".$this->source."/".$this->id." : ".$nom." // ".$sexe." // ".$orga."//".$fonction."\n";
     100        if (!$depute) print "WARNING: Auteur introuvable in ".$this->source."/".$this->id." : ".$nom." // ".$sexe." // ".$orga."//".$fonction."\n";
    101101        else {
    102102          if ($debug) echo $depute->nom."\n";
  • cpc/trunk/project/lib/task/loadDocumentsTask.class.php

    r1333 r1351  
    4949            if ($json->auteurs)
    5050              $doc->setAuteurs($json->auteurs);
    51            //mots-clés as tags?
     51            if ($json->motscles)
     52              foreach (explode('.', $json->motscles) as $tag)
     53                $doc->addTag($tag);
    5254            $doc->save();
    5355            $doc->free();
Note: See TracChangeset for help on using the changeset viewer.