From c85ba4a9147d180277c49752d6fbefbfe9c2f392 Mon Sep 17 00:00:00 2001 From: graehl Date: Mon, 26 Jul 2010 17:25:57 +0000 Subject: comment cleanup git-svn-id: https://ws10smt.googlecode.com/svn/trunk@421 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/ff_from_fsa.h | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'decoder/ff_from_fsa.h') diff --git a/decoder/ff_from_fsa.h b/decoder/ff_from_fsa.h index 237e5d0d..f50e0fdc 100755 --- a/decoder/ff_from_fsa.h +++ b/decoder/ff_from_fsa.h @@ -40,8 +40,7 @@ public: Features features() const { return ff.features(); } - //TODO: add source span to Fsa FF interface, pass along - //TODO: read/debug VERY CAREFULLY + // Log because it void TraversalFeaturesLog(const SentenceMetadata& smeta, Hypergraph::Edge& edge, const std::vector& ant_contexts, @@ -64,25 +63,27 @@ public: FSAFFDBGnl(edge); return; } - +//why do we compute heuristic in so many places? well, because that's how we know what state we should score words in once we're full on our left context (because of markov order bound, we know the score will be the same no matter what came before that left context) SP h_start=ff.heuristic_start_state(); + // these left_* refer to our output (out_state): W left_begin=(W)out_state; W left_out=left_begin; // [left,fsa_state) = left ctx words. if left words aren't full, then null wordid WP left_full=left_end_full(out_state); - FsaScanner fsa(ff,smeta,edge); + FsaScanner fsa(ff,smeta,edge); // this holds our current state and eventuallybecomes our right state if we saw enough words TRule const& rule=*edge.rule_; Sentence const& e = rule.e(); for (int j = 0; j < e.size(); ++j) { // items in target side of rule if (e[j] < 1) { // variable - SP a = ant_contexts[-e[j]]; + SP a = ant_contexts[-e[j]]; // variables a* are referring to this child derivation state. FSAFFDBG(edge,' '< our left words -> any number of interior words which are scored then hidden + if (left_out+anw