Blame view
egs/reverb/s5/local/mlf2text.pl
429 Bytes
8dcb6dfcb first commit |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#!/usr/bin/env perl use strict; my $utt; my %text; while (<>) { next if (/^#!/); s/\x0D$//; chomp; if (/"\*\/\*?(\w+)\*?\.lab"/) { #if (/"(.+)"/) { $utt = lc $1; #print "utterance: $utt "; } elsif (!/^\.$/) { if ($text{$utt}) { $text{$utt} .= " "; } $text{$utt} .= $_; } } for my $utt (sort keys %text) { print "$utt $text{$utt} "; } |