Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions egs/wsj/s5/utils/scoring/wer_per_spk_details.pl
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,15 @@ sub format_sys {
}

open(UTT2SPK,$ARGV[0]) or die "Could not open the utt2spk file $ARGV[0]";
while(<UTT2SPK>) {
chomp;
my @F=split;
die "Incompatible format of the utt2spk file: $_" if @F != 2;

(my $utt_is_utf8, my @utt_lines) = get_utf8_or_bytestream(\*UTT2SPK);
die "Cannot read file" unless @utt_lines;

while (@utt_lines) {
my $line = shift @utt_lines;
chomp $line;
my @F=split(" ", $line);
die "Incompatible format of the utt2spk file: $_" if @F != 2;
$UTTMAP{$F[0]} = $F[1];
# Set width of speaker column by its longest label,
if($SPK_WIDTH < length($F[1])) { $SPK_WIDTH = length($F[1]) }
Expand Down