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:
-rw-r--r--moses/BitmapContainer.cpp3
-rw-r--r--moses/Hypothesis.cpp6
-rw-r--r--moses/Hypothesis.h4
-rw-r--r--moses/MockHypothesis.cpp5
-rw-r--r--moses/SearchNormal.cpp4
5 files changed, 11 insertions, 11 deletions
diff --git a/moses/BitmapContainer.cpp b/moses/BitmapContainer.cpp
index 0c75571a3..00e3cb6fb 100644
--- a/moses/BitmapContainer.cpp
+++ b/moses/BitmapContainer.cpp
@@ -211,7 +211,8 @@ Hypothesis *BackwardsEdge::CreateHypothesis(const Hypothesis &hypothesis, const
IFVERBOSE(2) {
hypothesis.GetManager().GetSentenceStats().StartTimeBuildHyp();
}
- Hypothesis *newHypo = new Hypothesis(hypothesis, transOpt);
+ const WordsBitmap &bitmap = m_parent.GetWordsBitmap();
+ Hypothesis *newHypo = new Hypothesis(hypothesis, transOpt, bitmap);
IFVERBOSE(2) {
hypothesis.GetManager().GetSentenceStats().StopTimeBuildHyp();
}
diff --git a/moses/Hypothesis.cpp b/moses/Hypothesis.cpp
index 6776943bb..fcf652b74 100644
--- a/moses/Hypothesis.cpp
+++ b/moses/Hypothesis.cpp
@@ -75,9 +75,9 @@ Hypothesis(Manager& manager, InputType const& source, const TranslationOption &i
* continue prevHypo by appending the phrases in transOpt
*/
Hypothesis::
-Hypothesis(const Hypothesis &prevHypo, const TranslationOption &transOpt)
+Hypothesis(const Hypothesis &prevHypo, const TranslationOption &transOpt, const WordsBitmap &bitmap)
: m_prevHypo(&prevHypo)
- , m_sourceCompleted(prevHypo.m_sourceCompleted )
+ , m_sourceCompleted(bitmap)
, m_sourceInput(prevHypo.m_sourceInput)
, m_currSourceWordsRange(transOpt.GetSourceWordsRange())
, m_currTargetWordsRange(prevHypo.m_currTargetWordsRange.GetEndPos() + 1,
@@ -98,8 +98,6 @@ Hypothesis(const Hypothesis &prevHypo, const TranslationOption &transOpt)
// that this hypothesis has already translated!
assert(!m_sourceCompleted.Overlap(m_currSourceWordsRange));
- //_hash_computed = false;
- m_sourceCompleted.SetValue(m_currSourceWordsRange.GetStartPos(), m_currSourceWordsRange.GetEndPos(), true);
m_wordDeleted = transOpt.IsDeletionOption();
m_manager.GetSentenceStats().AddCreated();
}
diff --git a/moses/Hypothesis.h b/moses/Hypothesis.h
index dc7186a02..df639d251 100644
--- a/moses/Hypothesis.h
+++ b/moses/Hypothesis.h
@@ -72,7 +72,7 @@ class Hypothesis
protected:
const Hypothesis* m_prevHypo; /*! backpointer to previous hypothesis (from which this one was created) */
- WordsBitmap m_sourceCompleted; /*! keeps track of which words have been translated so far */
+ const WordsBitmap &m_sourceCompleted; /*! keeps track of which words have been translated so far */
InputType const& m_sourceInput;
WordsRange m_currSourceWordsRange; /*! source word positions of the last phrase that was used to create this hypothesis */
WordsRange m_currTargetWordsRange; /*! target word positions of the last phrase that was used to create this hypothesis */
@@ -94,7 +94,7 @@ public:
/*! used by initial seeding of the translation process */
Hypothesis(Manager& manager, InputType const& source, const TranslationOption &initialTransOpt, const WordsBitmap &bitmap);
/*! used when creating a new hypothesis using a translation option (phrase translation) */
- Hypothesis(const Hypothesis &prevHypo, const TranslationOption &transOpt);
+ Hypothesis(const Hypothesis &prevHypo, const TranslationOption &transOpt, const WordsBitmap &bitmap);
~Hypothesis();
void PrintHypothesis() const;
diff --git a/moses/MockHypothesis.cpp b/moses/MockHypothesis.cpp
index 4e923e4d3..143acf6e0 100644
--- a/moses/MockHypothesis.cpp
+++ b/moses/MockHypothesis.cpp
@@ -45,8 +45,9 @@ MockHypothesisGuard
m_manager.reset(new Manager(m_ttask));
//Initial empty hypothesis
+ WordsBitmap bitmap(m_sentence.get()->GetSize());
m_manager->ResetSentenceStats(*m_sentence);
- m_hypothesis = new Hypothesis(*m_manager, *m_sentence, m_initialTransOpt);
+ m_hypothesis = new Hypothesis(*m_manager, *m_sentence, m_initialTransOpt, bitmap);
//create the chain
vector<Alignment>::const_iterator ai = alignments.begin();
@@ -59,7 +60,7 @@ MockHypothesisGuard
m_targetPhrases.back().CreateFromString(Input, factors, *ti, NULL);
m_toptions.push_back(new TranslationOption
(wordsRange,m_targetPhrases.back()));
- m_hypothesis = new Hypothesis(*prevHypo, *m_toptions.back());
+ m_hypothesis = new Hypothesis(*prevHypo, *m_toptions.back(), WordsBitmap(44));
}
diff --git a/moses/SearchNormal.cpp b/moses/SearchNormal.cpp
index 69dbe0d56..bd1c95b0c 100644
--- a/moses/SearchNormal.cpp
+++ b/moses/SearchNormal.cpp
@@ -295,7 +295,7 @@ void SearchNormal::ExpandHypothesis(const Hypothesis &hypothesis,
IFVERBOSE(2) {
stats.StartTimeBuildHyp();
}
- newHypo = new Hypothesis(hypothesis, transOpt);
+ newHypo = new Hypothesis(hypothesis, transOpt, WordsBitmap(44));
IFVERBOSE(2) {
stats.StopTimeBuildHyp();
}
@@ -329,7 +329,7 @@ void SearchNormal::ExpandHypothesis(const Hypothesis &hypothesis,
IFVERBOSE(2) {
stats.StartTimeBuildHyp();
}
- newHypo = new Hypothesis(hypothesis, transOpt);
+ newHypo = new Hypothesis(hypothesis, transOpt, WordsBitmap(44));
if (newHypo==NULL) return;
IFVERBOSE(2) {
stats.StopTimeBuildHyp();