mosesdecoder/contrib/moses2/SCFG/Stack.h

51 lines
843 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
const Coll &GetColl() const
2016-05-01 11:32:49 +03:00
{ return m_coll; }
2016-08-22 15:03:45 +03:00
const Moses2::HypothesisColl *GetColl(const 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-08-06 10:16:31 +03:00
const Hypothesis *GetBestHypo() const;
2016-05-06 17:41:50 +03:00
2016-06-20 16:59:31 +03:00
std::string Debug(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;
2016-08-18 21:03:43 +03:00
Moses2::HypothesisColl &GetColl(const SCFG::Word &nt);
2016-02-29 18:51:17 +03:00
};
}
}