Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Search.cpp « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8f947f6220510149b9ff424bfbd7dabdf413a98a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "Manager.h"
#include "SearchCubePruning.h"
#include "SearchNormal.h"
#include "SearchNormalBatch.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 NormalBatch:
    return new SearchNormalBatch(manager, source, transOptColl);
  default:
    UTIL_THROW2("ERROR: search. Aborting\n");
    return NULL;
  }
}

}