From 36efbef92279e22888059ccd225aa7798fe9f4ae Mon Sep 17 00:00:00 2001 From: graehl Date: Wed, 28 Jul 2010 05:25:56 +0000 Subject: fsa lm phrase mystery remains, but bool fsa::simple_phrase_score indicates whether stateless features should copy phrases from rules (e.g. unigram lm) git-svn-id: https://ws10smt.googlecode.com/svn/trunk@444 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/ff_from_fsa.h | 72 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 30 deletions(-) (limited to 'decoder/ff_from_fsa.h') diff --git a/decoder/ff_from_fsa.h b/decoder/ff_from_fsa.h index 7fa6be67..c517ec64 100755 --- a/decoder/ff_from_fsa.h +++ b/decoder/ff_from_fsa.h @@ -40,7 +40,7 @@ public: Features features() const { return ff.features(); } - // Log because it + // Log because it potentially stores info in edge. otherwise the same as regular TraversalFeatures. void TraversalFeaturesLog(const SentenceMetadata& smeta, Hypergraph::Edge& edge, const std::vector& ant_contexts, @@ -51,62 +51,74 @@ public: TRule const& rule=*edge.rule_; Sentence const& e = rule.e(); typename Impl::Accum accum,h_accum; - if (!ssz) { - Sentence phrase; - phrase.reserve(e.size()); - for (int j=0,je=e.size();;++j) { // items in target side of rule - if (je==j || e[j]<1) { // end or variable - if (phrase.size()) { - FSAFFDBG(edge," ["<=1) // token + ff.ScanAccum(smeta,edge,(WordID)e[j],NULL,NULL,&accum); + FSAFFDBG(edge," "<