- Timestamp:
- 05/30/08 15:08:45 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook.pm
r2599 r2600 108 108 ### Class Variables 109 109 #################################################################### 110 our($opt_a,$opt_b,$opt_d,$opt_h,$opt_l,$opt_m,$opt_p,$opt_r,$opt_s,$opt_t,$opt_x,$opt_q,$opt_S,$opt_T,$opt_u,$opt_v ); # need to define these because using strict.110 our($opt_a,$opt_b,$opt_d,$opt_h,$opt_l,$opt_m,$opt_p,$opt_r,$opt_s,$opt_t,$opt_x,$opt_q,$opt_S,$opt_T,$opt_u,$opt_v,$opt_w); # need to define these because using strict. 111 111 my %self; 112 112 $self{'debug'} = 0; … … 184 184 $audio->verifySegments; 185 185 } 186 if ($missingwordfound) { 187 $dictionary->getAlternatePronunciations("AudioBook/interim_files/MissingWords_alt",15); # uses Sequitor g2p to get top N pronunication vairations 188 $dictionary->createAltDict($originalDict,$altDict); # merge & sort missing_words_alt and originalDict into altDict 189 $dictionary->validateAlternatePronunciations($originalDict,$altDict,$prompts); 190 $dictionary->updatePronDict($pronDict); 186 if ($missingwordfound) { 187 if ($self->{"verify_out_of_vocabulary_pronunciations"}) { 188 $dictionary->getAlternatePronunciations("AudioBook/interim_files/MissingWords_alt",15); # uses Sequitor g2p to get top N pronunication vairations 189 $dictionary->createAltDict($originalDict,$altDict); # merge & sort missing_words_alt and originalDict into altDict 190 $dictionary->validateAlternatePronunciations($originalDict,$altDict,$prompts); 191 } 192 $dictionary->updatePronDict($pronDict); 191 193 } 194 192 195 if (defined($tarSuffix)){ 193 196 _createTarFile($self); … … 275 278 =head2 getOptions 276 279 277 Get the user submitted options ('a:b:d:hl:m:p:r:s:t:u:x:q:v ST')280 Get the user submitted options ('a:b:d:hl:m:p:r:s:t:u:x:q:vwST') 278 281 279 282 =cut … … 282 285 my ($self)= @_; 283 286 my $debug = $self->{'debug'}; 284 getopts('a:b:d:hl:m:p:r:s:t:u:x:q:v ST'); # sets $opt_* as a side effect.287 getopts('a:b:d:hl:m:p:r:s:t:u:x:q:vwST'); # sets $opt_* as a side effect. 285 288 if ($opt_a and $opt_t) { 286 289 if (-r $opt_a) { … … 337 340 } else { 338 341 $self->{"verify_segments"}=0; 339 } 342 } 343 if ($opt_w) { 344 $self->{"verify_out_of_vocabulary_pronunciations"}=1; 345 } else { 346 $self->{"verify_out_of_vocabulary_pronunciations"}=0; 347 } 340 348 ### Tar file processing 341 349 if (defined($opt_T)) { … … 403 411 print "\tpage:\t(http://www.voxforge.org/home/downloads/metrics)\n"; 404 412 405 print "-v\tverify segments created from first pass Forced Alignment\n"; 413 print "-v\tvalidate segment audio files to prompt text using forced Aligment\n"; 414 print "-w\tvalidate missing word pronunciations to audio (using created audio segments)\n"; 406 415 print "-x\tunique tar file suffix (max 3 characters - remainder is truncated)\n"; 407 416 print "-S\trun sanity test\n";