mosesdecoder/moses/FF/PhraseLengthFeature.h

56 lines
1.7 KiB
C
Raw Normal View History

#ifndef moses_PhraseLengthFeature_h
#define moses_PhraseLengthFeature_h
2012-09-21 14:56:01 +04:00
#include <stdexcept>
#include <string>
#include <map>
2013-05-24 22:11:15 +04:00
#include "StatelessFeatureFunction.h"
2013-05-24 21:02:49 +04:00
#include "moses/FF/FFState.h"
#include "moses/Word.h"
#include "moses/FactorCollection.h"
namespace Moses
{
/** Sets the features for length of source phrase, target phrase, both.
*/
2013-05-29 21:16:15 +04:00
class PhraseLengthFeature : public StatelessFeatureFunction
{
public:
PhraseLengthFeature(const std::string &line);
2013-05-30 15:51:40 +04:00
bool IsUseable(const FactorMask &mask) const {
return true;
}
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*) 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 {
}
virtual void EvaluateInIsolation(const Phrase &source
2015-01-14 14:07:42 +03:00
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedFutureScore) const;
};
}
#endif // moses_PhraseLengthFeature_h