preprocess_trs.pl 528 Bytes
#!/usr/bin/perl
use strict;

while(<>){
	chomp;
	$_ =~ s/\*Schiav\(one\)//g;
	$_ =~ s/&lt;\/pers&gt;/\n<Event desc="pers" type="entities" extent="end"\/>\n/g;
	$_ =~ s/&lt;pers=/<pers=/g;
	$_ =~ s/=\S*&gt;/ /g;
	$_ =~ s/&amp;//g;
	$_ =~ s/<pers /\n\n<Event desc="pers" type="entities" extent="begin"\/>\n<Event desc="pers.mention.NP" type="entities" extent="instantaneous"\/>\n/g;
	$_ =~ s/<Event desc="en" type="language" extent="begin"\/>/\n/g;
	$_ =~ s/<Event desc="en" type="language" extent="end"\/>/\n/g;
	print "$_\n";
}