2010-04-08 21:16:10 +04:00
|
|
|
#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 InputType;
|
|
|
|
class TranslationOptionCollection;
|
|
|
|
|
2012-06-29 02:29:46 +04:00
|
|
|
/** Functions and variables you need to decoder an input using the phrase-based decoder (NO cube-pruning)
|
|
|
|
* Instantiated by the Manager class
|
|
|
|
*/
|
2010-04-08 21:16:10 +04:00
|
|
|
class SearchNormal: public Search
|
|
|
|
{
|
|
|
|
protected:
|
2011-02-24 16:14:42 +03:00
|
|
|
const InputType &m_source;
|
|
|
|
std::vector < HypothesisStack* > m_hypoStackColl; /**< stacks to store hypotheses (partial translations) */
|
|
|
|
// no of elements = no of words in source + 1
|
|
|
|
size_t interrupted_flag; /**< flag indicating that decoder ran out of time (see switch -time-out) */
|
|
|
|
HypothesisStackNormal* actual_hypoStack; /**actual (full expanded) stack of hypotheses*/
|
|
|
|
const TranslationOptionCollection &m_transOptColl; /**< pre-computed list of translation options for the phrases in this sentence */
|
|
|
|
|
|
|
|
// functions for creating hypotheses
|
|
|
|
void ProcessOneHypothesis(const Hypothesis &hypothesis);
|
|
|
|
void ExpandAllHypotheses(const Hypothesis &hypothesis, size_t startPos, size_t endPos);
|
2012-07-02 18:57:54 +04:00
|
|
|
virtual void ExpandHypothesis(const Hypothesis &hypothesis,const TranslationOption &transOpt, float expectedScore);
|
2010-04-08 21:16:10 +04:00
|
|
|
|
|
|
|
public:
|
2011-02-24 16:14:42 +03:00
|
|
|
SearchNormal(Manager& manager, const InputType &source, const TranslationOptionCollection &transOptColl);
|
|
|
|
~SearchNormal();
|
2010-04-08 21:16:10 +04:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
void ProcessSentence();
|
2010-04-08 21:16:10 +04:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
void OutputHypoStackSize();
|
2014-04-03 20:21:31 +04:00
|
|
|
void OutputHypoStack();
|
2010-04-08 21:16:10 +04:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
virtual const std::vector < HypothesisStack* >& GetHypothesisStacks() const;
|
|
|
|
virtual const Hypothesis *GetBestHypothesis() const;
|
2010-04-08 21:16:10 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|