mosesdecoder/moses/FF/ExampleTranslationOptionListFeature.h

68 lines
2.0 KiB
C
Raw Normal View History

#pragma once
#include <string>
#include "StatelessFeatureFunction.h"
namespace Moses
{
2017-04-26 15:16:58 +03:00
class ExampleTranslationOptionListFeature : public StatelessFeatureFunction
{
public:
2017-04-26 15:16:58 +03:00
ExampleTranslationOptionListFeature(const std::string &line)
2015-01-14 14:07:42 +03:00
:StatelessFeatureFunction(1, line) {
ReadParameters();
}
bool IsUseable(const FactorMask &mask) const {
return true;
}
void EvaluateInIsolation(const Phrase &source
2015-01-14 14:07:42 +03:00
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedFutureScore) const {
}
void EvaluateWithSourceContext(const InputType &input
2015-01-14 14:07:42 +03:00
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
2015-01-14 14:07:42 +03:00
, const TranslationOptionList &translationOptionList) const {
2015-08-10 13:03:31 +03:00
std::vector<float> newScores(m_numScoreComponents);
newScores[0] = translationOptionList.size();
2015-01-14 14:07:42 +03:00
TranslationOptionList::const_iterator iterTransOpt;
for(iterTransOpt = translationOptionList.begin() ;
iterTransOpt != translationOptionList.end() ; ++iterTransOpt) {
TranslationOption &transOpt = **iterTransOpt;
2015-01-14 14:07:42 +03:00
ScoreComponentCollection &scoreBreakDown = transOpt.GetScoreBreakdown();
scoreBreakDown.PlusEquals(this, newScores);
2015-01-14 14:07:42 +03:00
transOpt.UpdateScore();
}
}
void EvaluateWhenApplied(const Hypothesis& hypo,
2015-01-14 14:07:42 +03:00
ScoreComponentCollection* accumulator) const {
}
void EvaluateWhenApplied(const ChartHypothesis &hypo,
2015-01-14 14:07:42 +03:00
ScoreComponentCollection* accumulator) const {
}
2015-01-14 14:07:42 +03:00
void SetParameter(const std::string& key, const std::string& value) {
}
};
}