voxforge.org
VoxForge Dev

root/Trunk/Scripts/AcousticModel_scripts/HTK/AMCreate_scripts/fixfulllist.pl

Revision 2270, 1.4 kB (checked in by kmaclean, 1 year ago)

Flac audio processing updates & GPL v3 updates

Line 
1 #!/usr/bin/perl
2 ####################################################################
3 ###
4 ### script name : fixfullist.pl
5 ### version: 0.1
6 ### created by: Ken MacLean
7 ### mail: contact@voxforge.org
8 ### Date: 2005.04.10
9 ### Command: perl ./fixfullist.pl
10 ###   
11 ### Copyright (C) 2005 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
25 use strict;
26 my ($line, $label, $filein, $fileout, %seen);
27 if (@ARGV != 2) {
28   print "usage: $0 filein fileout\n\n";
29   exit (0);
30 }
31 # read in command line arguments
32 ($filein, $fileout) = @ARGV;
33
34 open (FILEIN,"$filein") || die ("Unable to open $filein for reading");
35 open (FILEOUT,">$fileout") || die ("Unable to open $fileout for writing");
36
37 %seen = ();
38 while ($line = <FILEIN>) {
39   chomp ($line);
40   unless ($seen{$line}) { # remove duplicate triphone names
41          $seen{$line} = 1;
42            print (FILEOUT "$line\n");
43   }
44 }
45 close(FILEOUT);
Note: See TracBrowser for help on using the browser.