summaryrefslogtreecommitdiff
path: root/decoder/ff.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-08 19:21:02 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-08 19:21:02 +0000
commit52a8d49e81c14b6f7ed3afb5bdb50b17391995a8 (patch)
tree2cd84e2840204de6fbfaa70be5b2818b9c805b51 /decoder/ff.h
parent71b39bcf60182d1686966db34225a670d13e3594 (diff)
actually use -n feature_name in LanguageModel. FF factory usage facility, FF feature ids facility (not used yet)
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@186 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/ff.h')
-rw-r--r--decoder/ff.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/decoder/ff.h b/decoder/ff.h
index 630b3208..c6c9cf8f 100644
--- a/decoder/ff.h
+++ b/decoder/ff.h
@@ -19,6 +19,17 @@ class FeatureFunction {
explicit FeatureFunction(int state_size) : state_size_(state_size) {}
virtual ~FeatureFunction();
+ // override this. not virtual because we want to expose this to factory template for help before creating a FF
+ static std::string usage(bool show_params,bool show_details) {
+ return usage_helper("FIXME_feature_needs_name","[no parameters]","[no documentation yet]",show_params,show_details);
+ }
+
+ static std::string usage_helper(std::string const& name,std::string const& params,std::string const& details,bool show_params,bool show_details);
+
+public:
+
+ typedef std::vector<WordID> Features;
+ virtual Features features() { return Features(); }
// returns the number of bytes of context that this feature function will
// (maximally) use. By default, 0 ("stateless" models in Hiero/Joshua).
// NOTE: this value is fixed for the instance of your class, you cannot
@@ -144,7 +155,7 @@ class ModelSet {
bool empty() const { return models_.empty(); }
private:
std::vector<const FeatureFunction*> models_;
- std::vector<double> weights_;
+ std::vector<double> weights_;
int state_size_;
std::vector<int> model_state_pos_;
};