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>2015-10-05 20:28:52 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-10-05 20:28:52 +0300
commitbe7f0c16ded5501c6bb30a5ae02669c959b9d096 (patch)
treee9104ce99f4a83b5e423829d67afed19a3208ca5 /moses/BitmapContainer.cpp
parent67fb5cd5f038ae9ca4f8d5ef349364372de9db5a (diff)
new CalcFutureScore() works with cube pruning
Diffstat (limited to 'moses/BitmapContainer.cpp')
-rw-r--r--moses/BitmapContainer.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/moses/BitmapContainer.cpp b/moses/BitmapContainer.cpp
index 53176f02b..bb8dd7f8a 100644
--- a/moses/BitmapContainer.cpp
+++ b/moses/BitmapContainer.cpp
@@ -110,13 +110,13 @@ public:
BackwardsEdge::BackwardsEdge(const BitmapContainer &prevBitmapContainer
, BitmapContainer &parent
, const TranslationOptionList &translations
- , const SquareMatrix &futureScore,
+ , const SquareMatrix &futureScores,
const InputType& itype)
: m_initialized(false)
, m_prevBitmapContainer(prevBitmapContainer)
, m_parent(parent)
, m_translations(translations)
- , m_futurescore(futureScore)
+ , m_futureScores(futureScores)
, m_seenPosition()
{
@@ -195,6 +195,10 @@ BackwardsEdge::Initialize()
return;
}
+ const WordsBitmap &bm = m_hypotheses[0]->GetWordsBitmap();
+ const WordsRange &newRange = m_translations.Get(0)->GetSourceWordsRange();
+ m_futureScore = m_futureScores.CalcFutureScore2(bm, newRange.GetStartPos(), newRange.GetEndPos());
+
Hypothesis *expanded = CreateHypothesis(*m_hypotheses[0], *m_translations.Get(0));
m_parent.Enqueue(0, 0, expanded, this);
SetSeenPosition(0, 0);
@@ -211,7 +215,7 @@ Hypothesis *BackwardsEdge::CreateHypothesis(const Hypothesis &hypothesis, const
IFVERBOSE(2) {
hypothesis.GetManager().GetSentenceStats().StopTimeBuildHyp();
}
- //newHypo->EvaluateWhenApplied(m_futurescore);
+ newHypo->EvaluateWhenApplied(m_futureScore);
return newHypo;
}