mosesdecoder/moses/Search.cpp

39 lines
909 B
C++
Raw Normal View History

#include "Manager.h"
#include "SearchCubePruning.h"
#include "SearchNormal.h"
2012-07-02 18:57:54 +04:00
#include "SearchNormalBatch.h"
#include "UserMessage.h"
2014-01-13 18:37:05 +04:00
#include "util/exception.hh"
namespace Moses
{
Search::Search(Manager& manager)
2013-08-07 17:18:12 +04:00
: m_manager(manager)
,m_inputPath()
2013-08-07 17:18:12 +04:00
,m_initialTransOpt()
{
m_initialTransOpt.SetInputPath(m_inputPath);
}
Search *Search::CreateSearch(Manager& manager, const InputType &source,
SearchAlgorithm searchAlgorithm, const TranslationOptionCollection &transOptColl)
{
switch(searchAlgorithm) {
case Normal:
return new SearchNormal(manager,source, transOptColl);
case CubePruning:
return new SearchCubePruning(manager, source, transOptColl);
case CubeGrowing:
return NULL;
2012-07-02 18:57:54 +04:00
case NormalBatch:
return new SearchNormalBatch(manager, source, transOptColl);
default:
2014-01-15 19:42:02 +04:00
UTIL_THROW2("ERROR: search. Aborting\n");
return NULL;
}
}
}