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
commit28d54113b99e87f218e9ac5ea1e0bfeefcfc483b (patch)
treea25720ccfd9d7a3cb86e2b1d63bdf83da67c88ad /decoder/ff_spans.h
parent931a036dc3cf9e1deafc10e78e94a0ebe3c8004f (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