mosesdecoder/moses/SearchNormal.h

67 lines
1.7 KiB
C
Raw Normal View History

#ifndef moses_SearchNormal_h
#define moses_SearchNormal_h
#include <vector>
#include "Search.h"
#include "HypothesisStackNormal.h"
#include "TranslationOptionCollection.h"
#include "Timer.h"
namespace Moses
{
class Manager;
class TranslationOptionCollection;
/** Functions and variables you need to decoder an input using the
* phrase-based decoder (NO cube-pruning)
2012-06-29 02:29:46 +04:00
* Instantiated by the Manager class
*/
class SearchNormal: public Search
{
protected:
2015-08-08 02:00:45 +03:00
//! stacks to store hypotheses (partial translations)
// no of elements = no of words in source + 1
2015-08-08 02:00:45 +03:00
std::vector < HypothesisStack* > m_hypoStackColl;
/** actual (full expanded) stack of hypotheses*/
2015-08-08 02:00:45 +03:00
HypothesisStackNormal* actual_hypoStack;
/** pre-computed list of translation options for the phrases in this sentence */
2015-08-08 02:00:45 +03:00
const TranslationOptionCollection &m_transOptColl;
// functions for creating hypotheses
virtual bool
ProcessOneStack(HypothesisStack* hstack);
2015-08-08 02:00:45 +03:00
virtual void
ProcessOneHypothesis(const Hypothesis &hypothesis);
2015-08-08 02:00:45 +03:00
virtual void
ExpandAllHypotheses(const Hypothesis &hypothesis, size_t startPos, size_t endPos);
2015-08-08 02:00:45 +03:00
virtual void
ExpandHypothesis(const Hypothesis &hypothesis,
2015-10-06 02:00:40 +03:00
const TranslationOption &transOpt,
float expectedScore,
float estimatedScore,
2015-10-25 16:07:25 +03:00
const Bitmap &bitmap);
public:
2015-12-07 19:07:11 +03:00
SearchNormal(Manager& manager, const TranslationOptionCollection &transOptColl);
~SearchNormal();
2014-12-26 10:41:52 +03:00
void Decode();
void OutputHypoStackSize();
2014-04-03 20:21:31 +04:00
void OutputHypoStack();
virtual const std::vector < HypothesisStack* >& GetHypothesisStacks() const;
virtual const Hypothesis *GetBestHypothesis() const;
};
}
#endif