preprocess_trs.pl
528 Bytes
#!/usr/bin/perl
use strict;
while(<>){
chomp;
$_ =~ s/\*Schiav\(one\)//g;
$_ =~ s/<\/pers>/\n<Event desc="pers" type="entities" extent="end"\/>\n/g;
$_ =~ s/<pers=/<pers=/g;
$_ =~ s/=\S*>/ /g;
$_ =~ s/&//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";
}