Blame view
LIA_kaldiUtils/stm_2_kaldi_txt.pl
511 Bytes
ec85f8892 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 |
#!/usr/bin/perl use warnings; use strict; while(<STDIN>){ chomp; my @t=split(/ /); if ($_ !~ /^;/ && @t > 6 && $t[6] ne "ignore_time_segment_in_scoring"){ my $label = $t[0]; my $loc = $t[2]; #$label =~ s/_/-/g; #$loc =~ s/_/-/g; my $time = int(0.5+$t[3]*100); my $end = int(0.5+$t[4]*100); #print $_; if( @t > 7){ print $label."#".$loc."#".sprintf("%06d",$time)."#".sprintf("%06d",$end)." "; for(my $w=6;$w<@t;$w++){ print $t[$w]." "; } print " "; } } } |