summaryrefslogtreecommitdiff
path: root/decoder/ff_const_reorder.h
diff options
context:
space:
mode:
authorWu, Ke <wuke@cs.umd.edu>2014-10-07 18:05:58 -0400
committerWu, Ke <wuke@cs.umd.edu>2014-10-07 18:05:58 -0400
commit0900cac418f7e46889336d137e6ba1bb84651544 (patch)
tree12738df89e6ca5f495229a195760827f92c5fdee /decoder/ff_const_reorder.h
parentebeda1e75c77dd9044f1b9902770896e3009ae55 (diff)
Add ConstReorderFeature
Diffstat (limited to 'decoder/ff_const_reorder.h')
-rw-r--r--decoder/ff_const_reorder.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/decoder/ff_const_reorder.h b/decoder/ff_const_reorder.h
new file mode 100644
index 00000000..1aed2584
--- /dev/null
+++ b/decoder/ff_const_reorder.h
@@ -0,0 +1,41 @@
+/*
+ * ff_const_reorder.h
+ *
+ * Created on: Jul 11, 2013
+ * Author: junhuili
+ */
+
+#ifndef FF_CONST_REORDER_H_
+#define FF_CONST_REORDER_H_
+
+#include "ff_factory.h"
+#include "ff.h"
+
+struct ConstReorderFeatureImpl;
+
+class ConstReorderFeature : public FeatureFunction {
+ public:
+ // param = "filename n"
+ ConstReorderFeature(const std::string& param);
+ ~ConstReorderFeature();
+ 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:
+ ConstReorderFeatureImpl* pimpl_;
+};
+
+
+struct ConstReorderFeatureFactory : public FactoryBase<FeatureFunction> {
+ FP Create(std::string param) const;
+ std::string usage(bool params,bool verbose) const;
+};
+
+#endif /* FF_CONST_REORDER_H_ */