Changeset 2619
- Timestamp:
- 06/24/08 21:11:08 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/UserSubmission/AUDIO.pm
r2580 r2619 230 230 231 231 sub Audio2PromptsValidation { # public 232 # !!!!!!233 #my ($self, $parms, $audio_dir_name, $numberofPrompts ) = @_;234 232 my ($self,$prompts) = @_; 235 233 … … 237 235 my $audio_dir_name = $self->{'audio_dir_name'}; 238 236 my $numberofPrompts = $prompts->getPromptCount; 239 # !!!!!!240 237 my $debug = $$parms{"debug"}; 241 238 my $QuarantineDir = $$parms{"QuarantineDir"}; … … 244 241 my $AudioScripts_dir = $$parms{"AudioScripts_dir"}; 245 242 my $AMCreate_scripts_dir = $$parms{"HTK_dir"}; 243 244 # !!!!!! 245 my @tokensWithIssues; 246 # !!!!!! 246 247 247 248 print "!!!!!!Audio2PromptsValidation:$audio_dir_name\n" if $debug; … … 256 257 $command = ("rm -f $QuarantineDir/$audio_dir_name/dict $QuarantineDir/$audio_dir_name/wlist $QuarantineDir/$audio_dir_name/VALIDATION-PROMPTS"); print "$command\n" if $debug; system($command);if ($?) {_a2PVError($self,$command)}; 257 258 open (HVite_Log, "$QuarantineDir/$audio_dir_name/HVite_log") || confess ("Unable to open file: $QuarantineDir/$audio_dir_name/HVite_log"); 258 # !!!!!!259 259 my $count = 0; 260 # !!!!!!260 my $mfcFile; 261 261 while (my $line = <HVite_Log>) { 262 262 chomp $line; 263 my $filename; 264 if ($line =~ /Aligning File:/) { 265 my @line=split(/:/, $line); 266 $filename = pop(@line); 267 } elsif ($line =~ /No tokens survived to final node of network at beam/) { 263 if ($line =~ /Aligning File:/) { 264 my @line=split(/ /, $line); 265 my $mfcFilePath = pop (@line); 266 $mfcFile = basename("$mfcFilePath"); 267 } elsif ($line =~ /No tokens survived to final node of network at beam (\d+)/) { 268 my $beamWidth = $1; 268 269 my @line=split(/ /, $line); 269 270 my $beam = pop (@line); 270 271 $beam =~ s/ //g; 271 print "\n\n\n\n******************************************************************\n"; 272 print "**** check that audio corresponds to prompt in file: $audio_dir_name ***\n"; 273 print "******************************************************************\n\n\n\n"; 274 if ($beam > 250) { 272 print "**** check that audio corresponds to prompt in file: $audio_dir_name:$mfcFile ***\n"; 273 # !!!!!! 274 push (@tokensWithIssues,[$audio_dir_name, $mfcFile, $beamWidth]); 275 # !!!!!! 276 #if ($beam > 250) { 277 if ($beam > 1000) { 275 278 confess "audio not corresponding to prompt file, check HVite_Log; error code: $?" ; 276 279 } 277 # !!!!!!278 280 } elsif ($line =~ /Created lattice with/) { 279 281 $count++; 280 # !!!!!!281 282 } 282 283 } 283 # !!!!!!284 #if (!$count >=10) {285 # confess "HVite not able to process all $numberofPrompts audio files set out in Prompts file, only $count processed" ;286 284 print "!!!!!!count: $count ;getPromptCount:" . $prompts->getPromptCount . "\n"; 287 285 if (!($count == $prompts->getPromptCount)) { 288 286 confess "\n\n\nError:HVite not able to process all " . $prompts->getPromptCount . " audio files set out in Prompts file, only $count processed\n\n\n" ; 289 287 } 288 close (HVite_Log); 289 # !!!!!! 290 $self->{'tokensWithIssues'} = \@tokensWithIssues; 290 291 # !!!!!! 291 close (HVite_Log);292 292 return 1; 293 293 } … … 397 397 } 398 398 399 sub getTokensWithIssues { 400 my $self = shift; 401 return $self->{'tokensWithIssues'}; 402 } 403 399 404 1; Trunk/Scripts/Audio_scripts/UserSubmission/README.pm
r2583 r2619 136 136 } 137 137 } 138 close README; 138 139 if ( (($readmecontents{'language'}) eq "") or (!defined($readmecontents{'language'})) ){ 139 140 confess "no language defined\n"; … … 143 144 # !!!!!! 144 145 } 145 if ( ( ($readmecontents{'updatewebguiforum'}) eq "") or (!defined($readmecontents{'updatewebguiforum'})) ){146 if ( (!defined($readmecontents{'updatewebguiforum'})) or (($readmecontents{'updatewebguiforum'}) eq "") ){ 146 147 $readmecontents{'updatewebguiforum'} = 'n' 148 } elsif ($readmecontents{'updatewebguiforum'} eq "yes") { 149 open(README, "<$ReadmeWithPath") || confess ("Unable to open file for reading: $ReadmeWithPath"); 150 my @readme = <README>; 151 close README; 152 open(README, ">$ReadmeWithPath") || confess ("Unable to open file for writing: $ReadmeWithPath"); 153 foreach my $line (@readme) { 154 print $line unless ($line =~ /Update WebGUI Forum: /i); 155 } 156 close README; 157 } else { 158 $readmecontents{'updatewebguiforum'} = 'n' 147 159 } 148 160 return \%readmecontents;