From 28d54113b99e87f218e9ac5ea1e0bfeefcfc483b Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Wed, 2 Feb 2011 21:09:50 -0500 Subject: first span features --- decoder/ff_spans.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 decoder/ff_spans.h (limited to 'decoder/ff_spans.h') 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 +#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& ant_contexts, + SparseVector* features, + SparseVector* estimated_features, + void* context) const; + virtual void PrepareForInput(const SentenceMetadata& smeta); + private: + const int kS; + const int kX; + Array2D span_feats_; + std::vector end_span_ids_; +}; + +#endif -- cgit v1.2.3