From 1f2cd493ce212feab41f74e180063c1987511d00 Mon Sep 17 00:00:00 2001 From: redpony Date: Tue, 5 Oct 2010 17:33:45 +0000 Subject: 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 --- decoder/ff.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'decoder/ff.cc') diff --git a/decoder/ff.cc b/decoder/ff.cc index a32c0dcb..1258bc79 100644 --- a/decoder/ff.cc +++ b/decoder/ff.cc @@ -13,6 +13,7 @@ using namespace std; FeatureFunction::~FeatureFunction() {} +void FeatureFunction::PrepareForInput(const SentenceMetadata&) {} void FeatureFunction::FinalTraversalFeatures(const void* /* ant_state */, SparseVector* /* features */) const { @@ -163,6 +164,11 @@ ModelSet::ModelSet(const vector& w, const vector } } +void ModelSet::PrepareForInput(const SentenceMetadata& smeta) { + for (int i = 0; i < models_.size(); ++i) + const_cast(models_[i])->PrepareForInput(smeta); +} + void ModelSet::AddFeaturesToEdge(const SentenceMetadata& smeta, const Hypergraph& /* hg */, const FFStates& node_states, -- cgit v1.2.3