fix tests

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@657 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
redpony 2006-08-11 18:16:00 +00:00
parent 8f5f4dcc8b
commit c8d3471bbe
9 changed files with 136 additions and 83 deletions

View File

@ -1,22 +1,31 @@
#!/usr/bin/perl
BEGIN {push @INC, "tests/perllib";} #expect we'll be called from regression-testing/
use RegTestUtils;
$x=0;
while (<>) {
chomp;
if (/^Finished loading LanguageModels/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "LMLOAD_TIME ~ $time\n";
}
if (/^Finished loading phrase tables/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "PTLOAD_TIME ~ $time\n";
}
next unless /^BEST HYPO:/;
my $pscore = RegTestUtils::readHypoScore($_);
my $pscore = "FORMAT ERROR";
# BEST HYPO: only then will the european institutions to your task . [11111111111] [total score=-14.39] <<...>>
if (/\[1+\]\s*\[[^\]]*=(-?\d+\.\d+)\]/) {
$pscore = $1;
}
$x++;
print "SCORE_$x = $pscore\n";
}
sub get_time {
my $time = shift;
my $res = "FORMAT ERROR";
if ($time =~ /\[(\d+\.\d+)\]\s*seconds*/) {
$res = $1;
}
return $res;
}

View File

@ -1,22 +1,31 @@
#!/usr/bin/perl
BEGIN {push @INC, "tests/perllib";} #expect we'll be called from regression-testing/
use RegTestUtils;
$x=0;
while (<>) {
chomp;
if (/^Finished loading LanguageModels/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "LMLOAD_TIME ~ $time\n";
}
if (/^Finished loading phrase tables/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "PTLOAD_TIME ~ $time\n";
}
next unless /^BEST HYPO:/;
my $pscore = RegTestUtils::readHypoScore($_);
my $pscore = "FORMAT ERROR";
# BEST HYPO: only then will the european institutions to your task . [11111111111] [total score=-14.39] <<...>>
if (/\[1+\]\s*\[[^\]]*=(-?\d+\.\d+)\]/) {
$pscore = $1;
}
$x++;
print "SCORE_$x = $pscore\n";
}
sub get_time {
my $time = shift;
my $res = "FORMAT ERROR";
if ($time =~ /\[(\d+\.\d+)\]\s*seconds*/) {
$res = $1;
}
return $res;
}

View File

@ -1,22 +1,31 @@
#!/usr/bin/perl
BEGIN {push @INC, "tests/perllib";} #expect we'll be called from regression-testing/
use RegTestUtils;
$x=0;
while (<>) {
chomp;
if (/^Finished loading LanguageModels/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "LMLOAD_TIME ~ $time\n";
}
if (/^Finished loading phrase tables/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "PTLOAD_TIME ~ $time\n";
}
next unless /^BEST HYPO:/;
my $pscore = RegTestUtils::readHypoScore($_);
my $pscore = "FORMAT ERROR";
# BEST HYPO: only then will the european institutions to your task . [11111111111] [total score=-14.39] <<...>>
if (/\[1+\]\s*\[[^\]]*=(-?\d+\.\d+)\]/) {
$pscore = $1;
}
$x++;
print "SCORE_$x = $pscore\n";
}
sub get_time {
my $time = shift;
my $res = "FORMAT ERROR";
if ($time =~ /\[(\d+\.\d+)\]\s*seconds*/) {
$res = $1;
}
return $res;
}

View File

