- Timestamp:
- 05/15/08 10:44:44 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Dictionary.pm
r2585 r2586 38 38 $self{'htk_files'} = $super->{'htk_files'}; 39 39 $self{'g2p_model'} = $super->{'g2p_model'}; 40 $self{'log'} = $super->{'log'}; 40 41 bless(\%self,$class); 41 42 return \%self; … … 52 53 $self->{"missing_words"} = $missing_words; 53 54 54 $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: $?"; 55 open(DLOG,"AudioBook/interim_files/dlog") or confess ("cannot open AudioBook/interim_files/dlog file"); 55 $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: $?"; 56 my $dlog1 = "AudioBook/interim_files/logs/dlog1"; 57 $command = ("mv AudioBook/interim_files/dlog $dlog1"); print "cmd:$command\n" if $debug; system($command); 58 open(DLOG,$dlog1) or confess ("cannot open $dlog1 file"); 56 59 open(MISSINGWORDS,">$missing_words") or confess ("cannot open $missing_words file"); 57 60 my $missingwordsheader = 0; … … 82 85 sub getPronunciations { # public 83 86 my ($self,$missing_words_out)= @_; 84 my $debug = $self->{ "debug"};87 my $debug = $self->{'debug'}; 85 88 my $model = $self->{'g2p_model'}; 86 my $missing_words = $self->{"missing_words"}; 89 my $missing_words = $self->{'missing_words'}; 90 my $log = $self->{'log'}; 87 91 88 92 $self->{"missing_words_out"} = $missing_words_out; … … 94 98 } 95 99 open(MISSINGWORDSOUT,">$missing_words_out") or confess ("cannot open $missing_words_out file"); 100 open(LOG,">>$log") or confess ("cannot open $log file"); 101 print LOG "\nMissing Words added to Pronunciation Dictionary:\n"; 102 print LOG "------------------------------------------------\n"; 96 103 my ($word, $phonemes); 97 104 format MISSINGWORDSOUT = 105 @<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 106 $word,"[" . $word ."]",$phonemes 107 . 108 format LOG = 98 109 @<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 99 110 $word,"[" . $word ."]",$phonemes … … 104 115 $phonemes = join(" ",@line); 105 116 write MISSINGWORDSOUT; 117 write LOG; 106 118 } 119 close MISSINGWORDSOUT; 120 close LOG; 107 121 return 1; 108 122 }