summaryrefslogtreecommitdiff
path: root/decoder/ff_klm.h
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-11-11 20:31:56 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-11-11 20:31:56 +0000
commit2936b9e333ec0280b0ed3e115af23f13ab8b87a7 (patch)
tree5b502e56e38fd614ee9b923651d187d422fe05d9 /decoder/ff_klm.h
parent48c848908a391c157af4ad9266e8b616e8106d2e (diff)
klm stub
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@711 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/ff_klm.h')
-rw-r--r--decoder/ff_klm.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/decoder/ff_klm.h b/decoder/ff_klm.h
new file mode 100644
index 00000000..0569286f
--- /dev/null
+++ b/decoder/ff_klm.h
@@ -0,0 +1,32 @@
+#ifndef _KLM_FF_H_
+#define _KLM_FF_H_
+
+#include <vector>
+#include <string>
+
+#include "ff.h"
+
+struct KLanguageModelImpl;
+
+class KLanguageModel : public FeatureFunction {
+ public:
+ // param = "filename.lm [-o n]"
+ KLanguageModel(const std::string& param);
+ ~KLanguageModel();
+ virtual void FinalTraversalFeatures(const void* context,
+ SparseVector<double>* features) const;
+ static std::string usage(bool param,bool verbose);
+ Features features() const;
+ protected:
+ virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta,
+ const Hypergraph::Edge& edge,
+ const std::vector<const void*>& ant_contexts,
+ SparseVector<double>* features,
+ SparseVector<double>* estimated_features,
+ void* out_context) const;
+ private:
+ int fid_; // conceptually const; mutable only to simplify constructor
+ KLanguageModelImpl* pimpl_;
+};
+
+#endif