summaryrefslogtreecommitdiff
path: root/decoder/ff.cc
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
commit72acccb0da4a54369f32217c1618527956adacac (patch)
treee5458c7272433b9e9f3e527c41b7c51533ca151d /decoder/ff.cc
parentd04386922f3e25017207bbc26ea460ee7d85c630 (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.cc')
-rw-r--r--decoder/ff.cc6
1 files changed, 6 insertions, 0 deletions
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<double>* /* features */) const {
@@ -163,6 +164,11 @@ ModelSet::ModelSet(const vector<double>& w, const vector<const FeatureFunction*>
}
}
+void ModelSet::PrepareForInput(const SentenceMetadata& smeta) {
+ for (int i = 0; i < models_.size(); ++i)
+ const_cast<FeatureFunction*>(models_[i])->PrepareForInput(smeta);
+}
+
void ModelSet::AddFeaturesToEdge(const SentenceMetadata& smeta,
const Hypergraph& /* hg */,
const FFStates& node_states,