summaryrefslogtreecommitdiff
path: root/decoder/ff_spans.h
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-02-02 21:09:50 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2011-02-02 21:09:50 -0500
commit7a00195194e8c71a7a1025b9f9786ca8452610c0 (patch)
treea8020385d9564124ebaa131d89778f0e714277f3 /decoder/ff_spans.h
parentc4ade3091b812ca135ae6520fa7173e1bbf28754 (diff)
first span features
Diffstat (limited to 'decoder/ff_spans.h')
-rw-r--r--decoder/ff_spans.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/decoder/ff_spans.h b/decoder/ff_spans.h
new file mode 100644
index 00000000..588956c9
--- /dev/null
+++ b/decoder/ff_spans.h
@@ -0,0 +1,26 @@
+#ifndef _FF_SPANS_H_
+#define _FF_SPANS_H_
+
+#include <vector>
+#include "ff.h"
+#include "array2d.h"
+
+class SpanFeatures : public FeatureFunction {
+ public:
+ SpanFeatures(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:
+ const int kS;
+ const int kX;
+ Array2D<int> span_feats_;
+ std::vector<int> end_span_ids_;
+};
+
+#endif