[RavenclawDev 278] [921] Tools/MakeLM/makelm.pl: Added facility for makelm. pl to incorporate a hand dictionary.

tk@edam.speech.cs.cmu.edu tk at edam.speech.cs.cmu.edu
Sat Jun 9 23:22:17 EDT 2007


An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070609/99728a70/attachment.html
-------------- next part --------------
Modified: Tools/MakeLM/makelm.pl
===================================================================
--- Tools/MakeLM/makelm.pl	2007-06-08 19:04:20 UTC (rev 920)
+++ Tools/MakeLM/makelm.pl	2007-06-10 03:22:17 UTC (rev 921)
@@ -52,7 +52,9 @@
 $IDNGRAM = $PROJECT.'.idngram';
 $DECODERCONFIGDIR = File::Spec->catdir($RESOURCESDIR, 'DecoderConfig');
 $LM = File::Spec->catfile($DECODERCONFIGDIR, 'LanguageModel', $PROJECT.'LM.arpa');
-$DICT = File::Spec->catfile($DECODERCONFIGDIR, 'Dictionary', $PROJECT.'.dict');
+$DICTDIR = File::Spec->catdir($DECODERCONFIGDIR, 'Dictionary');
+$HAND_DICT = File::Spec->catfile($DICTDIR, 'hand.dict');
+$DICT = File::Spec->catfile($DICTDIR, $PROJECT.'.dict');
 $REDUCED_DICT = $DICT.'.reduced_phoneset';
 
 &say('compile', 'compiling grammar...');
@@ -245,7 +247,11 @@
 
 sub getdicLocal {
     my ($pin, $pout) = (IO::Handle->new, IO::Handle->new);
-    my $ppid = open2($pout, $pin, $PRONOUNCE, '-d', $LEXDATA, '-D', 'cmudict.0.6d_SPHINX_NEW', '-P')
+    my @pronounce_args = ('-P',
+			  '-d', $LEXDATA, 
+			  '-D', 'cmudict.0.6d_SPHINX_NEW');
+    push (@pronounce_args, '-H', $HAND_DICT) if -e $HAND_DICT;
+    my $ppid = open2($pout, $pin, $PRONOUNCE, @pronounce_args)
 	|| die "Couldn't run pronouniation server: '$PRONOUNCE'";
 
     open(GRAMSTREAM, $_[0]) || die "Can't open gramstream: '$_[0]'";


More information about the Ravenclaw-developers mailing list