voxforge.org
VoxForge Dev

root/Trunk/Scripts/AcousticModel_scripts/AcousticModel/Nightly.pm

Revision 2521, 4.3 kB (checked in by kmaclean, 9 months ago)

fix to Nightly.pm

Line 
1 #!/usr/bin/perl -w
2 ####################################################################
3 ###
4 ### script name: Nightly.pm
5 ### modified by: Ken MacLean
6 ### email: contact@voxforge.org
7 ### Date: 2007.04.25
8 ### Version: 0.1
9 ###             
10 ### Copyright (C) 2007 Ken MacLean
11 ###
12 ### This program is free software; you can redistribute it and/or
13 ### modify it under the terms of the GNU General Public License
14 ### as published by the Free Software Foundation; either version 3
15 ### of the License, or (at your option) any later version.
16 ###
17 ### This program is distributed in the hope that it will be useful,
18 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 ### GNU General Public License for more details.
21 ###
22 ### Change History:
23 ####################################################################
24 package Nightly;
25 use strict;
26
27 my $command;
28 ####################################################################
29 # Subroutines
30 ####################################################################
31 sub CreateDir {
32         my ($parms, $Nightly_subdir) = @_;
33                 my $debug = $$parms{"debug"};
34                 my $Nightly_dirname = $$parms{"Nightly_dirname"};
35
36         # cleanup previous run - usually there was some sort of error in previous run
37         $command = ("rm -rf $Nightly_dirname"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
38         # notes:if the target directory does not exist (i.e. AcousticModel-2007-1-2), then
39         # "cp -r $QSdir $Nightly_dir/$Nightly_dirname" creates the "AcousticModel-2007-1-2" directory and only copies "Linux" and "Windows" directories into it
40         # if the target directory exists (i.e. AcousticModel-2007-1-2), then
41         # "cp -r $QSdir $Nightly_dir/$Nightly_dirname" creates the "QuickStart" directory (and its subdirectories "Windows" and "Linux") inside the "AcousticModel-2007-1-2" directory
42         # therefore need to make the NightlyDir before copying Quickstart to it ...
43         $command = ("mkdir $Nightly_dirname"); print "command:$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
44         return 1;
45 }
46        
47 sub Process {
48         my ($parms, $Nightly_subdir) = @_;
49                 my $debug = $$parms{"debug"};   
50                 my $Nightly_dirname = $$parms{"Nightly_dirname"};
51                 my $MirroringScripts_dir = $$parms{"MirroringScripts_dir"};     
52                 my $HTKdir = $$parms{"HTK_dir"};               
53         print "creating: $Nightly_dirname\n";
54         $command = ("mkdir -p $Nightly_dirname/$Nightly_subdir $Nightly_dirname/$Nightly_subdir/etc"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
55         $command = ("cp $MirroringScripts_dir/LICENSE $Nightly_dirname/$Nightly_subdir"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
56         $command = ("cp $MirroringScripts_dir/etc/GPL_License $Nightly_dirname/$Nightly_subdir/etc"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
57         $command = ("cp $HTKdir/input_files/config $Nightly_dirname/$Nightly_subdir"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
58         $command = ("cp $HTKdir/interim_files/dict $Nightly_dirname/$Nightly_subdir"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
59         $command = ("cp $HTKdir/interim_files/hmm15/hmmdefs $Nightly_dirname/$Nightly_subdir"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
60         $command = ("cp $HTKdir/interim_files/hmm15/macros $Nightly_dirname/$Nightly_subdir"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
61         $command = ("cp $HTKdir/interim_files/stats $Nightly_dirname/$Nightly_subdir"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
62         $command = ("cp $HTKdir/interim_files/tiedlist $Nightly_dirname/$Nightly_subdir"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
63         $command = ("cp $HTKdir/input_files/wav_config $Nightly_dirname/$Nightly_subdir"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
64         $command = ("cp $HTKdir/interim_files/master_prompts $Nightly_dirname/$Nightly_subdir"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?"
65         return 1;
66 }
67 1;
Note: See TracBrowser for help on using the browser.