summaryrefslogtreecommitdiff
path: root/decoder/ff.h
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.h
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.h')
-rw-r--r--decoder/ff.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/decoder/ff.h b/decoder/ff.h
index fe4411cd..726845c4 100644
--- a/decoder/ff.h
+++ b/decoder/ff.h
@@ -14,6 +14,7 @@
#include "fdict.h"
#include "hg.h"
#include "feature_vector.h"
+#include "value_array.h"
class SentenceMetadata;
class FeatureFunction; // see definition below
@@ -242,6 +243,8 @@ void show_all_features(std::vector<FFp> const& models_,DenseWeightVector &weight
return show_features(all_features(models_,weights_,&warn,warn_fid_0),weights_,out,warn,warn_zero_wt);
}
+typedef std::string FFState; //FIXME: only context.data() is required to be contiguous, and it becomes invalid after next string operation. use ValueArray instead? (higher performance perhaps, save a word due to fixed size)
+typedef std::vector<FFState> FFStates;
// this class is a set of FeatureFunctions that can be used to score, rescore,
// etc. a (translation?) forest
@@ -257,13 +260,13 @@ class ModelSet {
// must be. edge features are supposed to be overwritten, not added to (possibly because rule features aren't in ModelSet so need to be left alone
void AddFeaturesToEdge(const SentenceMetadata& smeta,
const Hypergraph& hg,
- const std::vector<std::string>& node_states,
+ const FFStates& node_states,
Hypergraph::Edge* edge,
- std::string* residual_context,
+ FFState* residual_context,
prob_t* combination_cost_estimate = NULL) const;
//this is called INSTEAD of above when result of edge is goal (must be a unary rule - i.e. one variable, but typically it's assumed that there are no target terminals either (e.g. for LM))
- void AddFinalFeatures(const std::string& residual_context,
+ void AddFinalFeatures(const FFState& residual_context,
Hypergraph::Edge* edge,
SentenceMetadata const& smeta) const;