mosesdecoder/contrib/other-builds/moses2/SCFG/Stack.h

56 lines
956 B
C
Raw Normal View History

2016-02-29 18:51:17 +03:00
#pragma once
2016-04-17 11:47:04 +03:00
#include <boost/unordered_map.hpp>
#include "../HypothesisColl.h"
#include "../Recycler.h"
#include "Word.h"
2016-02-29 18:51:17 +03:00
namespace Moses2
{
2016-04-17 11:47:04 +03:00
class HypothesisBase;
class ArcLists;
2016-02-29 18:51:17 +03:00
namespace SCFG
{
2016-04-17 11:47:04 +03:00
class Hypothesis;
class Manager;
2016-02-29 18:51:17 +03:00
class Stack
{
public:
2016-04-17 11:47:04 +03:00
typedef boost::unordered_map<SCFG::Word, Moses2::HypothesisColl*> Coll;
Stack(const Manager &mgr);
2016-05-25 23:02:34 +03:00
virtual ~Stack();
2016-04-17 11:47:04 +03:00
Coll &GetColl()
2016-05-01 11:32:49 +03:00
{ return m_coll; }
2016-04-17 11:47:04 +03:00
const Coll &GetColl() const
2016-05-01 11:32:49 +03:00
{ return m_coll; }
const Moses2::HypothesisColl *GetColl(SCFG::Word &nt) const;
2016-04-17 11:47:04 +03:00
2016-04-17 21:33:21 +03:00
size_t GetSize() const;
2016-06-02 01:44:46 +03:00
void Add(SCFG::Hypothesis *hypo, Recycler<HypothesisBase*> &hypoRecycle,
2016-04-17 11:47:04 +03:00
ArcLists &arcLists);
2016-05-06 17:41:50 +03:00
const Hypothesis *GetBestHypo(
const Manager &mgr,
ArcLists &arcLists) const;
2016-06-18 00:54:32 +03:00
std::ostream &Debug(std::ostream &out, const System &system) const;
2016-06-11 00:03:11 +03:00
2016-04-17 11:47:04 +03:00
protected:
const Manager &m_mgr;
Coll m_coll;
Moses2::HypothesisColl &GetMiniStack(const SCFG::Word &key);
2016-02-29 18:51:17 +03:00
};
}
}