From 78a5f4297dcfce6c4a904322c2e989b612a6105a Mon Sep 17 00:00:00 2001 From: "graehl@gmail.com" Date: Sat, 7 Aug 2010 08:35:19 +0000 Subject: cdec -A "LanguageModelFsa lm.gz" works git-svn-id: https://ws10smt.googlecode.com/svn/trunk@490 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/cdec.cc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'decoder/cdec.cc') diff --git a/decoder/cdec.cc b/decoder/cdec.cc index 72f0b95e..29070a69 100644 --- a/decoder/cdec.cc +++ b/decoder/cdec.cc @@ -68,7 +68,7 @@ inline string str(char const* name,po::variables_map const& conf) { shared_ptr make_ff(string const& ffp,bool verbose_feature_functions,char const* pre="") { string ff, param; SplitCommandAndParam(ffp, &ff, ¶m); - cerr << "Feature: " << ff; + cerr << pre << "feature: " << ff; if (param.size() > 0) cerr << " (with config parameters '" << param << "')\n"; else cerr << " (no config parameters)\n"; shared_ptr pf = ff_registry.Create(ff, param); @@ -470,7 +470,9 @@ int main(int argc, char** argv) { vector > pffs,prelm_only_ffs; vector late_ffs,prelm_ffs; if (conf.count("feature_function") > 0) { - const vector& add_ffs = conf["feature_function"].as >(); + vector add_ffs; +// const vector& add_ffs = conf["feature_function"].as >(); + store_conf(conf,"feature_function",&add_ffs); for (int i = 0; i < add_ffs.size(); ++i) { pffs.push_back(make_ff(add_ffs[i],verbose_feature_functions)); FeatureFunction const* p=pffs.back().get(); @@ -484,7 +486,9 @@ int main(int argc, char** argv) { } } if (conf.count("prelm_feature_function") > 0) { - const vector& add_ffs = conf["prelm_feature_function"].as >(); + vector add_ffs; + store_conf(conf,"prelm_feature_function",&add_ffs); +// const vector& add_ffs = conf["prelm_feature_function"].as >(); for (int i = 0; i < add_ffs.size(); ++i) { prelm_only_ffs.push_back(make_ff(add_ffs[i],verbose_feature_functions,"prelm-only ")); prelm_ffs.push_back(prelm_only_ffs.back().get()); @@ -494,12 +498,16 @@ int main(int argc, char** argv) { vector > fsa_ffs; vector fsa_names; store_conf(conf,"fsa_feature_function",&fsa_names); + for (int i=0;i1) { //FIXME: support N fsa ffs. cerr<<"Only the first fsa FF will be used (FIXME).\n"; - fsa_names.resize(1); - for (int i=0;idescribe()<