[RavenclawDev 247] [21] Tools/MakeLM/makelm.pl:
tk@edam.speech.cs.cmu.edu
tk at edam.speech.cs.cmu.edu
Fri Apr 13 17:22:37 EDT 2007
An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070413/e3ac106e/attachment.html
-------------- next part --------------
Modified: Tools/MakeLM/makelm.pl
===================================================================
--- Tools/MakeLM/makelm.pl 2007-04-06 20:08:03 UTC (rev 20)
+++ Tools/MakeLM/makelm.pl 2007-04-13 21:22:37 UTC (rev 21)
@@ -75,6 +75,8 @@
&say('compile', 'compiling dictionary...');
&getdict($DICT, $REDUCED_DICT, $VOCAB);
&say('compile', "done\n");
+close(LOG) if $LOGFILE;
+exit;
sub usage {
return "usage: $0 [-resourcesdir {resources directory}] [-samplesize {sample size}] [-source {source}] {project name}$/";
@@ -101,6 +103,7 @@
print CORPUS "<s> $_ </s>\n";
}
close CORPUS;
+ close RANDOM;
}
sub getvocab {
@@ -111,6 +114,7 @@
binmode VOCAB;
open(BASE, "<$basefile") || &fail("Can't open $basefile");
my @base = map { /(.*) .*/? uc("$1\n"): () } <BASE>;
+ close BASE;
print VOCAB grep !/<\/?S>/, sort(@base);
print VOCAB "<s>\n";
print VOCAB "</s>\n";
@@ -135,6 +139,7 @@
s/=/_/g;
push @long, $_;
}
+ close VOCAB;
foreach (&shorten(@long)) {
s/_/=/g;
print DICT "$_\n";
@@ -259,6 +264,7 @@
push @retval, $_;
last if $last_token eq (split(' ',$_))[0];
}
+ $pout->close;
map s/[\r\n]//g, @retval;
#waitpid $ppid, 0;
return @retval;
More information about the Ravenclaw-developers
mailing list