summaryrefslogtreecommitdiff
path: root/decoder/ff_soft_syn.h
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-12-18 12:52:00 -0500
committerChris Dyer <redpony@gmail.com>2014-12-18 12:52:00 -0500
commit59befb84d2879bb9b50eaa974471155caefbc55f (patch)
tree8ceea539890f3faaa5a35303bf6293536e6e63fb /decoder/ff_soft_syn.h
parent3b3d7fe1f65c811d2c158f0c79a007817023a5c5 (diff)
parentd426bbfed039f1b8ab0ebbea9745f6e827a40af1 (diff)
Merge pull request #64 from kho/softsyn_2
Proper implementation of soft syntactic constraint features
Diffstat (limited to 'decoder/ff_soft_syn.h')
-rw-r--r--decoder/ff_soft_syn.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/decoder/ff_soft_syn.h b/decoder/ff_soft_syn.h
new file mode 100644
index 00000000..df9a6cc8
--- /dev/null
+++ b/decoder/ff_soft_syn.h
@@ -0,0 +1,38 @@
+/*
+ * ff_soft_syn.h
+ *
+ */
+
+#ifndef FF_SOFT_SYN_H_
+#define FF_SOFT_SYN_H_
+
+#include "ff_factory.h"
+#include "ff.h"
+
+struct SoftSynFeatureImpl;
+
+class SoftSynFeature : public FeatureFunction {
+ public:
+ SoftSynFeature(std::string param);
+ ~SoftSynFeature();
+ static std::string usage(bool param, bool verbose);
+
+ protected:
+ virtual void PrepareForInput(const SentenceMetadata& smeta);
+
+ virtual void TraversalFeaturesImpl(
+ const SentenceMetadata& smeta, const HG::Edge& edge,
+ const std::vector<const void*>& ant_contexts,
+ SparseVector<double>* features, SparseVector<double>* estimated_features,
+ void* out_context) const;
+
+ private:
+ SoftSynFeatureImpl* pimpl_;
+};
+
+struct SoftSynFeatureFactory : public FactoryBase<FeatureFunction> {
+ FP Create(std::string param) const;
+ std::string usage(bool params, bool verbose) const;
+};
+
+#endif /* FF_SOFT_SYN_H_ */