mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
39 lines
906 B
C++
39 lines
906 B
C++
#include "Manager.h"
|
|
#include "SearchCubePruning.h"
|
|
#include "SearchNormal.h"
|
|
#include "SearchNormalBatch.h"
|
|
#include "UserMessage.h"
|
|
#include "util/exception.hh"
|
|
|
|
namespace Moses
|
|
{
|
|
|
|
Search::Search(Manager& manager)
|
|
: m_manager(manager)
|
|
,m_inputPath()
|
|
,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;
|
|
case NormalBatch:
|
|
return new SearchNormalBatch(manager, source, transOptColl);
|
|
default:
|
|
UTIL_THROW2("ERROR: search. Aborting\n");
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
}
|