From aaac9f8ee73ba59b72609af9a78b167312a6dac7 Mon Sep 17 00:00:00 2001 From: graehl Date: Sat, 7 Aug 2010 02:24:51 +0000 Subject: propagation of feature name+debug from factory, return correct features array for fsa ffs git-svn-id: https://ws10smt.googlecode.com/svn/trunk@486 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/ff_fsa.h | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'decoder/ff_fsa.h') diff --git a/decoder/ff_fsa.h b/decoder/ff_fsa.h index e7877dd5..6416151c 100755 --- a/decoder/ff_fsa.h +++ b/decoder/ff_fsa.h @@ -68,18 +68,26 @@ usage: see ff_sample_fsa.h or ff_lm_fsa.h template struct FsaFeatureFunctionBase : public FsaFeatureFunctionData { - // CALL 1 of these MANUALLY (because feature name(s) may depend on param, it's not done in ctor) - void Init(std::string const& fname="") { - fid_=FD::Convert(fname.empty()?name():fname); + Impl const& d() const { return static_cast(*this); } + Impl & d() { return static_cast(*this); } + + // this will get called by factory - override if you have multiple or dynamically named features. note: may be called repeatedly + void Init() { + Init(name()); + DBGINIT("base (single feature) FsaFeatureFunctionBase::Init name="<