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
path: root/moses/FF
diff options
context:
space:
mode:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-11-10 04:19:17 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-11-10 04:19:17 +0300
commitd94bc5df4ce4be98e599213f703c7e8c4d2a347b (patch)
treeacbc7a1a18b7e19933f120a8a21cec614edffe10 /moses/FF
parentec71c2397bb8316110efb91067dfb4c66b843cf3 (diff)
Handle lexicalized reordering models with collapseff.
Diffstat (limited to 'moses/FF')
-rw-r--r--moses/FF/LexicalReordering/LexicalReordering.cpp4
-rw-r--r--moses/FF/LexicalReordering/LexicalReorderingState.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/moses/FF/LexicalReordering/LexicalReordering.cpp b/moses/FF/LexicalReordering/LexicalReordering.cpp
index 4ff88bd15..c256570fd 100644
--- a/moses/FF/LexicalReordering/LexicalReordering.cpp
+++ b/moses/FF/LexicalReordering/LexicalReordering.cpp
@@ -145,8 +145,8 @@ SetCache(TranslationOption& to) const
Phrase const& tphrase = to.GetTargetPhrase();
to.CacheLexReorderingScores(*this, this->GetProb(sphrase,tphrase));
} else { // e.g. OOV with Mmsapt
- Scores vals(GetNumScoreComponents(), 0);
- to.CacheLexReorderingScores(*this, vals);
+ // Scores vals(GetNumScoreComponents(), 0);
+ // to.CacheLexReorderingScores(*this, vals);
}
}
diff --git a/moses/FF/LexicalReordering/LexicalReorderingState.cpp b/moses/FF/LexicalReordering/LexicalReorderingState.cpp
index 49c769860..445f5f9b1 100644
--- a/moses/FF/LexicalReordering/LexicalReorderingState.cpp
+++ b/moses/FF/LexicalReordering/LexicalReorderingState.cpp
@@ -243,11 +243,12 @@ CopyScores(ScoreComponentCollection* accum,
size_t off_remote = m_offset + reoType;
size_t off_local = m_configuration.CollapseScores() ? m_offset : off_remote;
- UTIL_THROW_IF2(off_remote >= producer->GetNumScoreComponents(),
+ UTIL_THROW_IF2(off_local >= producer->GetNumScoreComponents(),
"offset out of vector bounds!");
// look up applicable score from vectore of scores
if(cached) {
+ UTIL_THROW_IF2(off_remote >= cached->size(), "offset out of vector bounds!");
Scores scores(producer->GetNumScoreComponents(),0);
scores[off_local ] = (*cached)[off_remote];
accum->PlusEquals(producer, scores);