mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-29 06:52:34 +03:00
26 lines
692 B
C++
26 lines
692 B
C++
#include "WordPenaltyProducer.h"
|
|
#include "moses/TargetPhrase.h"
|
|
#include "moses/ScoreComponentCollection.h"
|
|
|
|
using namespace std;
|
|
|
|
namespace Moses
|
|
{
|
|
WordPenaltyProducer::WordPenaltyProducer(const std::string &line)
|
|
: StatelessFeatureFunction("WordPenalty",1, line)
|
|
{
|
|
ReadParameters();
|
|
}
|
|
|
|
void WordPenaltyProducer::Evaluate(const Phrase &source
|
|
, const TargetPhrase &targetPhrase
|
|
, ScoreComponentCollection &scoreBreakdown
|
|
, ScoreComponentCollection &estimatedFutureScore) const
|
|
{
|
|
float score = - (float) targetPhrase.GetNumTerminals();
|
|
scoreBreakdown.Assign(this, score);
|
|
}
|
|
|
|
}
|
|
|