summaryrefslogtreecommitdiff
path: root/src/ff.h
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2009-12-08 21:38:55 -0500
committerChris Dyer <redpony@gmail.com>2009-12-08 21:38:55 -0500
commitdc6930c00b4b276883280cff1ed6dcd9ddef03c7 (patch)
treed76d25baf66459d13da4faedffd7d6faba28a513 /src/ff.h
parent5082307f382a6563d4ffb97034137da4e362e629 (diff)
LICENSE fixes, full support of lattice decoding
Diffstat (limited to 'src/ff.h')
-rw-r--r--src/ff.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ff.h b/src/ff.h
index c97e2fe2..e962b4ba 100644
--- a/src/ff.h
+++ b/src/ff.h
@@ -89,6 +89,21 @@ class WordPenalty : public FeatureFunction {
const double value_;
};
+class SourceWordPenalty : public FeatureFunction {
+ public:
+ SourceWordPenalty(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:
+ const int fid_;
+ const double value_;
+};
+
// this class is a set of FeatureFunctions that can be used to score, rescore,
// etc. a (translation?) forest
class ModelSet {