diff options
author | Chris Dyer <redpony@gmail.com> | 2009-12-19 14:32:28 -0500 |
---|---|---|
committer | Chris Dyer <redpony@gmail.com> | 2009-12-19 14:32:28 -0500 |
commit | 27db9d8c05188f64c17d61c394d3dafe8b8e93d8 (patch) | |
tree | 688930b6e95b6801ffe7d722f33a4f56712ecd21 /decoder/ff_wordalign.h | |
parent | 39b9c1e0aaec81492d81e541daf7703ba8c517ff (diff) |
cool new alignment feature
Diffstat (limited to 'decoder/ff_wordalign.h')
-rw-r--r-- | decoder/ff_wordalign.h | 20 |
1 files changed, 20 insertions, 0 deletions
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<WordID, int> Class2FID; +typedef std::map<WordID, Class2FID> 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<const void*>& ant_contexts, + SparseVector<double>* features, + SparseVector<double>* estimated_features, + void* context) const; + private: + void FireFeature(WordID src, + WordID trg, + SparseVector<double>* features) const; + mutable Class2Class2FID fmap_; + std::vector<std::vector<WordID> > pos_; +}; + class AlignerResults : public FeatureFunction { public: AlignerResults(const std::string& param); |