From 5f9c85a6072d64b10879feafc040374e274027eb Mon Sep 17 00:00:00 2001 From: graehl Date: Fri, 23 Jul 2010 23:10:34 +0000 Subject: strip debug param from feature spec; debug info on from_fsa Init git-svn-id: https://ws10smt.googlecode.com/svn/trunk@393 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/ff.cc | 4 ++-- decoder/ff_factory.cc | 2 +- decoder/ff_from_fsa.h | 8 ++++++-- decoder/ff_sample_fsa.h | 22 +++++++++++----------- decoder/sparse_vector.h | 2 +- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/decoder/ff.cc b/decoder/ff.cc index 28d6f732..4f1a3d32 100644 --- a/decoder/ff.cc +++ b/decoder/ff.cc @@ -1,6 +1,6 @@ -//TODO: actually score rule_feature()==true features once only, hash keyed on rule or modify TRule directly? need to keep clear in forest which features come from models vs. rules; then rescoring could drop all the old models features at once +//TODO: non-sparse vector for all feature functions? modelset applymodels keeps track of who has what features? it's nice having FF that could generate a handful out of 10000 possible feats, though. -//TODO: 0 size state != rule-local feature, i.e. still may depend on source span loc/context. identify truly rule-local features so if we want they can be added to grammar rules (minor speedup) +//TODO: actually score rule_feature()==true features once only, hash keyed on rule or modify TRule directly? need to keep clear in forest which features come from models vs. rules; then rescoring could drop all the old models features at once #include #include "ff.h" diff --git a/decoder/ff_factory.cc b/decoder/ff_factory.cc index a6d834e0..cc07b2f2 100644 --- a/decoder/ff_factory.cc +++ b/decoder/ff_factory.cc @@ -35,7 +35,7 @@ shared_ptr FFRegistry::Create(const string& ffname, const strin int pl=debug_pre.size(); bool space=false; std::string p=param; - bool debug=match_begin(p,debug_pre)&&(p.size()==pl||(space=p[pl]==' ')); + bool debug=match_begin(p,debug_pre)&&(p.size()==pl||(space=(p[pl]==' ')); if (debug) { p.erase(0,debug_pre.size()+space); cerr<<"debug enabled for "< markov order 0 + FSAFFDBG("order="<