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

ManagerBase.cpp « moses2 - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 41d3a039468fa34be41d26a0baa948dc3c7e8d9b (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 * Manager.cpp
 *
 *  Created on: 23 Oct 2015
 *      Author: hieu
 */
#include <boost/foreach.hpp>
#include <vector>
#include <sstream>
#include "System.h"
#include "ManagerBase.h"
#include "Phrase.h"
#include "InputPathsBase.h"
#include "InputPathBase.h"
#include "TranslationModel/PhraseTable.h"
#include "legacy/Range.h"
#include "PhraseBased/Sentence.h"

using namespace std;

namespace Moses2
{
ManagerBase::ManagerBase(System &sys, const TranslationTask &task,
                         const std::string &inputStr, long translationId)
  :system(sys)
  ,task(task)
  ,m_inputStr(inputStr)
  ,m_translationId(translationId)
  ,m_pool(NULL)
  ,m_systemPool(NULL)
  ,m_hypoRecycle(NULL)
  ,m_input(NULL)
{
}

ManagerBase::~ManagerBase()
{
  system.featureFunctions.CleanUpAfterSentenceProcessing(*m_input);

  if (m_pool) {
    GetPool().Reset();
  }
  if (m_hypoRecycle) {
    GetHypoRecycle().Clear();
  }
}

void ManagerBase::InitPools()
{
  m_pool = &system.GetManagerPool();
  m_systemPool = &system.GetSystemPool();
  m_hypoRecycle = &system.GetHypoRecycler();
}

}