2011-03-22 17:33:16 +03:00
|
|
|
#ifndef moses_PhrasePairFeature_h
|
|
|
|
#define moses_PhrasePairFeature_h
|
|
|
|
|
|
|
|
#include "Factor.h"
|
|
|
|
#include "FeatureFunction.h"
|
|
|
|
|
|
|
|
namespace Moses {
|
|
|
|
|
|
|
|
/**
|
2012-03-07 15:48:58 +04:00
|
|
|
* Phrase pair feature: complete source/target phrase pair
|
2011-03-22 17:33:16 +03:00
|
|
|
**/
|
|
|
|
class PhrasePairFeature: public StatelessFeatureFunction {
|
|
|
|
public:
|
|
|
|
PhrasePairFeature(FactorType sourceFactorId, FactorType targetFactorId);
|
|
|
|
|
|
|
|
virtual void Evaluate(
|
|
|
|
const TargetPhrase& cur_hypo,
|
|
|
|
ScoreComponentCollection* accumulator) const;
|
|
|
|
|
|
|
|
//NB: Should really precompute this feature, but don't have
|
|
|
|
//good hooks to do this.
|
|
|
|
virtual bool ComputeValueInTranslationOption() const;
|
|
|
|
|
|
|
|
|
2011-09-20 14:23:38 +04:00
|
|
|
std::string GetScoreProducerWeightShortName(unsigned) const;
|
2011-03-22 17:33:16 +03:00
|
|
|
size_t GetNumInputScores() const;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
FactorType m_sourceFactorId;
|
|
|
|
FactorType m_targetFactorId;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|