2010-02-24 14:15:44 +03:00
|
|
|
#ifndef moses_Search_h
|
|
|
|
#define moses_Search_h
|
2008-06-11 14:52:57 +04:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include "TypeDef.h"
|
2008-06-19 03:14:09 +04:00
|
|
|
#include "Phrase.h"
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2008-10-09 03:51:26 +04:00
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
2008-06-11 14:52:57 +04:00
|
|
|
class HypothesisStack;
|
|
|
|
class Hypothesis;
|
|
|
|
class InputType;
|
|
|
|
class TranslationOptionCollection;
|
2009-08-07 20:47:54 +04:00
|
|
|
class Manager;
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2012-06-29 02:29:46 +04:00
|
|
|
/** Abstract class used in the phrase-based decoder.
|
|
|
|
* Cube pruning and normal searches are the classes that inherits from this class
|
|
|
|
*/
|
2008-06-11 14:52:57 +04:00
|
|
|
class Search
|
|
|
|
{
|
|
|
|
public:
|
2011-02-24 16:14:42 +03:00
|
|
|
virtual const std::vector < HypothesisStack* >& GetHypothesisStacks() const = 0;
|
|
|
|
virtual const Hypothesis *GetBestHypothesis() const = 0;
|
|
|
|
virtual void ProcessSentence() = 0;
|
2009-08-07 20:47:54 +04:00
|
|
|
Search(Manager& manager) : m_manager(manager) {}
|
2011-02-24 16:14:42 +03:00
|
|
|
virtual ~Search()
|
|
|
|
{}
|
2008-06-11 14:52:57 +04:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
// Factory
|
|
|
|
static Search *CreateSearch(Manager& manager, const InputType &source, SearchAlgorithm searchAlgorithm,
|
2009-08-07 20:47:54 +04:00
|
|
|
const TranslationOptionCollection &transOptColl);
|
2008-06-19 03:14:09 +04:00
|
|
|
|
|
|
|
protected:
|
2011-02-24 16:14:42 +03:00
|
|
|
|
|
|
|
const Phrase *m_constraint;
|
2009-08-07 20:47:54 +04:00
|
|
|
Manager& m_manager;
|
2008-06-19 03:14:09 +04:00
|
|
|
|
2008-06-11 14:52:57 +04:00
|
|
|
};
|
|
|
|
|
2008-10-09 03:51:26 +04:00
|
|
|
|
|
|
|
}
|
2010-02-24 14:15:44 +03:00
|
|
|
#endif
|