2016-02-26 16:38:00 +03:00
|
|
|
/*
|
|
|
|
* Manager.h
|
|
|
|
*
|
|
|
|
* Created on: 23 Oct 2015
|
|
|
|
* Author: hieu
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <queue>
|
|
|
|
#include <cstddef>
|
|
|
|
#include <string>
|
|
|
|
#include <deque>
|
|
|
|
#include "Phrase.h"
|
|
|
|
#include "MemPool.h"
|
|
|
|
#include "Recycler.h"
|
|
|
|
#include "EstimatedScores.h"
|
2016-03-31 21:24:50 +03:00
|
|
|
#include "ArcLists.h"
|
2016-02-26 16:38:00 +03:00
|
|
|
#include "legacy/Bitmaps.h"
|
|
|
|
|
|
|
|
namespace Moses2
|
|
|
|
{
|
|
|
|
|
|
|
|
class System;
|
|
|
|
class TranslationTask;
|
|
|
|
class PhraseImpl;
|
|
|
|
class SearchNormal;
|
|
|
|
class Search;
|
2016-04-27 12:36:15 +03:00
|
|
|
class InputType;
|
2016-02-26 16:38:00 +03:00
|
|
|
class OutputCollector;
|
2016-02-29 15:07:11 +03:00
|
|
|
class HypothesisBase;
|
2016-02-26 16:38:00 +03:00
|
|
|
|
|
|
|
class ManagerBase
|
|
|
|
{
|
|
|
|
public:
|
2016-03-31 23:00:16 +03:00
|
|
|
const System &system;
|
|
|
|
const TranslationTask &task;
|
2016-06-23 14:54:43 +03:00
|
|
|
mutable ArcLists arcLists;
|
2016-02-26 16:38:00 +03:00
|
|
|
|
2016-03-31 23:00:16 +03:00
|
|
|
ManagerBase(System &sys, const TranslationTask &task,
|
|
|
|
const std::string &inputStr, long translationId);
|
|
|
|
virtual ~ManagerBase();
|
|
|
|
virtual void Decode() = 0;
|
2016-04-12 13:00:16 +03:00
|
|
|
virtual std::string OutputBest() const = 0;
|
|
|
|
virtual std::string OutputNBest() = 0;
|
2016-08-15 15:21:29 +03:00
|
|
|
virtual std::string OutputTransOpt() = 0;
|
2016-02-26 16:38:00 +03:00
|
|
|
|
2016-03-31 23:00:16 +03:00
|
|
|
MemPool &GetPool() const
|
2016-06-21 17:37:31 +03:00
|
|
|
{ return *m_pool; }
|
2016-02-26 16:38:00 +03:00
|
|
|
|
2016-03-31 23:00:16 +03:00
|
|
|
MemPool &GetSystemPool() const
|
2016-06-21 17:37:31 +03:00
|
|
|
{ return *m_systemPool; }
|
2016-02-26 16:38:00 +03:00
|
|
|
|
2016-03-31 23:00:16 +03:00
|
|
|
Recycler<HypothesisBase*> &GetHypoRecycle() const
|
2016-06-21 17:37:31 +03:00
|
|
|
{ return *m_hypoRecycle; }
|
2016-02-29 15:07:11 +03:00
|
|
|
|
2016-04-27 12:36:15 +03:00
|
|
|
const InputType &GetInput() const
|
2016-06-21 17:37:31 +03:00
|
|
|
{ return *m_input; }
|
2016-02-26 16:38:00 +03:00
|
|
|
|
2016-08-03 11:37:49 +03:00
|
|
|
long GetTranslationId() const
|
|
|
|
{ return m_translationId; }
|
|
|
|
|
2016-02-26 16:38:00 +03:00
|
|
|
protected:
|
2016-03-31 23:00:16 +03:00
|
|
|
std::string m_inputStr;
|
2016-07-30 17:13:18 +03:00
|
|
|
long m_translationId;
|
2016-04-27 12:36:15 +03:00
|
|
|
InputType *m_input;
|
2016-02-26 16:38:00 +03:00
|
|
|
|
2016-03-31 23:00:16 +03:00
|
|
|
mutable MemPool *m_pool, *m_systemPool;
|
|
|
|
mutable Recycler<HypothesisBase*> *m_hypoRecycle;
|
2016-02-26 16:38:00 +03:00
|
|
|
|
2016-03-31 23:00:16 +03:00
|
|
|
void InitPools();
|
2016-02-26 16:38:00 +03:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|