Changeset 2614
- Timestamp:
- 06/17/08 15:40:55 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Dictionary.pm
r2613 r2614 13 13 use Carp; 14 14 use File::Copy; 15 use FileHandle; # for cleaner FORMAT names15 #use FileHandle; # for cleaner FORMAT names 16 16 use Lingua::EN::Numbers qw(num2en num2en_ordinal); 17 17 use Lingua::EN::Numbers::Years; Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/MissingWords/CommandLine.pm
r2613 r2614 14 14 =head1 Requirements 15 15 16 Perl Package: "Term::ReadLine::Gnu" needs to be installed - required for the "preput" feature it provides 17 Term::ReadLine is used as the front-end to Term::ReadLine::Gnu 16 Perl Package: "Term::ReadLine::Gnu" needs to be installed - required for the "preput" feature it provides. 17 "Term::ReadLine" is used as the front-end to "Term::ReadLine::Gnu". 18 18 19 19 =cut … … 30 30 my $command; 31 31 32 =head1 Class Methods 33 32 34 =head2 new 33 35 … … 49 51 return $self; 50 52 } 53 54 =head1 Instance Methods 51 55 52 56 =head2 interactive … … 88 92 updateDictionary(\@processedWordsPhones); 89 93 } 90 91 =head1 Methods92 94 93 95 =head3 process … … 221 223 print "updateDictionary\n"; 222 224 open(MISSINGWORDSFINAL,">AudioBook/interim_files/MissingWords_final") or confess ("cannot open AudioBook/interim_files/MissingWords_final file"); 225 # !!!!!! 226 my ($word, $phonesSelected); 223 227 foreach my $line (@$processedWordsPhones) { 224 my $word = $$line[0]; 225 my $phonesSelected = $$line[1]; 226 print MISSINGWORDSFINAL "$word\t[$word]\t$phonesSelected\n"; 228 $word = $$line[0]; 229 $phonesSelected = $$line[1]; 230 #print MISSINGWORDSFINAL "$word\t[$word]\t$phonesSelected\n"; 231 if (length($word)<14) { # 232 write MISSINGWORDSFINAL; 233 } else { 234 print MISSINGWORDSFINAL "$word [$word] $phonesSelected\n"; 235 } 227 236 } 228 237 close MISSINGWORDSFINAL; 238 format MISSINGWORDSFINAL = 239 @<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 240 $word,"[" . $word ."]",$phonesSelected 241 . 242 # !!!!!! 229 243 } 230 244