2010-04-08 21:16:10 +04:00
|
|
|
#include "Manager.h"
|
|
|
|
#include "SearchCubePruning.h"
|
|
|
|
#include "SearchNormal.h"
|
2012-07-02 18:57:54 +04:00
|
|
|
#include "SearchNormalBatch.h"
|
2010-04-08 21:16:10 +04:00
|
|
|
#include "UserMessage.h"
|
2014-01-13 18:37:05 +04:00
|
|
|
#include "util/exception.hh"
|
2010-04-08 21:16:10 +04:00
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
2013-08-07 13:28:28 +04:00
|
|
|
Search::Search(Manager& manager)
|
2013-08-07 17:18:12 +04:00
|
|
|
: m_manager(manager)
|
2013-08-13 23:36:32 +04:00
|
|
|
,m_inputPath()
|
2013-08-07 17:18:12 +04:00
|
|
|
,m_initialTransOpt()
|
2013-08-07 13:28:28 +04:00
|
|
|
{
|
2013-08-13 23:36:32 +04:00
|
|
|
m_initialTransOpt.SetInputPath(m_inputPath);
|
2013-08-07 13:28:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
Search *Search::CreateSearch(Manager& manager, const InputType &source,
|
2010-04-08 21:16:10 +04:00
|
|
|
SearchAlgorithm searchAlgorithm, const TranslationOptionCollection &transOptColl)
|
|
|
|
{
|
2011-02-24 16:14:42 +03:00
|
|
|
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);
|
2011-02-24 16:14:42 +03:00
|
|
|
default:
|
2014-01-15 19:42:02 +04:00
|
|
|
UTIL_THROW2("ERROR: search. Aborting\n");
|
2011-02-24 16:14:42 +03:00
|
|
|
return NULL;
|
|
|
|
}
|
2010-04-08 21:16:10 +04:00
|
|
|
}
|
2011-02-24 16:14:42 +03:00
|
|
|
|
2010-04-08 21:16:10 +04:00
|
|
|
}
|