open(FILE,"$ARGV[0]");
#--------------------------------------------
# le patron cherchŽ ici est du type NOM PRP NOM";
#--------------------------------------------
my @lignes=<FILE>;
close(FILE);
while (my $ligne=shift(@lignes)) {
    chomp $ligne;
    
    my $sequence="";
    my $longueur=0;
    
    if ( $ligne =~ /<element><data type=\"type\">NOM<\/data><data type=\"lemma\">[^<]+<\/data><data type=\"string\">([^<]+)<\/data><\/element>/) {
		my $forme1=$1;
        
		$sequence=$forme1;
        
		$longueur=1;
        
        
		my $nextligne=$lignes[0];
        
		if ( $nextligne =~ /<element><data type=\"type\">PRP[^<]*<\/data><data type=\"lemma\">[^<]+<\/data><data type=\"string\">([^<]+)<\/data><\/element>/) {
            
			my $forme2=$1;
			$sequence=$sequence." ".$forme2;
            
			$longueur=2;
            
            shift(@lignes);
            my $nextligne2=shift(@lignes);
            chomp $nextligne2;
            
            
                if ($nextligne2 =~ /<element><data type=\"type\">NOM<\/data><data type=\"lemma\">[^<]+<\/data><data type=\"string\">([^<]+)<\/data><\/element>/) {
                    my $forme3=$1;
                    $sequence=$sequence." ".$forme3;
                    #print "sequence 3 ",$sequence;
                    $longueur=3;
                    
                    
                }
            
        
        if ($longueur == 3) {
            print $sequence,"\n";
        }
        }
    }
}
