mosesdecoder/moses/FF/SetSourcePhrase.h

45 lines
1.3 KiB
C
Raw Normal View History

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);
virtual bool IsUseable(const FactorMask &mask) const
{ return true; }
virtual void EvaluateInIsolation(const Phrase &source
2014-04-06 19:57:54 +04:00
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedFutureScore) const;
virtual void EvaluateWithSourceContext(const InputType &input
2014-04-06 19:57:54 +04:00
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
2014-04-06 19:57:54 +04:00
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
virtual void EvaluateWhenApplied(const Hypothesis& hypo,
2014-04-06 19:57:54 +04:00
ScoreComponentCollection* accumulator) const
{}
virtual void EvaluateWhenApplied(const ChartHypothesis &hypo,
2014-04-06 19:57:54 +04:00
ScoreComponentCollection* accumulator) const
{}
std::vector<float> DefaultWeights() const
{ return std::vector<float>(); }
2014-04-06 19:57:54 +04:00
};
}