add tests for decoding with compressed pt

This commit is contained in:
Hieu Hoang 2012-11-20 16:14:20 +00:00
parent dbf0123c5c
commit feff7affaf
3 changed files with 5 additions and 4 deletions

View File

@ -52,10 +52,10 @@ void auxAppend(IPhrase& head, const IPhrase& tail)
LexicalReorderingTable* LexicalReorderingTable::LoadAvailable(const std::string& filePath, const FactorList& f_factors, const FactorList& e_factors, const FactorList& c_factors)
{
//decide use Compact or Tree or Memory table
#ifndef HAVE_CMPH
#ifdef HAVE_CMPH
if(FileExists(filePath + ".minlexr")) {
LexicalReorderingTable *compactLexr =
LexicalReorderingTableCompact::CheckAndLoad(filePath, f_factors, e_factors, c_factors);
LexicalReorderingTableCompact::CheckAndLoad(filePath + ".minlexr", f_factors, e_factors, c_factors);
if(compactLexr)
return compactLexr;
}

View File

@ -49,7 +49,7 @@ EOT
sub get_localized_moses_ini
{
use File::Temp;
my ($moses_ini, $data_dir) = @_;
my ($moses_ini, $data_dir, $results_dir) = @_;
my $LM_PATH = "$data_dir/lm";
my $MODEL_PATH = "$data_dir/models";
use Cwd qw/ abs_path /; use File::Basename; my $TEST_PATH = dirname(abs_path($moses_ini));
@ -61,6 +61,7 @@ sub get_localized_moses_ini
$l =~ s/\$\{LM_PATH\}/$LM_PATH/g;
$l =~ s/\$\{MODEL_PATH\}/$MODEL_PATH/g;
$l =~ s/\$\{TEST_PATH\}/$TEST_PATH/g;
$l =~ s/\$\{RESULTS_PATH\}/$results_dir/g;
print $local_moses_ini $l;
}
close MO;

View File

@ -54,7 +54,7 @@ die "Cannot locate executable called $decoder\n" unless (-x $decoder);
die "Cannot find $conf\n" unless (-f $conf);
die "Cannot locate input at $input" unless (-f $input);
my $local_moses_ini = MosesRegressionTesting::get_localized_moses_ini($conf, $data_dir);
my $local_moses_ini = MosesRegressionTesting::get_localized_moses_ini($conf, $data_dir, $results_dir);
my ($nbestfile,$nbestsize) = MosesRegressionTesting::get_nbestlist($conf);
if (defined($nbestsize) && $nbestsize > 0){