

my $entree = shift;
 my $sortie = shift;
   
   #my @patrons = ('NOM','ADJ');
    # my @patrons = ('NOM','NOM');
      my @patrons = ('NOM','PRP','NOM');
     



   my $nbP = scalar(@patrons);
   
   open(SORTIE, ">$sortie") || die "$sortie $!\n";
   open(ENTREE, "<$entree") || die "$entree $!\n";
   my $i = 0;
   my @element = ();
   
   while(my $l=<ENTREE>){
       
       if($l =~ /^\<element\>\<data type="string"\>(.*)\<\/data\>\<data type="type"\>$patrons[$i]\<\/data\>/){
       
           $element[$i] = $1;
           if ($i == ($nbP - 1)){
               if (!($element[$i] =~ /^.$/) && ($element[$i] ne "qu")){
	           
                   print SORTIE join(' ', @element), "\n";
                   $i = 0;
               }   
               
           }else{
               $i++;
           }
       }else{
           $i=0;
       }
   }
   


   close(SORTIE);
   close(ENTREE);