2011-09-20 19:32:26 +04:00
|
|
|
#ifndef moses_SparsePhraseFeature_h
|
|
|
|
#define moses_SparsePhraseFeature_h
|
|
|
|
|
2012-09-21 14:56:01 +04:00
|
|
|
#include <stdexcept>
|
|
|
|
|
2011-09-20 19:32:26 +04:00
|
|
|
#include "FactorCollection.h"
|
|
|
|
#include "FeatureFunction.h"
|
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Collection of sparse features attached to each phrase pair.
|
|
|
|
**/
|
|
|
|
class SparsePhraseDictionaryFeature : public StatelessFeatureFunction {
|
|
|
|
|
|
|
|
public:
|
2013-01-30 15:37:14 +04:00
|
|
|
SparsePhraseDictionaryFeature(const std::string &line);
|
2011-09-20 19:32:26 +04:00
|
|
|
|
2012-09-19 21:00:53 +04:00
|
|
|
void Evaluate(const PhraseBasedFeatureContext& context,
|
2012-09-07 19:57:53 +04:00
|
|
|
ScoreComponentCollection* accumulator) const;
|
2011-09-20 19:32:26 +04:00
|
|
|
|
2012-04-09 23:47:51 +04:00
|
|
|
void EvaluateChart(
|
2012-09-21 14:56:01 +04:00
|
|
|
const ChartBasedFeatureContext& context,
|
2012-04-09 23:47:51 +04:00
|
|
|
ScoreComponentCollection*) const {
|
2012-09-21 14:56:01 +04:00
|
|
|
throw std::logic_error("SparsePhraseDictionaryFeature not valid in chart decoder");
|
2012-04-09 23:47:51 +04:00
|
|
|
}
|
|
|
|
|
2011-09-20 19:32:26 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|