mosesdecoder/moses/FF/PhraseLengthFeature.h

42 lines
1.0 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;
}
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 Phrase &source
2013-05-29 21:16:15 +04:00
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedFutureScore) const;
};
}
#endif // moses_PhraseLengthFeature_h