#!/usr/bin/perl

system("perl tokenise-utf8.pl $ARGV[0]|tree-tagger -token -lemma -no-unknown french-utf8.par > $ARGV[0]_tmp.txt");

open(TREE, "<:encoding(utf-8)", "$ARGV[0]_tmp.txt");
my @corpus = <TREE>;
close TREE;
foreach my $lignetree (@corpus)
			{
				$lignetree =~ s/(.*[^\t])\t(.*[^\t])\t(.*[^\s])/$1\t$3\t$2/;
			}

open(OUT, ">:encoding(utf-8)", "$ARGV[0]_tag.txt");
print OUT @corpus; 
