#!/usr/local/bin/perl
# Katharina Probst
# Jun 12, 2003

# This utility takes in hand-translated and -aligned data.
# It reformats the alignments to the format that the rule learning
# system expects.

# (some code from Erik)

foreach $arg (@ARGV) {
    push @etfiles, $arg;
}

if (scalar(@etfiles) == 0) {
    @etfiles = </afs/cs.cmu.edu/project/avenue-1/Avenue/Hebrew-MT/Data/Done/*.txt>;
}

foreach $etfile (@etfiles) {
  print "In RemoveBlanksFromETData, now processing file:$etfile\n";
  open(ET, $etfile) or next;
  open(OUT, ">".$etfile."nob") or die "Couldn't open outfile for $etfile.\n";
  while(<ET>){
      $_ =~ s/\r+//g;
    if ($_ !~ /^\s*$/){
      if ($_ =~ /newpair/){
	print OUT "\n" . $_;
      }
      else{
	print OUT $_;
      }
    }
  }
}
