#!/usr/local/bin/perl

die if @ARGV != 1;

my($srcfile);

$srcfile = $ARGV[0];

open(TGT, $srcfile) or die $!;
$line = <TGT>; $line =~ s/[\r\n]*$//;
if ($line =~ m/^SrcSent/) {  # Handle n-best
    while ($line = <TGT>) {
	$line =~ s/[\r\n]*$//;
	if ($line =~ m/^\d+\s0\t(.*)$/) {
	    #push @segs, $1;
	    print "$1\n";
	}
    }
    
} else {
    push @segs, $line;
    while ($line = <TGT>) {
	$line =~ s/[\r\n]*$//;
	#push @segs, $line;
	print "$line\n";
    }
}
close(TGT);

#print STDERR "Segindex $segindex\n";
