mosesdecoder/moses/src/PhraseLengthFeature.h

34 lines
773 B
C
Raw Normal View History

#ifndef moses_PhraseLengthFeature_h
#define moses_PhraseLengthFeature_h
#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():
StatelessFeatureFunction("pl", ScoreProducer::unlimited)
{}
void Evaluate(const TargetPhrase& cur_phrase,
ScoreComponentCollection* accumulator) const;
// basic properties
std::string GetScoreProducerWeightShortName(unsigned) const { return "pl"; }
size_t GetNumInputScores() const { return 0; }
};
}
#endif // moses_PhraseLengthFeature_h