mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-20 07:42:21 +03:00
init m_hypoIndColl
This commit is contained in:
parent
5054aa053f
commit
c6c10ec551
@ -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) {
|
||||
|
@ -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<size_t> &hypoIndColl)
|
||||
{
|
||||
symbolBind = &vSymbolBind;
|
||||
tps = &vTPS;
|
||||
tpInd = 0;
|
||||
m_hyposColl = new (pool.Allocate<HyposColl>()) 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<size_t> &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);
|
||||
|
@ -76,12 +76,14 @@ public:
|
||||
void Init(
|
||||
MemPool &pool,
|
||||
const SymbolBind &symbolBind,
|
||||
const SCFG::TargetPhrases &tps);
|
||||
const SCFG::TargetPhrases &tps,
|
||||
const Vector<size_t> &hypoIndColl);
|
||||
void Init(
|
||||
MemPool &pool,
|
||||
const SymbolBind &symbolBind,
|
||||
const SCFG::TargetPhrases &tps,
|
||||
size_t vTPInd);
|
||||
size_t vTPInd,
|
||||
const Vector<size_t> &hypoIndColl);
|
||||
void AddHypos(const Moses2::Hypotheses &hypos);
|
||||
void CreateHypo(
|
||||
MemPool &systemPool,
|
||||
|
Loading…
Reference in New Issue
Block a user