diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-10-05 17:33:45 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-10-05 17:33:45 +0000 |
commit | 1f2cd493ce212feab41f74e180063c1987511d00 (patch) | |
tree | 0539ad3fe72b7398b05f6356dfa42bb25d472588 /decoder/decoder.cc | |
parent | de3b20fd379a62f8f381990f4d819a732b57a814 (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.cc | 5 |
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, |