diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-02-02 21:09:50 -0500 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-02-02 21:09:50 -0500 |
commit | 28d54113b99e87f218e9ac5ea1e0bfeefcfc483b (patch) | |
tree | a25720ccfd9d7a3cb86e2b1d63bdf83da67c88ad /decoder/ff_spans.h | |
parent | 931a036dc3cf9e1deafc10e78e94a0ebe3c8004f (diff) |
first span features
Diffstat (limited to 'decoder/ff_spans.h')
-rw-r--r-- | decoder/ff_spans.h | 26 |
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 |