mosesdecoder/moses/PhraseLengthFeature.h

36 lines
889 B
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>
#include "FactorCollection.h"
#include "FeatureFunction.h"
#include "FFState.h"
#include "Word.h"
namespace Moses
{
/** Sets the features for length of source phrase, target phrase, both.
*/
class PhraseLengthFeature : public StatelessFeatureFunction {
public:
PhraseLengthFeature(const std::string &line);
2012-09-21 14:56:01 +04:00
void EvaluateChart(const ChartBasedFeatureContext& context,
ScoreComponentCollection*) const {
2012-09-21 14:56:01 +04:00
throw std::logic_error("PhraseLengthFeature not valid in chart decoder");
}
virtual void Evaluate(const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedFutureScore) const;
};
}
#endif // moses_PhraseLengthFeature_h