mosesdecoder/contrib/other-builds/moses2/WordPenalty.cpp
2015-10-29 00:56:50 +00:00

36 lines
679 B
C++

/*
* WordPenalty.cpp
*
* Created on: 28 Oct 2015
* Author: hieu
*/
#include "WordPenalty.h"
#include "TypeDef.h"
#include "Scores.h"
#include "TargetPhrase.h"
#include "Manager.h"
WordPenalty::WordPenalty(size_t startInd, const std::string &line)
:StatelessFeatureFunction(startInd, line)
{
ReadParameters();
}
WordPenalty::~WordPenalty() {
// TODO Auto-generated destructor stub
}
void
WordPenalty::EvaluateInIsolation(const System &system,
const PhraseBase &source,
const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const
{
SCORE score = - (SCORE) targetPhrase.GetSize();
scores.PlusEquals(system, *this, score);
}