Speech:Spring 2011 Dictionary


 * Home
 * Spring 2011
 * Proposal
 * Report
 * Appendix
 * [Dictionary]


 * 1) !/usr/bin/perl

if($#ARGV != 2 ) {       print "Compares the list of words in a file to the words in a dictionary and outputs the words available with pronunciations\n"; print "perl GenerateDictionary WordFile DictionaryFile OutputFile\n"; exit; }

open( WORD_FILE, "$ARGV[0]" ); open( DICT_FILE, "$ARGV[1]" ); open( OUTP_FILE, ">$ARGV[2]" );

@theDICT = ; close( DICT_FILE );

while(  ) {       my($line) = $_;

chomp($line);

foreach( @theDICT ) {               $tmpLine = $_;

@items = split( / /, $tmpLine );

if( @items[0] eq $line ) {                       print $line."\t".$tmpLine; print OUTP_FILE $tmpLine; }

}

}

close( WORD_FILE ); close( OUTP_FILE ); exit;