summaryrefslogtreecommitdiff
path: root/extractor/features/target_given_source_coherent.cc
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-02-01 16:11:10 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-02-01 16:11:10 +0000
commit252fb164c208ec8f3005f8a652eb3b48c0644e3d (patch)
tree7199cb668e77ef89c7bcccb37d70554e3b52c2a5 /extractor/features/target_given_source_coherent.cc
parent4ab84a0be28fdb6c0c421fe5ba5e09cfa298f2d1 (diff)
Second working commit.
Diffstat (limited to 'extractor/features/target_given_source_coherent.cc')
-rw-r--r--extractor/features/target_given_source_coherent.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/extractor/features/target_given_source_coherent.cc b/extractor/features/target_given_source_coherent.cc
new file mode 100644
index 00000000..748413c3
--- /dev/null
+++ b/extractor/features/target_given_source_coherent.cc
@@ -0,0 +1,12 @@
+#include "target_given_source_coherent.h"
+
+#include <cmath>
+
+double TargetGivenSourceCoherent::Score(const FeatureContext& context) const {
+ double prob = context.pair_count / context.sample_source_count;
+ return prob > 0 ? -log10(prob) : MAX_SCORE;
+}
+
+string TargetGivenSourceCoherent::GetName() const {
+ return "EGivenFCoherent";
+}