summaryrefslogtreecommitdiff
path: root/decoder/decoder.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/decoder.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/decoder.cc')
-rw-r--r--decoder/decoder.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc
index 537fdffa..b975a5fc 100644
--- a/decoder/decoder.cc
+++ b/decoder/decoder.cc
@@ -662,9 +662,10 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
//FIXME: should get the avg. or max source length of the input lattice (like Lattice::dist_(start,end)); but this is only used to scale beam parameters (optionally) anyway so fidelity isn't important.
const bool has_ref = ref.size() > 0;
SentenceMetadata smeta(sent_id, ref);
+ smeta.sgml_.swap(sgml);
o->NotifyDecodingStart(smeta);
Hypergraph forest; // -LM forest
- translator->ProcessMarkupHints(sgml);
+ translator->ProcessMarkupHints(smeta.sgml_);
Timer t("Translation");
const bool translation_successful =
translator->Translate(to_translate, &smeta, feature_weights, &forest);
@@ -696,6 +697,7 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
Timer t("prelm rescoring");
forest.Reweight(prelm_feature_weights);
Hypergraph prelm_forest;
+ prelm_models->PrepareForInput(smeta);
ApplyModelSet(forest,
smeta,
*prelm_models,
@@ -713,6 +715,7 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
bool has_late_models = !late_models->empty();
if (has_late_models) {
Timer t("Forest rescoring:");
+ late_models->PrepareForInput(smeta);
forest.Reweight(feature_weights);
Hypergraph lm_forest;
ApplyModelSet(forest,