root/Trunk/Scripts/AcousticModel_scripts/HTK/AMCreate_scripts/prompts2trainscp.pl
| Revision 2270, 1.5 kB (checked in by kmaclean, 1 year ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | #!/usr/bin/perl -w |
| 2 | #################################################################### |
| 3 | ### |
| 4 | ### script name : prompts2trainscp.pl |
| 5 | ### version: 0.1 |
| 6 | ### created by: Ken MacLean |
| 7 | ### mail: contact@voxforge.org |
| 8 | ### Date: 2006.09.26 |
| 9 | ### Command: perl ./prompts2trainscp.pl PromptFile Train.scp |
| 10 | ### |
| 11 | ### Copyright (C) 2006 Ken MacLean |
| 12 | ### |
| 13 | ### This program is free software; you can redistribute it and/or |
| 14 | ### modify it under the terms of the GNU General Public License |
| 15 | ### as published by the Free Software Foundation; either version 3 |
| 16 | ### of the License, or (at your option) any later version. |
| 17 | ### |
| 18 | ### This program is distributed in the hope that it will be useful, |
| 19 | ### but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | ### GNU General Public License for more details. |
| 22 | ### |
| 23 | #################################################################### |
| 24 | use strict; |
| 25 | my ($promptfile, $trainscp, $line, $filename, @labels); |
| 26 | if (@ARGV != 2) { |
| 27 | print "error - usage: $0 promptfile train\.scp\n\n"; |
| 28 | exit (0); |
| 29 | } |
| 30 | # read in command line arguments |
| 31 | ($promptfile, $trainscp) = @ARGV; |
| 32 | |
| 33 | open (PROMPT, "$promptfile") || die ("Unable to open $promptfile file for reading"); |
| 34 | open (SCP,">$trainscp") || die ("Unable to open $trainscp file for writing"); |
| 35 | |
| 36 | while ($line = <PROMPT>) { |
| 37 | chomp ($line); |
| 38 | ($filename,@labels) = split(/\s+/,$line); |
| 39 | print SCP ("$filename\.mfc\n"); |
| 40 | } |
| 41 | |
| 42 | close (PROMPT); |
| 43 | close(SCP); |
| 44 |
Note: See TracBrowser for help on using the browser.