- Timestamp:
- 05/26/08 09:24:36 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook.pm
r2590 r2591 38 38 ### Class Variables 39 39 #################################################################### 40 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 ); # need to define these because using strict.40 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. 41 41 my %self; 42 42 $self{'debug'} = 0; … … 94 94 my $audio = AudioBook::Audio->new($self); 95 95 $audio->segment($audiofile,$textContents); 96 $audio->verifySegments; 96 if ($self->{"verify_segments"}) { 97 $audio->verifySegments; 98 } 97 99 if (defined($tarSuffix)){ 98 100 _createTarFile($self); … … 168 170 my ($self)= @_; 169 171 my $debug = $self->{'debug'}; 170 getopts('a:b:d:hl:m:p:r:s:t:u:x:q: ST'); # sets $opt_* as a side effect.172 getopts('a:b:d:hl:m:p:r:s:t:u:x:q:v:ST'); # sets $opt_* as a side effect. 171 173 if ($opt_a and $opt_t) { 172 174 if (-r $opt_a) { … … 206 208 } 207 209 if ($opt_q) { 208 if ( ($opt_q eq "no") or ($opt_q eq "No") or ($opt_q eq "NO")){210 if ($opt_v =~ /^n|no$/i){ 209 211 $self->{"log_single_quotes"}= 0; 210 212 } else { … … 212 214 } 213 215 } else { 214 $self->{"log_single_quotes"}= "yes";216 $self->{"log_single_quotes"}= 1; 215 217 } 216 218 if ($opt_b) { … … 219 221 $self->{"beam_width"}=250; 220 222 } 223 if ($opt_v) { 224 if ($opt_v =~ /^y|yes$/i) { 225 $self->{"verify_segments"}=1; 226 } else { 227 $self->{"verify_segments"}=0; 228 } 229 } else { 230 $self->{"verify_segments"}=0; 231 } 221 232 ### Tar file processing 222 233 if (defined($opt_T)) { … … 261 272 $self->{"max_sentence_length"}= $default_max_sentence_length; 262 273 $self->{"min_pause_for_sentence_break"}=$default_min_pause_for_sentence_break; 274 275 $self->{"log_single_quotes"}= 1; 276 $self->{"verify_segments"}=1; 277 $self->{"README"}="AudioBook/input_files/README"; 278 $self->{"LICENSE"}="AudioBook/input_files/LICENSE"; 263 279 } elsif ($opt_h) { 264 280 print "\nVoxForge Audio Segmentation Script Parameters\n";