summaryrefslogtreecommitdiff
path: root/decoder/ff_spans.h
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-06-01 01:26:55 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2011-06-01 01:26:55 -0400
commit9406dbc81fc1009fc3ab46191f535ec3d5a19d87 (patch)
treed9490f9cceb09be83cc5a52cdf51c71791f28407 /decoder/ff_spans.h
parent6cf3114eda70c79ffe455d7b497b580379d9b3e2 (diff)
rule bigram features
Diffstat (limited to 'decoder/ff_spans.h')
-rw-r--r--decoder/ff_spans.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/decoder/ff_spans.h b/decoder/ff_spans.h
index 24e0dede..b22c4d03 100644
--- a/decoder/ff_spans.h
+++ b/decoder/ff_spans.h
@@ -44,6 +44,21 @@ class SpanFeatures : public FeatureFunction {
WordID oov_;
};
+class RuleNgramFeatures : public FeatureFunction {
+ public:
+ RuleNgramFeatures(const std::string& param);
+ protected:
+ virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta,
+ const Hypergraph::Edge& edge,
+ const std::vector<const void*>& ant_contexts,
+ SparseVector<double>* features,
+ SparseVector<double>* estimated_features,
+ void* context) const;
+ virtual void PrepareForInput(const SentenceMetadata& smeta);
+ private:
+ mutable std::map<const TRule*, SparseVector<double> > rule2_feats_;
+};
+
class CMR2008ReorderingFeatures : public FeatureFunction {
public:
CMR2008ReorderingFeatures(const std::string& param);