Speech:Convert.pl

Summary
Title: convert.pl

Author: unknown

Location: mnt/main/scripts/user/convert.pl

Usage:

Description

 * This script will make symbolic links to all the required sph files that are noted in a transcript file located in a particular corpus directory.
 * It first sets corpus directory, then appends the path the trans file based on the corpus directory provided, and then opens the transcript file for processing

Code

 * 1) !/usr/bin/perl


 * 1) This script will make symbolic links to all the required sph files
 * 2) that are noted in a transcript file located in a particular corpus dir

if ($#ARGV != 0) { print "usage: copySph.pl \n". " Example: /mnt/main/corpus/switchboard/mini/train\n"; exit -1; }

$corpus_dir = $ARGV[0];
 * 1) set corpus directory

$trans_unedited = $corpus_dir;
 * 1) append the path the trans file based on the corpus dir provided

open(MYINPUTFILE, "<$trans_unedited") || die("can't open file: $!");
 * 1) open the transcript file for processing

while()               # read in file line by line {     $line = $_; chomp $line; $lower = $line; $lower =~ tr/A-Z/a-z/; $sysCmd = "ln -s /mnt/main/corpus/dist/Switchboard/disk8/SWB1/$line /mnt/main/corpus/dist/Switchboard/flat/$lower"; system($sysCmd); } close(MYINPUTFILE);

print "done\n";