blob: ad38e70784b209e90815e4dcf3c314559ddbb3d6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#ifndef moses_SparsePhraseFeature_h
#define moses_SparsePhraseFeature_h
#include "FactorCollection.h"
#include "FeatureFunction.h"
namespace Moses
{
/**
* Collection of sparse features attached to each phrase pair.
**/
class SparsePhraseDictionaryFeature : public StatelessFeatureFunction {
public:
SparsePhraseDictionaryFeature():
StatelessFeatureFunction("stm", ScoreProducer::unlimited) {}
void Evaluate(const TargetPhrase& cur_phrase,
ScoreComponentCollection* accumulator) const;
void EvaluateChart(
const ChartHypothesis&,
int /* featureID */,
ScoreComponentCollection*) const {
CHECK(0); // feature function not valid in chart decoder
}
// basic properties
std::string GetScoreProducerWeightShortName(unsigned) const { return "stm"; }
size_t GetNumInputScores() const { return 0; }
};
}
#endif
|