voxforge.org
VoxForge Dev

Changeset 2576

Show
Ignore:
Timestamp:
05/11/08 22:31:51 (7 months ago)
Author:
kmaclean
Message:

AudioSegmentation scripts - snapshot

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook.pm

    r2575 r2576  
    2222###  
    2323### Changes:     
    24 ### 2008/05/02 - 0.2 - Convert to class; major refacture ; renamed fullrun.pl to AudioBook.pm                                                        
     24### 2008/05/02 - 0.2 - convert to calss; major refacture ; renamed fullrun.pl to AudioBook.pm                                                        
    2525#################################################################### 
    2626package AudioBook; 
     
    3434use AudioBook::Dictionary; 
    3535#################################################################### 
    36 ### get Option
     36### Class Variable
    3737#################################################################### 
    3838our($opt_a,$opt_d,$opt_h,$opt_l,$opt_r,$opt_t,$opt_x,$opt_K,$opt_T,); # need to define these because using strict. 
    39 getopts('a:d:hl:r:t:u:x:KT');    #  sets $opt_* as a side effect. 
    40 my ($audiofile, $textfile, $voxforgeDict,$tarSuffix,$README,$LICENCE,$username); 
    41 if ($opt_a and $opt_t and $opt_d) {      
    42         if (-r $opt_a) { 
    43                 $audiofile=$opt_a; 
     39my %self; 
     40$self{'debug'} = 0; 
     41$self{'g2p_model'} = "AudioBook/input_files/g2p/models/model-5"; 
     42$self{'htk_files'} = "AudioBook/input_files/htk"; 
     43my $command; 
     44 
     45#################################################################### 
     46### Main 
     47#################################################################### 
     48getOptions(\%self); 
     49process(\%self); 
     50print "completed!\n"; 
     51 
     52#################################################################### 
     53### Main 
     54#################################################################### 
     55sub getOptions { 
     56        my ($self)= @_; 
     57        getopts('a:d:hl:r:t:u:x:KT');    #  sets $opt_* as a side effect. 
     58        if ($opt_a and $opt_t and $opt_d) {      
     59                if (-r $opt_a) { 
     60                        $self->{"audiofile"}=$opt_a; 
     61                } else { 
     62                        die "can't open -a" . $self->{"audiofile"} . "\n";               
     63                } 
     64                if (-r $opt_t) { 
     65                        $self->{"textfile"}=$opt_t; 
     66                } else { 
     67                        die "can't open -t" . $self->{"textfile"} . "\n";                
     68                } 
     69                if (-r $opt_d) { 
     70                        $self->{"voxforgeDict"}=$opt_d; 
     71                } else { 
     72                        die "can't open -d" . $self->{"voxforgeDict"} . "\n";            
     73                } 
     74                ### 
     75                if (defined($opt_T)) { 
     76                        if ($opt_x) { 
     77                                $self->{"tarSuffix"}=substr($opt_x,3); # only use 1st 3 characters.                      
     78                        }else { 
     79                                $self->{"tarSuffix"}=random_characters(3); 
     80                        } 
     81         
     82                        if ($opt_r) { 
     83                                if (-r $opt_r) { 
     84                                        $self->{"README"}=$opt_r;        
     85                                } else { 
     86                                        die "can't open -r" . $self->{"README"} . "\n";                          
     87                                } 
     88                        } else { 
     89                                $self->{"README"}="AudioBook/input_files/README"; 
     90                        }                
     91                        if ($opt_l) { 
     92                                if (-r $opt_l) { 
     93                                        $self->{"LICENCE"}=$opt_l;       
     94                                } else { 
     95                                        die "can't open -l" . $self->{"LICENCE"} . "\n";                                 
     96                                } 
     97                        } else { 
     98                                $self->{"LICENCE"}="AudioBook/input_files/LICENCE"; 
     99                        } 
     100                } 
     101        } elsif ($opt_K) { 
     102                $self->{"audiofile"}="AudioBook/test/audio.wav"; 
     103                $self->{"textfile"}="AudioBook/test/text-simple.txt"; 
     104                $self->{"voxforgeDict"}="AudioBook/test/VoxForgeDict"; 
     105                $self->{"tarSuffix"}=_random_characters(3); 
     106                $self->{"username"}="test"; 
     107                print "test using the following files:\n"; 
     108                print "\t" . $self->{"audiofile"} . "\n"; 
     109                print "\t" . $self->{"textfile"} . "\n"; 
     110                print "\t" . $self->{"voxforgeDict"} . "\n"; 
     111        } elsif ($opt_h) { 
     112                print "\nVoxForge Audio Segmentation Script Parameters\n";       
     113                print   "=============================================\n";       
     114                print "-a\t* audio file name\n"; 
     115                print "-d\t* pronunication dictionary\n"; 
     116                print "-h\tshow help\n";         
     117                print "-l\tLICENSE file (default = AudioBook/input_files/LICENCE)\n";    
     118                print "-r\tREADME file (default = AudioBook/input_files/README)\n";              
     119                print "-t\t* text file name\n"; 
     120                print "-u\tusername or name you want file stats collected by on VoxForge Metrics \n"; 
     121                print "\tpage:\t(http://www.voxforge.org/home/downloads/metrics)\n";     
     122                print "-K\trun test\n";          
     123                print "-T\tunique tar file suffix - also acts a switch to create gzipped/tar file\n"; 
     124                print "\t(max 3 characters - remainder is truncated)\n";                 
     125                print "\n\t* required for scripts to run\n";     
     126                print "\n";      
     127                exit; 
    44128        } else { 
    45                 die "can't open -a $audiofile\n";                
     129                print "\nVoxForge Audio Segmentation Script\n";  
     130                print   "==================================\n";  
     131                print "parms -a, -t, -d need to be defined, use -h parameter for more information\n\n"; 
     132                exit; 
    46133        } 
    47         if (-r $opt_t) { 
    48                 $textfile=$opt_t; 
     134        print "audiofile:" . $self->{"audiofile"}. "\n"; 
     135        print "textfile:" . $self->{"textfile"}. "\n"; 
     136        print "voxforgeDict:" . $self->{"voxforgeDict"} . "\n"; 
     137
     138 
     139sub process { 
     140        my ($self)= @_; 
     141        my $debug = $self->{'debug'}; 
     142        my $audiofile = $self->{"audiofile"}; 
     143        my $textfile = $self->{"textfile"}; 
     144        my $username = $self->{"username"}; 
     145        my $tarSuffix = $self->{"tarSuffix"}; 
     146        my $voxforgeDict = $self->{"voxforgeDict"}; 
     147        my $tarSuffix = $self->{"tarSuffix"}; 
     148        my $htk_files = $self->{'htk_files'}; 
     149         
     150        my $textContents = AudioBook::Text->new($textfile); 
     151        $textContents->createWLISTFile("AudioBook/interim_files/wlist"); 
     152         
     153        my $dictionary = AudioBook::Dictionary->new($self); 
     154        my $missingwordfound = $dictionary->findOutOfVocabularyWords($voxforgeDict,"AudioBook/interim_files/MissingWords"); 
     155        if ($missingwordfound) {  
     156                $dictionary->getPronunciations("AudioBook/interim_files/MissingWords_out"); # uses g2p 
     157                $dictionary->updatePronDict(); 
     158                # need to update dict with missing words 
     159         
     160                $command = ("HDMan -A -D -T 1 -g $htk_files/global.ded -m -w AudioBook/interim_files/wlist -i -l AudioBook/interim_files/dlog AudioBook/interim_files/dict" . $self->{"voxforgeDict"}); system($command) == 0 or confess "fullrun $command failed: $?"; 
     161                $command = ("cp AudioBook/interim_files/MissingWords_out AudioBook/output_files/MissingWords"); print "cmd:$command\n" if $debug; system($command); 
    49162        } else { 
    50                 die "can't open -t $textfile\n";                 
     163                open(MISSINGWORDSOUT,">AudioBook/output_files/MissingWords") or confess ("cannot open AudioBook/output_files/MissingWords file");        
     164                print MISSINGWORDSOUT "no missing words\n"; 
     165                close MISSINGWORDSOUT 
     166        }  
     167        $command = ("cp AudioBook/interim_files/dict AudioBook/output_files"); print "cmd:$command\n" if $debug; system($command);       
     168        my $audio = AudioBook::Audio->new($self); 
     169        $audio->segment($audiofile,$textContents); 
     170        if (defined($tarSuffix)){ 
     171                _createTarFile($self); 
    51172        } 
    52         if (-r $opt_d) { 
    53                 $voxforgeDict=$opt_d; 
    54         } else { 
    55                 die "can't open -d $voxforgeDict\n";             
    56         } 
    57         ### 
    58         if (defined($opt_T)) { 
    59                 if ($opt_x) { 
    60                         $tarSuffix=substr($opt_x,3); # only use 1st 3 characters.                        
    61                 }else { 
    62                         $tarSuffix=random_characters(3); 
    63                 } 
    64  
    65                 if ($opt_r) { 
    66                         if (-r $opt_r) { 
    67                                 $README=$opt_r;  
    68                         } else { 
    69                                 die "can't open -r $README\n";                           
    70                         } 
    71                 } else { 
    72                         $README="AudioBook/input_files/README"; 
    73                 }                
    74                 if ($opt_l) { 
    75                         if (-r $opt_l) { 
    76                                 $LICENCE=$opt_l;         
    77                         } else { 
    78                                 die "can't open -l $LICENCE\n";                          
    79                         } 
    80                 } else { 
    81                         $LICENCE="AudioBook/input_files/LICENCE"; 
    82                 } 
    83         } 
    84 } elsif ($opt_K) { 
    85         $audiofile="AudioBook/test/audio.wav"; 
    86         $textfile= "AudioBook/test/text-simple.txt"; 
    87         $voxforgeDict="AudioBook/test/VoxForgeDict"; 
    88         $tarSuffix=random_characters(3); 
    89         $username="test"; 
    90         print "test using the following files:\n\t$audiofile\n\t$textfile\n\t$voxforgeDict\n"; 
    91 } elsif ($opt_h) { 
    92         print "\nVoxForge Audio Segmentation Script Parameters\n";       
    93         print   "=============================================\n";       
    94         print "-a\t* audio file name\n"; 
    95         print "-d\t* pronunication dictionary\n"; 
    96         print "-h\tshow help\n";         
    97         print "-l\tLICENSE file (default = AudioBook/input_files/LICENCE)\n";    
    98         print "-r\tREADME file (default = AudioBook/input_files/README)\n";              
    99         print "-t\t* text file name\n"; 
    100         print "-u\tusername or name you want file stats collected by on VoxForge Metrics \n"; 
    101         print "\tpage:\t(http://www.voxforge.org/home/downloads/metrics)\n";     
    102         print "-K\trun test\n";          
    103         print "-T\tunique tar file suffix - also acts a switch to create gzipped/tar file\n"; 
    104         print "\t(max 3 characters - remainder is truncated)\n";                 
    105         print "\n\t* required for scripts to run\n";     
    106         print "\n";      
    107         exit; 
    108 } else { 
    109         print "\nVoxForge Audio Segmentation Script\n";  
    110         print   "==================================\n";  
    111         print "parms -a, -t, -d need to be defined, use -h parameter for more information\n\n"; 
    112         exit; 
    113 
    114 print "audiofile:$audiofile\n"; 
    115 print "testfile:$textfile\n"; 
    116 print "voxforgeDict:$voxforgeDict\n"; 
    117 #################################################################### 
    118 ### Class Variables 
    119 #################################################################### 
    120 my $command; 
    121 my %parms; 
    122 $parms{'debug'} = 0; 
    123 $parms{'g2p_model'} = "AudioBook/input_files/g2p/models/model-5"; 
    124 $parms{'htk_files'} = "AudioBook/input_files/htk"; 
    125  
    126 #################################################################### 
    127 ### Main 
    128 #################################################################### 
    129 my $debug = $parms{'debug'};     
    130 my $textContents = AudioBook::Text->new(\%parms,$textfile); 
    131 $textContents->createWLISTFile("AudioBook/interim_files/wlist"); 
    132 my $dictionary = AudioBook::Dictionary->new(\%parms,$voxforgeDict); 
    133 my $missingwordfound = $dictionary->findOutOfVocabularyWords("AudioBook/interim_files/MissingWords"); 
    134 if ($missingwordfound) {  
    135         $dictionary->getPronunciations("AudioBook/interim_files/MissingWords_out"); # uses g2p 
    136         $dictionary->updatePronDict(); 
    137         # need to update dict with missing words 
    138         my $htk_files = $parms{'htk_files'}; 
    139         $command = ("HDMan -A -D -T 1 -g $htk_files/global.ded -m -w AudioBook/interim_files/wlist -i -l AudioBook/interim_files/dlog AudioBook/interim_files/dict $voxforgeDict"); system($command) == 0 or confess "fullrun $command failed: $?"; 
    140         $command = ("cp AudioBook/interim_files/MissingWords_out AudioBook/output_files/MissingWords"); print "cmd:$command\n" if $debug; system($command); 
    141 } else { 
    142         open(MISSINGWORDSOUT,">AudioBook/output_files/MissingWords") or confess ("cannot open AudioBook/output_files/MissingWords file");        
    143         print MISSINGWORDSOUT "no missing words\n"; 
    144         close MISSINGWORDSOUT 
    145 }  
    146 $command = ("cp AudioBook/interim_files/dict AudioBook/output_files"); print "cmd:$command\n" if $debug; system($command);       
    147 my $audio = AudioBook::Audio->new(\%parms,$audiofile,$textContents); 
    148 $audio->segment(); 
    149 if (defined($tarSuffix)){ 
    150         my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); 
    151         $year += 1900; 
    152         $mon = sprintf("%02d", $mon);  
    153         $mday = sprintf("%02d", $mday); 
    154         print "date:$sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst\n"; 
    155         print "creating qzipped tar file:$username$\-$year$mon$mday\-$tarSuffix\.tgz \n"; 
    156         $command = ("tar -zcvf $username$\-$year$mon$mday\-$tarSuffix\.tgz AudioBook/output_files --exclude \"\.svn\" "); print "cmd:$command\n" if $debug; system($command); 
    157         print "please submit your tar file to: www.voxforge.org\n";      
    158 
    159 print "completed!\n"; 
    160  
    161 ########################################################## 
    162 # Subroutines 
    163 ########################################################### 
    164 sub random_characters { 
     173
     174 
     175sub _createTarFile { 
     176                my ($self)= @_; 
     177                my $debug = $self->{'debug'}; 
     178                my $username = $self->{"username"}; 
     179                my $tarSuffix = $self->{"tarSuffix"}; 
     180                my $tarSuffix = $self->{"tarSuffix"}; 
     181                 
     182                my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); 
     183                $year += 1900; 
     184                $mon = sprintf("%02d", $mon);  
     185                $mday = sprintf("%02d", $mday); 
     186                print "creating gzipped tar file:$username\-$year$mon$mday\-$tarSuffix\.tgz \n"; 
     187                if ($debug) { 
     188                        $command = ("tar -zcvf $username\-$year$mon$mday\-$tarSuffix\.tgz AudioBook/output_files --exclude \"\.svn\" "); print "cmd:$command\n" if $debug; system($command); 
     189                } else { 
     190                        $command = ("tar -zcf $username\-$year$mon$mday\-$tarSuffix\.tgz AudioBook/output_files --exclude \"\.svn\" "); print "cmd:$command\n" if $debug; system($command); 
     191                } 
     192                print "please submit your tar file to: www.voxforge.org\n";      
     193
     194         
     195sub _random_characters { 
    165196        my ($length) = @_;       
    166197        my @chars=('a'..'z'); 
  • Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Audio.pm

    r2575 r2576  
    5151#################################################################### 
    5252sub new { 
    53         my ($class,$parms,$audiofile,$textContents) = @_;  
    54         print "Audio\.pm:audiofile:$audiofile\n"
     53        my ($class,$super) = @_;  
     54        my %self
    5555        $command = ("rm -f AudioBook/output_files/wav/*.wav"); print "$command\n"; system($command) == 0 or confess "Audio.pm $command failed: $?"; 
    56          
    57         my %self; 
    58         $self{"parms"} = $parms;         
    5956        $self{"process_audio"} = 1; 
    60         $self{"filename"} = $audiofile; 
    61         $self{"filename_nopath"} = basename($audiofile); 
    62         $self{"filename_nosuffix"}  = fileparse($audiofile, "wav"); 
    63         $self{"filename_nosuffix"}  =~ s/\.//;   
    64         $self{"samplerate"} = _getSampleRate(\%self); 
    65          
    66         $self{"textContents"} = $textContents;   
    67         _forceAlign(\%self);  
    68          
    69         $self{"aligned_words"} = _processHViteOutput(\%self); 
     57        $self{'htk_files'} = $super->{'htk_files'}; 
     58        $self{'g2p_model'} = $super->{'g2p_model'}; 
     59 
    7060        bless(\%self,$class); 
    7161        return \%self; 
     
    7666sub _getSampleRate { # private 
    7767        my ($self) = @_;         
    78         my $debug = $self->{"parms"}->{"debug"}; 
     68        my $debug = $self->{"debug"}; 
    7969        my $wavfilename = $self->{"filename"}; 
    8070         
     
    8777sub     _forceAlign { # private 
    8878        my ($self) = @_;         
    89         my $debug = $self->{"parms"}->{"debug"}; 
     79        my $debug = $self->{"debug"};   
    9080        my $filename = $self->{"filename"}; 
    91         my $htk_files = $self->{'parms'}->{'htk_files'}; 
     81        my $htk_files = $self->{'htk_files'}; 
    9282        my $textContents = $self->{"textContents"};  
    9383         
     
    10494sub _processHViteOutput { # private 
    10595        my ($self) = @_;         
    106         my $debug = $self->{"parms"}->{"debug"}; 
     96        my $debug = $self->{"debug"};   
    10797                 
    10898        open(ALIGNED, "<AudioBook/interim_files/aligned.out") or confess ("can\'t open AudioBook/interim_files/aligned.out file for reading");  
     
    143133 
    144134sub segment { # public 
    145         my ($self) = @_;         
    146         my $debug = $self->{"parms"}->{"debug"}; 
    147         my $filename = $self->{"filename"}; 
    148         my $filename_nosuffix = $self->{"filename_nosuffix"}; 
    149         my $filename_nopath = $self->{"filename_nopath"}; 
    150         my $aligned_words = $self->{"aligned_words"}; 
    151          
     135        my ($self,$filename,$textContents) = @_;         
     136        my $debug = $self->{"debug"};            
     137 
     138        my $filename_nopath = basename($filename); 
     139        my $filename_nosuffix = fileparse($filename, "wav"); 
     140        $filename_nosuffix  =~ s/\.//;   
     141        $self->{"filename"} = $filename;         
     142        $self->{"filename_nopath"} = $filename_nopath; 
     143        $self->{"filename_nosuffix"} = $filename_nosuffix; 
     144        $self->{"textContents"} = $textContents; 
     145 
     146        my $samplerate = _getSampleRate($self); 
     147        $self->{"samplerate"} = $samplerate; 
     148           
     149        _forceAlign($self);  
     150        my $aligned_words= _processHViteOutput($self); 
     151        $self->{"aligned_words"} = $aligned_words; 
     152                 
    152153        print "### segment::$filename #################################################################\n";      
    153154        # copy to "interim_files"" directory for processing; also converts to 16 bits per sample (-w=16-bits) so it can be processed by HVite 
     
    210211sub _sentence_test { # private 
    211212        my ($self, $where, $increment,$aligned_words, $fileid, $sentence_start, $sentence_end) = @_; 
    212         my $debug = $self->{"parms"}->{"debug"}; 
     213        my $debug = $self->{"debug"};   
    213214        my $filename_nosuffix = $self->{"filename_nosuffix"}; 
    214215         
     
    272273sub _calculateStats { # Calculate min and max sentence 
    273274        my ($self,$sentence_start,$sentence_end,$increment,$filename_nosuffix,$padded_fileid ) = @_; 
    274         my $debug = $self->{"parms"}->{"debug"}; 
     275        my $debug = $self->{"debug"};   
    275276         
    276277        if ($debug) { 
     
    297298sub _last_sentence { # private 
    298299        my ($self, $aligned_words, $fileid, $sentence_start, $sentence_end) = @_; 
    299         my $debug = $self->{"parms"}->{"debug"}; 
     300        my $debug = $self->{"debug"};   
    300301        my $filename_nosuffix = $self->{"filename_nosuffix"}; 
    301302        my ($count, $startTime); 
     
    330331sub _processAudio { # private 
    331332        my ($self, $startTime, $endTime,$padded_fileid) = @_; 
    332         my $debug = $self->{"parms"}->{"debug"}; 
     333        my $debug = $self->{"debug"};   
    333334        my $process_audio = $self->{"process_audio"}; 
    334335        my $samplerate = $self->{"samplerate"}; 
    335336        my $filename_nosuffix = $self->{"filename_nosuffix"}; 
    336337        my $filename_nopath = $self->{"filename_nopath"}; 
    337         my $htk_files = $self->{'parms'}->{'htk_files'}; 
     338        my $htk_files = $self->{'htk_files'}; 
    338339 
    339340        #print "debug:$debug;process_audio:$process_audio:\n"; 
  • Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Dictionary.pm

    r2574 r2576  
    2828 
    2929my $command; 
     30 
    3031#################################################################### 
    3132### Constructor 
    3233#################################################################### 
    3334sub new { 
    34         my ($class,$parms,$voxforgeDict) = @_;  
     35        my ($class,$super) = @_;  
    3536        my %self; 
    36         $self{"parms"} = $parms
    37         $self{"voxforgeDict"} = $voxforgeDict
     37        $self{'htk_files'} = $super->{'htk_files'}
     38        $self{'g2p_model'} = $super->{'g2p_model'}
    3839        bless(\%self,$class); 
    3940        return \%self; 
     
    4344#################################################################### 
    4445sub findOutOfVocabularyWords { # public  
    45         my ($self,$missing_words)= @_;   
    46         my $debug = $self->{"parms"}->{"debug"}; 
    47         my $voxforgeDict = $self->{"voxforgeDict"};  
    48         my $htk_files = $self->{'parms'}->{'htk_files'}; 
     46        my ($self,$voxforgeDict, $missing_words)= @_;    
     47        my $debug = $self->{"debug"};    
     48        my $htk_files = $self->{'htk_files'}; 
    4949         
     50        $self->{"voxforgeDict"} =  $voxforgeDict; 
    5051        $self->{"missing_words"} = $missing_words; 
    5152          
     
    7576        close DLOG; 
    7677        close MISSINGWORDS; 
     78        return $missingwordsfound; 
    7779} 
    7880 
    7981sub getPronunciations { # public  
    80         my ($self,$missing_words_out)= @_;       
    81         my $debug = $self->{"parms"}->{"debug"};         
     82        my ($self,$missing_words_out)= @_; 
     83        my $debug = $self->{"debug"}; 
     84        my $model = $self->{'g2p_model'}; 
     85        my $missing_words = $self->{"missing_words"}; 
     86 
    8287        $self->{"missing_words_out"} = $missing_words_out; 
    83         my $model = $self->{'parms'}->{'g2p_model'}; 
    84         my $missing_words = $self->{"missing_words"}; 
    8588         
    8689        my @missingwords = `export PYTHONPATH=/usr/local/lib64/python2.4/site-packages && 
     
    106109sub updatePronDict { # public  
    107110        my ($self)= @_;          
    108         my $debug = $self->{"parms"}->{"debug"};       
     111        my $debug = $self->{"debug"};          
    109112        my $voxforgeDict = $self->{"voxforgeDict"}; 
    110113        my $missing_words_out = $self->{"missing_words_out"};    
     
    135138           } 
    136139        close(DICTIONARY); 
     140        return 1; 
    137141} 
    1381421; 
  • Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Text.pm

    r2574 r2576  
    3131#################################################################### 
    3232sub new { 
    33         my ($class,$parms,$inputfilename) = @_;  
     33        my ($class,$textFile) = @_;  
    3434        my %self; 
    35         $self{"parms"} = $parms; 
    36         $self{"inputfilename"} = $inputfilename; 
     35        $self{"inputfilename"} = $textFile; 
    3736        _clean(\%self); 
    3837        bless(\%self,$class); 
     
    4544sub _clean { # private 
    4645        my ($self) = @_; 
    47         my $debug = $self->{"parms"}->{"debug"};       
     46        my $debug = $self->{"debug"};  
    4847        my $inputfilename = $self->{"inputfilename"}; 
    4948 
     
    103102 
    104103sub processNumbers { 
    105         # !!!!!! 
    106         #my ($parms, $words, $number) = @_;      
    107         #my $debug = $$parms{"debug"}; 
    108104        my ($self,$words, $number)= @_; 
    109         my $debug = $self->{"parms"}->{"debug"};       
    110         # !!!!!!         
     105        my $debug = $self->{"debug"};  
     106 
    111107        if ($number =~ /^\d+,\d+/) { # comma separated number 
    112108                my $wordnum = num2en($number); 
     
    183179sub createWLISTFile { # public 
    184180        my ($self, $WLISTFile)= @_; 
    185         my $debug = $self->{"parms"}->{"debug"};       
     181        my $debug = $self->{"debug"};  
    186182        my $words  = $self->{"contents"}; 
    187183         
     
    201197sub createMLFFile { # public 
    202198        my ($self,$wavfilename,$MLFFile)= @_; 
    203         my $debug = $self->{"parms"}->{"debug"};       
     199        my $debug = $self->{"debug"};  
    204200        $self->{"wavfilename"} = $wavfilename;   
    205201        print "wavfilename:$wavfilename\n"; 
  • Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/output_files/MissingWords

    r2575 r2576  
     1no missing words