blob: 2d7155e037aec086a80d5fb5e2a8742ac93d7e21 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#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) {
//create id
long a = 11234567;
TranslationTask task(*m_system, input, a);
std::string translation = task.RunTranslation();
//delete translation;
return translation;
}
}
|