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:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-10-31 15:50:52 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-10-31 15:50:52 +0300
commit324c378f7fc54f02a8ea264915d3eade867ff23d (patch)
tree2bb934fee448845b0524427d437c871e7118ac2c /moses/MockHypothesis.cpp
parentdc8ad899454bd82408c6a371d5f50e497ede0caa (diff)
Options refactoring. Moses crashed in server mode when asked to provide n-best translations with scores.
Diffstat (limited to 'moses/MockHypothesis.cpp')
-rw-r--r--moses/MockHypothesis.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/moses/MockHypothesis.cpp b/moses/MockHypothesis.cpp
index 11c5d0f84..12527aee9 100644
--- a/moses/MockHypothesis.cpp
+++ b/moses/MockHypothesis.cpp
@@ -39,16 +39,19 @@ MockHypothesisGuard
{
BOOST_CHECK_EQUAL(alignments.size(), targetSegments.size());
std::vector<Moses::FactorType> factors(1,0);
- m_sentence.reset(new Sentence(0, sourceSentence, &factors));
+ AllOptions const& opts = StaticData::Instance().options();
+ m_sentence.reset(new Sentence(0, sourceSentence, opts, &factors));
m_ttask = TranslationTask::create(m_sentence);
m_manager.reset(new Manager(m_ttask));
//Initial empty hypothesis
- Bitmaps bitmaps(m_sentence.get()->GetSize(), m_sentence.get()->m_sourceCompleted);
+ Bitmaps bitmaps(m_sentence.get()->GetSize(),
+ m_sentence.get()->m_sourceCompleted);
m_manager->ResetSentenceStats(*m_sentence);
const Bitmap &initBitmap = bitmaps.GetInitialBitmap();
- m_hypothesis = new Hypothesis(*m_manager, *m_sentence, m_initialTransOpt, initBitmap);
+ m_hypothesis = new Hypothesis(*m_manager, *m_sentence, m_initialTransOpt,
+ initBitmap);
//create the chain
vector<Alignment>::const_iterator ai = alignments.begin();
@@ -56,7 +59,8 @@ MockHypothesisGuard
for (; ti != targetSegments.end() && ai != alignments.end(); ++ti,++ai) {
Hypothesis* prevHypo = m_hypothesis;
Range range(ai->first,ai->second);
- const Bitmap &newBitmap = bitmaps.GetBitmap(prevHypo->GetWordsBitmap(), range);
+ const Bitmap &newBitmap = bitmaps.GetBitmap(prevHypo->GetWordsBitmap(),
+ range);
m_targetPhrases.push_back(TargetPhrase(NULL));
// m_targetPhrases.back().CreateFromString(Input, factors, *ti, "|", NULL);