diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-10-28 17:58:34 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-10-28 17:58:34 +0000 |
commit | 13829cbd808c727112a9f24ac08141fc4483f5a3 (patch) | |
tree | c2871717c84deefee5cb654db70b90a61afc8f30 /word-aligner | |
parent | 17f53fcb8b6a18a48444f233eaeff609087035a3 (diff) |
more
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@695 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'word-aligner')
-rw-r--r-- | word-aligner/support/generate-per-sentence-grammars.pl | 5 |
1 files 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{"<eps>"} = 1; while(my $f = <FV>) { 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(<G>) { |