2014-04-06 19:57:54 +04:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "StatelessFeatureFunction.h"
|
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
2014-04-11 00:34:34 +04:00
|
|
|
// the only thing this FF does is set TargetPhrase::m_ruleSource so that other FF can use it in Evaluate(Search).
|
2014-04-06 19:57:54 +04:00
|
|
|
class SetSourcePhrase : public StatelessFeatureFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SetSourcePhrase(const std::string &line);
|
|
|
|
|
2015-01-14 14:07:42 +03:00
|
|
|
virtual bool IsUseable(const FactorMask &mask) const {
|
|
|
|
return true;
|
|
|
|
}
|
2014-04-06 19:57:54 +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;
|
2014-04-06 19:57:54 +04:00
|
|
|
|
2014-07-10 02:06:54 +04:00
|
|
|
virtual 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
|
|
|
}
|
|
|
|
|
|
|
|
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
|
|
|
|
, const TranslationOptionList &translationOptionList) const {
|
|
|
|
}
|
2014-04-06 19:57:54 +04:00
|
|
|
|
2014-07-10 02:41:08 +04:00
|
|
|
virtual void EvaluateWhenApplied(const Hypothesis& hypo,
|
2015-01-14 14:07:42 +03:00
|
|
|
ScoreComponentCollection* accumulator) const {
|
|
|
|
}
|
2014-04-06 19:57:54 +04:00
|
|
|
|
2014-07-10 02:54:16 +04:00
|
|
|
virtual void EvaluateWhenApplied(const ChartHypothesis &hypo,
|
2015-01-14 14:07:42 +03:00
|
|
|
ScoreComponentCollection* accumulator) const {
|
|
|
|
}
|
2014-04-06 19:57:54 +04:00
|
|
|
|
2015-01-14 14:07:42 +03:00
|
|
|
std::vector<float> DefaultWeights() const {
|
|
|
|
return std::vector<float>();
|
|
|
|
}
|
2014-04-07 15:00:13 +04:00
|
|
|
|
2014-04-06 19:57:54 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|