summaryrefslogtreecommitdiff
path: root/decoder/ff.h
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-10-05 17:33:45 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-10-05 17:33:45 +0000
commit1f2cd493ce212feab41f74e180063c1987511d00 (patch)
tree0539ad3fe72b7398b05f6356dfa42bb25d472588 /decoder/ff.h
parentde3b20fd379a62f8f381990f4d819a732b57a814 (diff)
add PrepareForInput to ff interface, make sgml markup available to feature functions
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@669 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/ff.h')
-rw-r--r--decoder/ff.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/decoder/ff.h b/decoder/ff.h
index 904b9eb8..e470f9a9 100644
--- a/decoder/ff.h
+++ b/decoder/ff.h
@@ -52,6 +52,10 @@ public:
// stateless feature that doesn't depend on source span: override and return true. then your feature can be precomputed over rules.
virtual bool rule_feature() const { return false; }
+ // called once, per input, before any feature calls to TraversalFeatures, etc.
+ // used to initialize sentence-specific data structures
+ virtual void PrepareForInput(const SentenceMetadata& smeta);
+
//OVERRIDE THIS:
virtual Features features() const { return single_feature(FD::Convert(name_)); }
// returns the number of bytes of context that this feature function will
@@ -274,6 +278,10 @@ class ModelSet {
Hypergraph::Edge* edge,
SentenceMetadata const& smeta) const;
+ // this is called once before any feature functions apply to a hypergraph
+ // it can be used to initialize sentence-specific data structures
+ void PrepareForInput(const SentenceMetadata& smeta);
+
bool empty() const { return models_.empty(); }
bool stateless() const { return !state_size_; }