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
commit945adc48b08d8cbc1084b0e13a68876db707b816 (patch)
treef1a6fb1c232f9b850d04fc0c2970dc2c1a14aa73 /word-aligner/support
parentb01eeb03ebd34a737f698b647976f8f6dc1b3775 (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++;