Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2013-06-25 09:54:23 +0400
committerHieu Hoang <hieuhoang@gmail.com>2013-06-25 09:54:23 +0400
commite15a4fc882952be13efcdecc8284d19560229785 (patch)
treec9a47f01537fb245942cf254d780d885c5108386 /moses/FF/PhrasePenalty.cpp
parentea0c7b63e7900fa486870c2c22123ee6e96976f5 (diff)
add phrase penalty feature function
Diffstat (limited to 'moses/FF/PhrasePenalty.cpp')
-rw-r--r--moses/FF/PhrasePenalty.cpp21
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
+