2013-06-25 09:54:23 +04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "StatelessFeatureFunction.h"
|
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
|
|
|
class PhrasePenalty : public StatelessFeatureFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PhrasePenalty(const std::string &line);
|
|
|
|
|
|
|
|
bool IsUseable(const FactorMask &mask) const {
|
2013-06-26 20:19:09 +04:00
|
|
|
return true;
|
2013-06-25 09:54:23 +04:00
|
|
|
}
|
|
|
|
|
2014-07-10 01:35:59 +04:00
|
|
|
virtual void EvaluateInIsolation(const Phrase &source
|
2015-01-14 14:07:42 +03:00
|
|
|
, const TargetPhrase &targetPhrase
|
|
|
|
, ScoreComponentCollection &scoreBreakdown
|
2015-11-04 18:10:45 +03:00
|
|
|
, ScoreComponentCollection &estimatedScores) const;
|
2013-08-30 18:49:00 +04:00
|
|
|
|
2014-07-10 02:41:08 +04:00
|
|
|
void EvaluateWhenApplied(const Hypothesis& hypo,
|
2015-01-14 14:07:42 +03:00
|
|
|
ScoreComponentCollection* accumulator) const {
|
|
|
|
}
|
2014-07-10 02:54:16 +04:00
|
|
|
void EvaluateWhenApplied(const ChartHypothesis &hypo,
|
2015-01-14 14:07:42 +03:00
|
|
|
ScoreComponentCollection* accumulator) const {
|
|
|
|
}
|
2014-11-04 16:13:56 +03:00
|
|
|
void EvaluateWhenApplied(const Syntax::SHyperedge &hyperedge,
|
2015-01-14 14:07:42 +03:00
|
|
|
ScoreComponentCollection* accumulator) const {
|
|
|
|
}
|
2013-08-30 18:49:00 +04:00
|
|
|
|
2014-07-10 02:06:54 +04:00
|
|
|
void EvaluateWithSourceContext(const InputType &input
|
2015-01-14 14:07:42 +03:00
|
|
|
, const InputPath &inputPath
|
|
|
|
, const TargetPhrase &targetPhrase
|
|
|
|
, const StackVec *stackVec
|
|
|
|
, ScoreComponentCollection &scoreBreakdown
|
2015-11-04 18:10:45 +03:00
|
|
|
, ScoreComponentCollection *estimatedScores = NULL) const {
|
2015-01-14 14:07:42 +03:00
|
|
|
}
|
2013-08-30 18:49:00 +04:00
|
|
|
|
2015-01-06 15:56:13 +03:00
|
|
|
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
|
2015-01-14 14:07:42 +03:00
|
|
|
, const TranslationOptionList &translationOptionList) const {
|
|
|
|
}
|
2014-08-05 13:26:42 +04:00
|
|
|
void SetParameter(const std::string& key, const std::string& value);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool m_perPhraseTable;
|
2013-06-25 09:54:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} //namespace
|
|
|
|
|