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 --- vest/mr_vest_generate_mapper_input.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'vest') diff --git a/vest/mr_vest_generate_mapper_input.cc b/vest/mr_vest_generate_mapper_input.cc index f1179839..14342a43 100644 --- a/vest/mr_vest_generate_mapper_input.cc +++ b/vest/mr_vest_generate_mapper_input.cc @@ -18,15 +18,21 @@ const bool DEBUG_ORACLE=true; -boost::shared_ptr global_ff_registry; +//TODO: decide on cdec_ff ffs, or just bleumodel - if just bleumodel, then do existing features on serialized hypergraphs remain? weights (origin) is passed to oracle_bleu.h:ComputeOracle +//void register_feature_functions(); +//FFRegistry ff_registry; namespace { +void init_bleumodel() { + ff_registry.clear(); + ff_registry.Register(new FFFactory); +} + struct init_ff { init_ff() { - global_ff_registry.reset(new FFRegistry); - global_ff_registry->Register(new FFFactory); + init_bleumodel(); } }; -init_ff reg; +//init_ff reg; // order of initialization? ff_registry may not be init yet. call in Run() instead. } using namespace std; @@ -146,6 +152,8 @@ struct oracle_directions { } bool verbose() const { return oracle.verbose; } void Run() { + init_bleumodel(); +// register_feature_functions(); AddPrimaryAndRandomDirections(); AddOracleDirections(); compress_similar(directions,max_similarity,&cerr,true,verbose()); -- cgit v1.2.3