summaryrefslogtreecommitdiff
path: root/decoder/ff_rules.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/ff_rules.h')
-rw-r--r--decoder/ff_rules.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/decoder/ff_rules.h b/decoder/ff_rules.h
index 48d8bd05..08b168b0 100644
--- a/decoder/ff_rules.h
+++ b/decoder/ff_rules.h
@@ -22,9 +22,24 @@ class RuleIdentityFeatures : public FeatureFunction {
mutable std::map<const TRule*, int> rule2_fid_;
};
-class RuleNgramFeatures : public FeatureFunction {
+class RuleSourceBigramFeatures : public FeatureFunction {
public:
- RuleNgramFeatures(const std::string& param);
+ RuleSourceBigramFeatures(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;
+ virtual void PrepareForInput(const SentenceMetadata& smeta);
+ private:
+ mutable std::map<const TRule*, SparseVector<double> > rule2_feats_;
+};
+
+class RuleTargetBigramFeatures : public FeatureFunction {
+ public:
+ RuleTargetBigramFeatures(const std::string& param);
protected:
virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta,
const Hypergraph::Edge& edge,