summaryrefslogtreecommitdiff
path: root/decoder/ff.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-18 21:26:55 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-18 21:26:55 +0000
commit8ec14f00d1078f0fa7ab3ba2a01954b1f6ca5260 (patch)
tree2c065af3a449a50eccb1c30d140bf21a324c850d /decoder/ff.cc
parent0017c952afb4076025098165414d8ca745107f2b (diff)
ValueArray instead of string for state - same LM decode scores
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@593 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/ff.cc')
-rw-r--r--decoder/ff.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/decoder/ff.cc b/decoder/ff.cc
index 68249b42..7bdd21e3 100644
--- a/decoder/ff.cc
+++ b/decoder/ff.cc
@@ -165,13 +165,13 @@ ModelSet::ModelSet(const vector<double>& w, const vector<const FeatureFunction*>
void ModelSet::AddFeaturesToEdge(const SentenceMetadata& smeta,
const Hypergraph& /* hg */,
- const vector<string>& node_states,
+ const FFStates& node_states,
Hypergraph::Edge* edge,
- string* context,
+ FFState* context,
prob_t* combination_cost_estimate) const {
edge->reset_info();
context->resize(state_size_);
- memset(&(*context)[0], 0, state_size_); //FIXME: only context.data() is required to be contiguous, and it becomes invalid after next string operation. use SmallVector<char>? ValueArray? (higher performance perhaps, fixed size)
+ memset(&(*context)[0], 0, state_size_);
SparseVector<double> est_vals; // only computed if combination_cost_estimate is non-NULL
if (combination_cost_estimate) *combination_cost_estimate = prob_t::One();
for (int i = 0; i < models_.size(); ++i) {
@@ -193,7 +193,7 @@ void ModelSet::AddFeaturesToEdge(const SentenceMetadata& smeta,
edge->edge_prob_.logeq(edge->feature_values_.dot(weights_));
}
-void ModelSet::AddFinalFeatures(const std::string& state, Hypergraph::Edge* edge,SentenceMetadata const& smeta) const {
+void ModelSet::AddFinalFeatures(const FFState& state, Hypergraph::Edge* edge,SentenceMetadata const& smeta) const {
assert(1 == edge->rule_->Arity());
edge->reset_info();
for (int i = 0; i < models_.size(); ++i) {