From 549df389bbc4fcee4f9641efea35ca7a5857eedf Mon Sep 17 00:00:00 2001 From: redpony Date: Thu, 28 Oct 2010 17:58:34 +0000 Subject: more git-svn-id: https://ws10smt.googlecode.com/svn/trunk@695 ec762483-ff6d-05da-a07a-a48fb63a330f --- word-aligner/support/generate-per-sentence-grammars.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/word-aligner/support/generate-per-sentence-grammars.pl b/word-aligner/support/generate-per-sentence-grammars.pl index 695cfc17..d621213e 100644 --- a/word-aligner/support/generate-per-sentence-grammars.pl +++ b/word-aligner/support/generate-per-sentence-grammars.pl @@ -4,7 +4,7 @@ use utf8; die "Usage: $0 f.voc corpus.f-e grammar.f-e.gz\n" unless scalar @ARGV == 3; -my $MAX_INMEM = 1000; +my $MAX_INMEM = 3000; open FV,"<$ARGV[0]" or die "Can't read $ARGV[0]: $!"; open C,"<$ARGV[1]" or die "Can't read $ARGV[1]: $!"; @@ -19,7 +19,7 @@ my %most_freq; $most_freq{""} = 1; while(my $f = ) { chomp $f; - %most_freq{$f}=1; + $most_freq{$f}=1; $vc++; last if $vc == $MAX_INMEM; } @@ -27,6 +27,7 @@ close FV; print STDERR "Loaded $vc vocabulary items for permanent translation cache\n"; +my %grammar; my $memrc = 0; my $loadrc = 0; while() { -- cgit v1.2.3