@ -1,22 +1,31 @@
#!/usr/bin/perl
BEGIN {push @INC, "tests/perllib";} #expect we'll be called from regression-testing/
use RegTestUtils;
$x=0;
while (<>) {
chomp;
if (/^Finished loading LanguageModels/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "LMLOAD_TIME ~ $time\n";
}
if (/^Finished loading phrase tables/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "PTLOAD_TIME ~ $time\n";
}
next unless /^BEST HYPO:/;
my $pscore = RegTestUtils::readHypoScore($_);
my $pscore = "FORMAT ERROR";
# BEST HYPO: only then will the european institutions to your task . [11111111111] [total score=-14.39] <<...>>
if (/\[1+\]\s*\[[^\]]*=(-?\d+\.\d+)\]/) {
$pscore = $1;
}
$x++;
print "SCORE_$x = $pscore\n";
}
sub get_time {
my $time = shift;
my $res = "FORMAT ERROR";
if ($time =~ /\[(\d+\.\d+)\]\s*seconds*/) {
$res = $1;
}
return $res;
}

View File

@ -1,22 +1,31 @@
#!/usr/bin/perl
BEGIN {push @INC, "tests/perllib";} #expect we'll be called from regression-testing/
use RegTestUtils;
$x=0;
while (<>) {
chomp;
if (/^Finished loading LanguageModels/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "LMLOAD_TIME ~ $time\n";
}
if (/^Finished loading phrase tables/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "PTLOAD_TIME ~ $time\n";
}
next unless /^BEST HYPO:/;
my $pscore = RegTestUtils::readHypoScore($_);
my $pscore = "FORMAT ERROR";
# BEST HYPO: only then will the european institutions to your task . [11111111111] [total score=-14.39] <<...>>
if (/\[1+\]\s*\[[^\]]*=(-?\d+\.\d+)\]/) {
$pscore = $1;
}
$x++;
print "SCORE_$x = $pscore\n";
}
sub get_time {
my $time = shift;
my $res = "FORMAT ERROR";
if ($time =~ /\[(\d+\.\d+)\]\s*seconds*/) {
$res = $1;
}
return $res;
}

View File

@ -1,22 +1,31 @@
#!/usr/bin/perl
BEGIN {push @INC, "tests/perllib";} #expect we'll be called from regression-testing/
use RegTestUtils;
$x=0;
while (<>) {
chomp;
if (/^Finished loading LanguageModels/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "LMLOAD_TIME ~ $time\n";
}
if (/^Finished loading phrase tables/) {
my $time = RegTestUtils::readTime($_);
my $time = get_time($_);
print "PTLOAD_TIME ~ $time\n";
}
next unless /^BEST HYPO:/;
my $pscore = RegTestUtils::readHypoScore($_);
my $pscore = "FORMAT ERROR";
# BEST HYPO: only then will the european institutions to your task . [11111111111] [total score=-14.39] <<...>>
if (/\[1+\]\s*\[[^\]]*=(-?\d+\.\d+)\]/) {
$pscore = $1;
}
$x++;
print "SCORE_$x = $pscore\n";
}
sub get_time {
my $time = shift;
my $res = "FORMAT ERROR";
if ($time =~ /\[(\d+\.\d+)\]\s*seconds*/) {
$res = $1;
}
return $res;
}

View File

