2011-08-15 07:40:28 +04:00
|
|
|
#ifndef moses_PhraseLengthFeature_h
|
|
|
|
#define moses_PhraseLengthFeature_h
|
|
|
|
|
2012-09-21 14:56:01 +04:00
|
|
|
#include <stdexcept>
|
2011-08-15 07:40:28 +04:00
|
|
|
#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:
|
2013-01-02 20:54:38 +04:00
|
|
|
PhraseLengthFeature(const std::string &line);
|
2013-05-15 15:20:44 +04:00
|
|
|
|
2012-09-21 14:56:01 +04:00
|
|
|
void EvaluateChart(const ChartBasedFeatureContext& context,
|
2012-09-14 01:08:01 +04:00
|
|
|
ScoreComponentCollection*) const {
|
2012-09-21 14:56:01 +04:00
|
|
|
throw std::logic_error("PhraseLengthFeature not valid in chart decoder");
|
2013-05-24 16:04:39 +04:00
|
|
|
}
|
2012-04-09 23:47:51 +04:00
|
|
|
|
2013-05-02 15:15:26 +04:00
|
|
|
virtual void Evaluate(const TargetPhrase &targetPhrase
|
|
|
|
, ScoreComponentCollection &scoreBreakdown
|
2013-05-02 17:55:26 +04:00
|
|
|
, ScoreComponentCollection &estimatedFutureScore) const;
|
2013-05-02 15:15:26 +04:00
|
|
|
|
2011-08-15 07:40:28 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // moses_PhraseLengthFeature_h
|