diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2013-04-30 11:20:08 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2013-04-30 11:20:08 +0400 |
commit | b10734080067fd5b303251534677d966115d1053 (patch) | |
tree | 266df680ba8b99dd381db4ba64e0255386a02522 /moses/Search.h | |
parent | 4650e303802749b86489ea9c96cd57483f6f96f9 (diff) |
Add explicit to the Search constructor; fix the comments.
Diffstat (limited to 'moses/Search.h')
-rw-r--r-- | moses/Search.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/moses/Search.h b/moses/Search.h index d961d17cd..ed1775fe4 100644 --- a/moses/Search.h +++ b/moses/Search.h @@ -3,7 +3,6 @@ #include <vector> #include "TypeDef.h" -#include "Phrase.h" namespace Moses { @@ -13,31 +12,34 @@ class Hypothesis; class InputType; class TranslationOptionCollection; class Manager; +class Phrase; -/** Abstract class used in the phrase-based decoder. - * Cube pruning and normal searches are the classes that inherits from this class +/** Base search class used in the phrase-based decoder. + * + * Actual search class that implement the cube pruning algorithm (SearchCubePruning) + * or standard beam search (SearchNormal) should inherits from this class, and + * override pure virtual functions. */ class Search { public: - virtual const std::vector < HypothesisStack* >& GetHypothesisStacks() const = 0; + virtual const std::vector<HypothesisStack*>& GetHypothesisStacks() const = 0; virtual const Hypothesis *GetBestHypothesis() const = 0; + + //! Decode the sentence according to the specified search algorithm. virtual void ProcessSentence() = 0; - Search(Manager& manager) : m_manager(manager) {} - virtual ~Search() - {} - // Factory + explicit Search(Manager& manager) : m_manager(manager) {} + virtual ~Search() {} + + // Factory method static Search *CreateSearch(Manager& manager, const InputType &source, SearchAlgorithm searchAlgorithm, const TranslationOptionCollection &transOptColl); protected: - const Phrase *m_constraint; Manager& m_manager; - }; - } #endif |