|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __linux |
|
#include <pthread.h> |
|
#endif |
|
#include <stdio.h> |
|
#include <stdlib.h> |
|
#include <errno.h> |
|
|
|
#include <boost/foreach.hpp> |
|
#include "StatefulFeatureFunction.h" |
|
#include "../PhraseBased/Hypothesis.h" |
|
|
|
using namespace std; |
|
|
|
namespace Moses2 |
|
{ |
|
|
|
StatefulFeatureFunction::StatefulFeatureFunction(size_t startInd, |
|
const std::string &line) : |
|
FeatureFunction(startInd, line) |
|
{ |
|
} |
|
|
|
StatefulFeatureFunction::~StatefulFeatureFunction() |
|
{ |
|
|
|
} |
|
|
|
void StatefulFeatureFunction::EvaluateWhenAppliedBatch( |
|
const System &system, |
|
const Batch &batch) const |
|
{ |
|
|
|
#ifdef __linux |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
for (size_t i = 0; i < batch.size(); ++i) { |
|
Hypothesis *hypo = batch[i]; |
|
hypo->EvaluateWhenApplied(*this); |
|
} |
|
|
|
#ifdef __linux |
|
|
|
#endif |
|
} |
|
|
|
} |
|
|
|
|