From 27db9d8c05188f64c17d61c394d3dafe8b8e93d8 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sat, 19 Dec 2009 14:32:28 -0500 Subject: cool new alignment feature --- decoder/ff_wordalign.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'decoder/ff_wordalign.h') diff --git a/decoder/ff_wordalign.h b/decoder/ff_wordalign.h index 4a8b59c7..554dd23e 100644 --- a/decoder/ff_wordalign.h +++ b/decoder/ff_wordalign.h @@ -38,6 +38,26 @@ class MarkovJump : public FeatureFunction { std::string template_; }; +typedef std::map Class2FID; +typedef std::map Class2Class2FID; +class SourcePOSBigram : public FeatureFunction { + public: + SourcePOSBigram(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; + private: + void FireFeature(WordID src, + WordID trg, + SparseVector* features) const; + mutable Class2Class2FID fmap_; + std::vector > pos_; +}; + class AlignerResults : public FeatureFunction { public: AlignerResults(const std::string& param); -- cgit v1.2.3