diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-06-25 09:54:23 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-06-25 09:54:23 +0400 |
commit | e15a4fc882952be13efcdecc8284d19560229785 (patch) | |
tree | c9a47f01537fb245942cf254d780d885c5108386 /moses/FF/PhrasePenalty.cpp | |
parent | ea0c7b63e7900fa486870c2c22123ee6e96976f5 (diff) |
add phrase penalty feature function
Diffstat (limited to 'moses/FF/PhrasePenalty.cpp')
-rw-r--r-- | moses/FF/PhrasePenalty.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/moses/FF/PhrasePenalty.cpp b/moses/FF/PhrasePenalty.cpp new file mode 100644 index 000000000..ac1aa47b8 --- /dev/null +++ b/moses/FF/PhrasePenalty.cpp @@ -0,0 +1,21 @@ + +#include "PhrasePenalty.h" +#include "moses/ScoreComponentCollection.h" + +namespace Moses +{ +PhrasePenalty::PhrasePenalty(const std::string &line) +: StatelessFeatureFunction("PhrasePenalty",1, line) { + ReadParameters(); +} + +void PhrasePenalty::Evaluate(const Phrase &source + , const TargetPhrase &targetPhrase + , ScoreComponentCollection &scoreBreakdown + , ScoreComponentCollection &estimatedFutureScore) const +{ + scoreBreakdown.Assign(this, 1.0f); +} + +} // namespace + |