summaryrefslogtreecommitdiff
path: root/decoder/ff_from_fsa.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-23 21:31:30 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-23 21:31:30 +0000
commit7fe231401fbb0f934f54c071e10fdeb4dc566d57 (patch)
tree59151c946cc3dfc51586ef184f8c48f3e85cb7fb /decoder/ff_from_fsa.h
parent7419bf36a750ed894d095da71fdc93814a8dbac5 (diff)
more FF_FSA_DEBUG logs
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@388 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/ff_from_fsa.h')
-rwxr-xr-xdecoder/ff_from_fsa.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/decoder/ff_from_fsa.h b/decoder/ff_from_fsa.h
index 42fa1e80..820f2433 100755
--- a/decoder/ff_from_fsa.h
+++ b/decoder/ff_from_fsa.h
@@ -141,7 +141,7 @@ public:
const void* residual_state,
FeatureVector* final_features) const
{
- ff.init_features(final_features); // estimated_features is fresh
+ ff.init_features(final_features);
Sentence const& ends=ff.end_phrase();
if (!ssz) {
AccumFeatures(ff,smeta,begin(ends),end(ends),final_features,0);
@@ -150,19 +150,23 @@ public:
SP ss=ff.start_state();
WP l=(WP)residual_state,lend=left_end(residual_state);
SP rst=fsa_state(residual_state);
+ FSAFFDBG("(FromFsa) Final "<<name);
if (lend==rst) { // implying we have an fsa state
AccumFeatures(ff,smeta,l,lend,final_features,ss); // e.g. <s> score(full left unscored phrase)
+ FSAFFDBG(" left: "<<Sentence(l,lend));
AccumFeatures(ff,smeta,begin(ends),end(ends),final_features,rst); // e.g. [ctx for last M words] score("</s>")
+ FSAFFDBG(" right: "<<ff.describe_state(rst)<<" -> "<<ends);
} else { // all we have is a single short phrase < M words before adding ends
int nl=lend-l;
Sentence whole(ends.size()+nl);
WordID *w=begin(whole);
wordcpy(w,l,nl);
wordcpy(w+nl,begin(ends),ends.size());
+ FSAFFDBG(" score whole sentence: "<<whole);
// whole = left-words + end-phrase
AccumFeatures(ff,smeta,w,end(whole),final_features,ss);
}
- FSAFFDBG("Final "<<name<<" = "<<*final_features<<'\n');
+ FSAFFDBG(" = "<<*final_features<<'\n');
}
bool rule_feature() const {