mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-02 17:09:36 +03:00
bug fixed
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1491 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
e52040bc12
commit
568f92b310
@ -40,7 +40,7 @@ my @weight=();
|
||||
open(IN,$weightfile);
|
||||
chomp($weight=<IN>);
|
||||
close(IN);
|
||||
push @weight,split(/[ \t]+/,$weight);
|
||||
push @weight,split(/[ \t]+/,"1 $weight");
|
||||
my @active=();
|
||||
my @invertedactive=();
|
||||
|
||||
@ -71,18 +71,18 @@ while(chomp($_=<STDIN>)){
|
||||
for (my $i=0; $i<scalar(@notactive); $i++){
|
||||
$j=$notactive[$i];
|
||||
$notactivedweightedsum+=($weight[$j]*$field[$j]);
|
||||
printf STDERR "i:$i j:$j -> $weight[$j] - $field[$j] -> $notactivedweightedsum\n" if $debug>0;
|
||||
printf STDERR "notactive -> i:$i j:$j -> $weight[$j] - $field[$j] -> $notactivedweightedsum\n" if $debug>0;
|
||||
};
|
||||
|
||||
printf STDOUT "%.3f",$notactivedweightedsum;
|
||||
printf STDERR "sum not active features: %.3f\n",$notactivedweightedsum if $debug>0;
|
||||
for (my $i=0; $i<scalar(@active); $i++){
|
||||
print STDOUT " $field[$active[$i]]";
|
||||
printf STDERR "i:$i j:$active[$i] -> $field[$active[$i]]\n" if $debug>0;
|
||||
printf STDERR "active -> i:$i j:$active[$i] -> $field[$active[$i]]\n" if $debug>0;
|
||||
};
|
||||
for (my $i=scalar(@active)+scalar(@notactive)+1; $i< scalar(@field); $i++){
|
||||
print STDOUT " $field[$i]";
|
||||
printf STDERR "i:$i -> $field[$i]\n" if $debug>0;
|
||||
printf STDERR "extra -> i:$i -> $field[$i]\n" if $debug>0;
|
||||
};
|
||||
print STDOUT "\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user