mosesdecoder/moses/FF/WordPenaltyProducer.cpp

26 lines
692 B
C++
Raw Normal View History

#include "WordPenaltyProducer.h"
#include "moses/TargetPhrase.h"
#include "moses/ScoreComponentCollection.h"
using namespace std;
namespace Moses
{
WordPenaltyProducer::WordPenaltyProducer(const std::string &line)
2013-06-26 20:19:09 +04:00
: StatelessFeatureFunction("WordPenalty",1, line)
{
ReadParameters();
}
void WordPenaltyProducer::Evaluate(const Phrase &source
2013-05-29 21:16:15 +04:00
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedFutureScore) const
{
float score = - (float) targetPhrase.GetNumTerminals();
scoreBreakdown.Assign(this, score);
}
}