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
commit769aadfc431f2eec68c889b65b8939a4d35f56e9 (patch)
tree31a496a1a49416afde4d5cee668969acc7497e9f /decoder/ff.h
parent242774be8f3e4c08d1406ca4ecc9abcc1ca7d190 (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;