mosesdecoder/moses/Search.cpp

39 lines
902 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"
namespace Moses
{
Search::Search(Manager& manager)
: m_manager(manager)
,m_sourcePhrase(0)
,m_initialTransOpt()
{
m_initialTransOpt.SetSourcePhrase(m_sourcePhrase);
}
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:
UserMessage::Add("ERROR: search. Aborting\n");
abort();
return NULL;
}
}
}