#!/usr/bin/perl
use Data::Dumper;

#dans projet_encadreS2/mesprogrammes

my $path="../Corpus_2014/Sorties2014/BAO1";
print "chemin : ".$path."\n";
opendir(DIR, $path) or die "Can't open $path: $!\n";
my @files = readdir(DIR);
#print Dumper @files;
#print "\n";
foreach $file(@files)
{
	if ($file=~ /txt$/)
	{
	@nomfile=split /\./,$file;
	# print "fichier : ".$file."\n";
	$nomfic=$nomfile[0];	
	# print "debut :".$nomfic."\n";
	# my $attente=<STDIN>;
system("../TreeTagger/cmd/tokenize.pl -f ..//Corpus_2014/Sorties2014/BAO1/$file >../Corpus_2014/Sorties2014/BAO2/$nomfic.\"-tok.txt\"");
system ("../TreeTagger/bin/tree-tagger ../TreeTagger/lib/french-utf8.par -lemma -token -no-unknown -sgml ../Corpus_2014/Sorties2014/BAO2/$nomfic.\"-tok.txt\" > ../Corpus_2014/Sorties2014/BAO2/$nomfic.\"_tagge.txt\"");
system ("perl treetagger2xml.pl ../Corpus_2014/Sorties2014/BAO2/$nomfic.\"_tagge.txt\""); 
	}
}

