From feff7affaff52032d13778368a46685d9396d431 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Tue, 20 Nov 2012 16:14:20 +0000 Subject: [PATCH] add tests for decoding with compressed pt --- moses/LexicalReorderingTable.cpp | 4 ++-- regression-testing/MosesRegressionTesting.pm | 3 ++- regression-testing/run-single-test.perl | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/moses/LexicalReorderingTable.cpp b/moses/LexicalReorderingTable.cpp index 483435373..05be8c366 100644 --- a/moses/LexicalReorderingTable.cpp +++ b/moses/LexicalReorderingTable.cpp @@ -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; } diff --git a/regression-testing/MosesRegressionTesting.pm b/regression-testing/MosesRegressionTesting.pm index ff4bebcb4..e7e7e794e 100644 --- a/regression-testing/MosesRegressionTesting.pm +++ b/regression-testing/MosesRegressionTesting.pm @@ -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; diff --git a/regression-testing/run-single-test.perl b/regression-testing/run-single-test.perl index 0dc804719..48fcb5891 100755 --- a/regression-testing/run-single-test.perl +++ b/regression-testing/run-single-test.perl @@ -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){