summaryrefslogtreecommitdiff
path: root/word-aligner/support
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-10-29 14:07:45 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-10-29 14:07:45 +0000
commit78f50e0c3c63de2149045c5afb307e9a3cacff82 (patch)
tree5aa0a441e06b36397070281d383f1dc2d4bf9e91 /word-aligner/support
parent0c6c6e1e72b13ab0bf6ea2da3ac83ba5a74e5cff (diff)
more wa
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@701 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'word-aligner/support')
-rwxr-xr-xword-aligner/support/make_lex_grammar.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/word-aligner/support/make_lex_grammar.pl b/word-aligner/support/make_lex_grammar.pl
index e4cbf7ba..8d38abda 100755
--- a/word-aligner/support/make_lex_grammar.pl
+++ b/word-aligner/support/make_lex_grammar.pl
@@ -35,7 +35,7 @@ my %sizes = ();
while(<M1>) {
chomp;
my ($f, $e, $lp) = split /\s+/;
- $model1{$f}->{$e} = 1e-12 + exp($lp);
+ $model1{$f}->{$e} = sprintf("%.5g", 1e-12 + exp($lp));
$sizes{$f}++;
}
close M1;
@@ -185,7 +185,11 @@ for my $f (sort keys %fdict) {
my $total_eandf = $ecounts{$e} + $fcounts{$f};
my $dice = 2 * $efcount / $total_eandf;
my @feats;
- if (defined $m1 && $ADD_MODEL1) { push @feats, "Model1=$m1"; my $m1d = $m1 * $dice; push @feats, "M1Dice=$m1d"; }
+ if (defined $m1 && $ADD_MODEL1) {
+ push @feats, "Model1=$m1";
+ my $m1d = sprintf("%.5g", $m1 * $dice);
+ push @feats, "M1Dice=$m1d";
+ }
if ($ADD_MODEL1 && !defined $m1) { push @feats, "NoModel1=1"; }
if ($ADD_FIDENT && $efcount > $MIN_FEATURE_COUNT) {
$fc++;