From ee4383b3bc67e2d8ce113fce716050dc2e1b8572 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Wed, 27 Jan 2010 12:34:28 +0000 Subject: add binary model2-like features --- decoder/ff_wordalign.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'decoder/ff_wordalign.h') diff --git a/decoder/ff_wordalign.h b/decoder/ff_wordalign.h index aea4c950..582e8c9f 100644 --- a/decoder/ff_wordalign.h +++ b/decoder/ff_wordalign.h @@ -4,6 +4,8 @@ #include "ff.h" #include "array2d.h" +#include + class RelativeSentencePosition : public FeatureFunction { public: RelativeSentencePosition(const std::string& param); @@ -20,6 +22,20 @@ class RelativeSentencePosition : public FeatureFunction { std::string template_; }; +class Model2BinaryFeatures : public FeatureFunction { + public: + Model2BinaryFeatures(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* out_context) const; + private: + boost::multi_array fids_; +}; + class MarkovJump : public FeatureFunction { public: MarkovJump(const std::string& param); -- cgit v1.2.3