@ -3,9 +3,29 @@ $x=0;
while (<>) {
chomp;
if (/^\[.* ; 2-2\]$/o) {
my @lines;
my $done = 0;
while (!$done) {
$x = <>;
if ($x =~ /^\s*$/o) { $done = 1; } else {
chomp $x;
$x =~ s/^\s+//o;
push @lines, $x;
}
}
my $c = 0;
foreach my $x (sort @lines) {
$c++;
print "TRANSLATION_OPTION_$c=$x\n";
}
}
next unless /^BEST HYPO:/;
s/^BEST HYPO:\s*//;
s/\s*\[111+.*$//;
$x++;
print "TRANSLATION_$x = $_\n";
}

View File

@ -1,23 +1,2 @@
#!/usr/bin/perl
$x=0;
while (<>) {
chomp;
if (/^\[.* ; 2-2\]$/o) {
my @lines;
my $done = 0;
while (!$done) {
$x = <>;
if ($x =~ /^\s*$/o) { $done = 1; } else {
chomp $x;
$x =~ s/^\s+//o;
push @lines, $x;
}
}
my $c = 0;
foreach my $x (sort @lines) {
$c++;
print "TRANSLATION_OPTION_$c=$x\n";
}
}
}

View File

@ -1,22 +1,22 @@
TRANSLATION_OPTION_1=form of , pC=-0.570639, c=-0.814663
TRANSLATION_OPTION_2=from , pC=-0.604413, c=-0.783405
TRANSLATION_OPTION_3=money , pC=-0.380378, c=-0.679572
TRANSLATION_OPTION_4=money transfers , pC=-0.290805, c=-0.797336
TRANSLATION_OPTION_5=of transfers , pC=-0.323035, c=-0.804664
TRANSLATION_OPTION_6=payments , pC=-0.493163, c=-0.815826
TRANSLATION_OPTION_7=providing , pC=-0.536236, c=-0.865767
TRANSLATION_OPTION_8=remittance , pC=-0.058577, c=-0.62658
TRANSLATION_OPTION_9=remittance of , pC=-0.153561, c=-0.725668
TRANSLATION_OPTION_10=remittances , , pC=-0.201788, c=-0.793385
TRANSLATION_OPTION_11=remittances , pC=-0.0431147, c=-0.611117
TRANSLATION_OPTION_12=remittances , to , pC=-0.161446, c=-0.863898
TRANSLATION_OPTION_13=remittances from , pC=-0.154321, c=-0.752515
TRANSLATION_OPTION_14=represents , pC=-0.551077, c=-0.85218
TRANSLATION_OPTION_15=sending money , pC=-0.332853, c=-0.835438
TRANSLATION_OPTION_16=sent , pC=-0.490528, c=-0.832855
TRANSLATION_OPTION_17=transfer , pC=-0.374108, c=-0.716859
TRANSLATION_OPTION_18=transfer of money , pC=-0.35242, c=-0.801209
TRANSLATION_OPTION_19=transfers , pC=-0.332958, c=-0.692228
TRANSLATION_OPTION_20=transfers from , pC=-0.35855, c=-0.759244
TRANSLATION_OPTION_1=form of , pC=-0.57, c=-0.81
TRANSLATION_OPTION_2=from , pC=-0.60, c=-0.78
TRANSLATION_OPTION_3=money , pC=-0.38, c=-0.68
TRANSLATION_OPTION_4=money transfers , pC=-0.29, c=-0.80
TRANSLATION_OPTION_5=of transfers , pC=-0.32, c=-0.80
TRANSLATION_OPTION_6=payments , pC=-0.49, c=-0.82
TRANSLATION_OPTION_7=providing , pC=-0.54, c=-0.87
TRANSLATION_OPTION_8=remittance , pC=-0.06, c=-0.63
TRANSLATION_OPTION_9=remittance of , pC=-0.15, c=-0.73
TRANSLATION_OPTION_10=remittances , , pC=-0.20, c=-0.79
TRANSLATION_OPTION_11=remittances , pC=-0.04, c=-0.61
TRANSLATION_OPTION_12=remittances , to , pC=-0.16, c=-0.86
TRANSLATION_OPTION_13=remittances from , pC=-0.15, c=-0.75
TRANSLATION_OPTION_14=represents , pC=-0.55, c=-0.85
TRANSLATION_OPTION_15=sending money , pC=-0.33, c=-0.84
TRANSLATION_OPTION_16=sent , pC=-0.49, c=-0.83
TRANSLATION_OPTION_17=transfer , pC=-0.37, c=-0.72
TRANSLATION_OPTION_18=transfer of money , pC=-0.35, c=-0.80
TRANSLATION_OPTION_19=transfers , pC=-0.33, c=-0.69
TRANSLATION_OPTION_20=transfers from , pC=-0.36, c=-0.76
TRANSLATION_1 = from the west .
TOTAL_WALLTIME ~ 14