diff --git a/contrib/moses2/SCFG/Manager.cpp b/contrib/moses2/SCFG/Manager.cpp index d19d10c14..cefa28d1a 100644 --- a/contrib/moses2/SCFG/Manager.cpp +++ b/contrib/moses2/SCFG/Manager.cpp @@ -237,7 +237,7 @@ void Manager::CreateQueue( assert(unseen); QueueItem *item = QueueItem::Create(GetPool(), *this); - item->Init(GetPool(), symbolBind, tps); + item->Init(GetPool(), symbolBind, tps, seenItem->hypoIndColl); for (size_t i = 0; i < symbolBind.coll.size(); ++i) { const SymbolBindElement &ele = symbolBind.coll[i]; if (ele.hypos) { diff --git a/contrib/moses2/SCFG/Misc.cpp b/contrib/moses2/SCFG/Misc.cpp index eb13dbbc8..1ab053b60 100644 --- a/contrib/moses2/SCFG/Misc.cpp +++ b/contrib/moses2/SCFG/Misc.cpp @@ -125,24 +125,28 @@ QueueItem::QueueItem(MemPool &pool) void QueueItem::Init( MemPool &pool, const SymbolBind &vSymbolBind, - const SCFG::TargetPhrases &vTPS) + const SCFG::TargetPhrases &vTPS, + const Vector &hypoIndColl) { symbolBind = &vSymbolBind; tps = &vTPS; tpInd = 0; m_hyposColl = new (pool.Allocate()) HyposColl(pool); + m_hypoIndColl = &hypoIndColl; } void QueueItem::Init( MemPool &pool, const SymbolBind &vSymbolBind, const SCFG::TargetPhrases &vTPS, - size_t vTPInd) + size_t vTPInd, + const Vector &hypoIndColl) { symbolBind = &vSymbolBind; tps = &vTPS; tpInd = vTPInd; m_hyposColl = NULL; + m_hypoIndColl = &hypoIndColl; } void QueueItem::AddHypos(const Moses2::Hypotheses &hypos) @@ -180,9 +184,8 @@ void QueueItem::CreateNext( if (unseen) { QueueItem *item = QueueItem::Create(mgrPool, mgr); - item->Init(mgrPool, *symbolBind, *tps, tpInd + 1); + item->Init(mgrPool, *symbolBind, *tps, tpInd + 1, *m_hypoIndColl); item->m_hyposColl = m_hyposColl; - item->m_hypoIndColl = m_hypoIndColl; item->CreateHypo(systemPool, mgr, path, *symbolBind); queue.push(item); @@ -202,10 +205,9 @@ void QueueItem::CreateNext( if (unseen) { QueueItem *item = QueueItem::Create(mgrPool, mgr); - item->Init(mgrPool, *symbolBind, *tps, tpInd); + item->Init(mgrPool, *symbolBind, *tps, tpInd, seenItem->hypoIndColl); item->m_hyposColl = m_hyposColl; - item->m_hypoIndColl = &seenItem->hypoIndColl; item->CreateHypo(systemPool, mgr, path, *symbolBind); queue.push(item); diff --git a/contrib/moses2/SCFG/Misc.h b/contrib/moses2/SCFG/Misc.h index 1fe5fffde..a598b6e38 100644 --- a/contrib/moses2/SCFG/Misc.h +++ b/contrib/moses2/SCFG/Misc.h @@ -76,12 +76,14 @@ public: void Init( MemPool &pool, const SymbolBind &symbolBind, - const SCFG::TargetPhrases &tps); + const SCFG::TargetPhrases &tps, + const Vector &hypoIndColl); void Init( MemPool &pool, const SymbolBind &symbolBind, const SCFG::TargetPhrases &tps, - size_t vTPInd); + size_t vTPInd, + const Vector &hypoIndColl); void AddHypos(const Moses2::Hypotheses &hypos); void CreateHypo( MemPool &systemPool,