diff options
author | Chris Dyer <redpony@gmail.com> | 2014-01-13 04:44:53 -0800 |
---|---|---|
committer | Chris Dyer <redpony@gmail.com> | 2014-01-13 04:44:53 -0800 |
commit | 7a9c1c85fecb787b1ee4b8e9552ed35a635e3c39 (patch) | |
tree | a47a7ad4e51fb95a3c98f657b0b82a3e9660c966 /decoder/ff_rules.h | |
parent | a1cf0d10fe44ede32d29be37107884b734d459ae (diff) | |
parent | 757ffb75e9a860ccd10843dcf099787cefec781a (diff) |
Merge pull request #36 from pks/master
RuleWordAlignmentFeatures, minor dtrain changes
Diffstat (limited to 'decoder/ff_rules.h')
-rw-r--r-- | decoder/ff_rules.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/decoder/ff_rules.h b/decoder/ff_rules.h index f210dc65..324d7a39 100644 --- a/decoder/ff_rules.h +++ b/decoder/ff_rules.h @@ -24,6 +24,19 @@ class RuleIdentityFeatures : public FeatureFunction { mutable std::map<const TRule*, int> rule2_fid_; }; +class RuleWordAlignmentFeatures : public FeatureFunction { + public: + RuleWordAlignmentFeatures(const std::string& param); + protected: + virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta, + const HG::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); +}; + class RuleSourceBigramFeatures : public FeatureFunction { public: RuleSourceBigramFeatures(const std::string& param); |