#!/usr/bin/perl -w
####################################################################
###
### script name : prompts2trainscp.pl
### version: 0.1
### created by: Ken MacLean
### mail: contact@voxforge.org
### Date: 2006.09.26
### Command: perl ./prompts2trainscp.pl PromptFile Train.scp
###    
### Copyright (C) 2006 Ken MacLean
###
### This program is free software; you can redistribute it and/or
### modify it under the terms of the GNU General Public License
### as published by the Free Software Foundation; either version 3
### of the License, or (at your option) any later version.
###
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.
###                                                             
####################################################################
use strict;
my ($promptfile, $trainscp, $line, $filename, @labels);
if (@ARGV != 2) {
  print "error - usage: $0 promptfile train\.scp\n\n"; 
  exit (0);
}
# read in command line arguments
($promptfile, $trainscp) = @ARGV;

open (PROMPT, "$promptfile") || die ("Unable to open $promptfile file for reading");
open (SCP,">$trainscp") || die ("Unable to open $trainscp file for writing");

while ($line = <PROMPT>) {
  chomp ($line);
  ($filename,@labels) = split(/\s+/,$line);
  print SCP ("$filename\.mfc\n");
}

close (PROMPT);
close(SCP);

