mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 04:27:53 +03:00
36 lines
679 B
C++
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);
|
|
}
|
|
|
|
|