Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SearchNormal.h « src « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8b4f904d97240b93902106310d0060547401846a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#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;

class SearchNormal: public Search
{
protected:
  const InputType &m_source;
  std::vector < HypothesisStack* > m_hypoStackColl; /**< stacks to store hypotheses (partial translations) */
  // no of elements = no of words in source + 1
  TargetPhrase m_initialTargetPhrase; /**< used to seed 1st hypo */
  clock_t m_start; /**< starting time, used for logging */
  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);
  void ExpandHypothesis(const Hypothesis &hypothesis,const TranslationOption &transOpt, float expectedScore);

public:
  SearchNormal(Manager& manager, const InputType &source, const TranslationOptionCollection &transOptColl);
  ~SearchNormal();

  void ProcessSentence();

  void OutputHypoStackSize();
  void OutputHypoStack(int stack);

  virtual const std::vector < HypothesisStack* >& GetHypothesisStacks() const;
  virtual const Hypothesis *GetBestHypothesis() const;
};

}

#endif