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

Moses2Wrapper.cpp « moses2 - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f919457d5a8a9e80a6fa6b27bfb15f4e3ec361c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "Moses2Wrapper.h"
#include "System.h"
#include "legacy/Parameter.h"
#include "TranslationTask.h"
using namespace std;
namespace Moses2 {
	Moses2Wrapper::Moses2Wrapper(const std::string &filePath) {
		m_param = new Parameter();
		m_param->LoadParam(filePath);
		m_system = new System(*m_param);
	}
	std::string Moses2Wrapper::Translate(const std::string &input , long id) {
		TranslationTask task(*m_system, input, id);
		std::string  translation = task.ReturnTranslation();
		//delete translation;
		return translation;
	}
}