#!/usr/bin/perl -w use strict; use warnings; if (@ARGV < 1) { die " \n"; } my $RemoveTags=0; open STM, $ARGV[0]; if (@ARGV > 1 && $ARGV[1] == "1") { $RemoveTags=1; } foreach () { if (!($_=~/ignore_time_segment_in_scoring/)) { if ($_=~/(.*?) .*? .*? (.*?) (.*?) \<.*?\> (.*?)( \(.*?\))*$/) { my $utterance_id=$1; my $start=$2*100; my $end=$3*100; my $sentence=$4; if ($RemoveTags) { $sentence=~s/\{.*?\}//g; $sentence=~s/\<.*?\>//g; } $sentence=~s/ +/ /g; $sentence=~s/^ //; printf "%s_%s-%s %s\n", $utterance_id, $start, $end, $sentence; } } }