Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2012-11-20 20:14:20 +0400
committerHieu Hoang <hieuhoang@gmail.com>2012-11-20 20:14:20 +0400
commitfeff7affaff52032d13778368a46685d9396d431 (patch)
tree6a893a5d1a3eb1aca7bb961addda74f60b4999ef
parentdbf0123c5c5cb61db2213a5134501e1f8bbd6ec7 (diff)
add tests for decoding with compressed pt
-rw-r--r--moses/LexicalReorderingTable.cpp4
-rw-r--r--regression-testing/MosesRegressionTesting.pm3
-rwxr-xr-xregression-testing/run-single-test.perl2
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){