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

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/moses2/ManagerBase.cpp')
-rw-r--r--contrib/moses2/ManagerBase.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/contrib/moses2/ManagerBase.cpp b/contrib/moses2/ManagerBase.cpp
new file mode 100644
index 000000000..1e774cc5b
--- /dev/null
+++ b/contrib/moses2/ManagerBase.cpp
@@ -0,0 +1,55 @@
+/*
+ * 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)
+{
+}
+
+ManagerBase::~ManagerBase()
+{
+ system.featureFunctions.CleanUpAfterSentenceProcessing();
+
+ 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();
+}
+
+}
+