diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-09-29 20:45:48 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-09-29 20:45:48 +0000 |
commit | f412aaab3d10fb82b20a2190f2cb1424959c599a (patch) | |
tree | 1942e2a05777694cc81724f3206c8972813b4224 /decoder/ff_wordalign.h | |
parent | 7f56dd65ee706683444b012d0afcfff3e376bfff (diff) |
another feature, another POS
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@664 ec762483-ff6d-05da-a07a-a48fb63a330f
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 c44ad26b..ebbecfea 100644 --- a/decoder/ff_wordalign.h +++ b/decoder/ff_wordalign.h @@ -78,6 +78,26 @@ class MarkovJumpFClass : public FeatureFunction { typedef std::map<WordID, int> Class2FID; typedef std::map<WordID, Class2FID> Class2Class2FID; +class SourceBigram : public FeatureFunction { + public: + SourceBigram(const std::string& param); + virtual void FinalTraversalFeatures(const void* context, + SparseVector<double>* features) const; + 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_; + mutable Class2FID ufmap_; +}; + class SourcePOSBigram : public FeatureFunction { public: SourcePOSBigram(const std::string& param); |