summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'decoder')
-rw-r--r--decoder/cdec.cc14
-rwxr-xr-xdecoder/ff_fsa.h3
-rw-r--r--decoder/sparse_vector.h3
3 files changed, 14 insertions, 6 deletions
diff --git a/decoder/cdec.cc b/decoder/cdec.cc
index cc0b1434..6fb6d5a1 100644
--- a/decoder/cdec.cc
+++ b/decoder/cdec.cc
@@ -154,7 +154,7 @@ void InitCommandLine(int argc, char** argv, OracleBleu &ob, po::variables_map* c
ob.AddOptions(&opts);
po::options_description clo("Command line options");
clo.add_options()
- ("config,c", po::value<string>(), "Configuration file")
+ ("config,c", po::value<vector<string> >(), "Configuration file(s) - latest has priority")
("help,h", "Print this help message and exit")
("usage,u", po::value<string>(), "Describe a feature function type")
("compgen", "Print just option names suitable for bash command line completion builtin 'compgen'")
@@ -172,10 +172,14 @@ void InitCommandLine(int argc, char** argv, OracleBleu &ob, po::variables_map* c
}
ShowBanner();
if (conf.count("config")) {
- const string cfg = str("config",conf);
- cerr << "Configuration file: " << cfg << endl;
- ifstream config(cfg.c_str());
- po::store(po::parse_config_file(config, dconfig_options), conf);
+ typedef vector<string> Cs;
+ Cs cs=conf["config"].as<Cs>();
+ for (int i=0;i<cs.size();++i) {
+ string cfg=cs[i];
+ cerr << "Configuration file: " << cfg << endl;
+ ifstream config(cfg.c_str());
+ po::store(po::parse_config_file(config, dconfig_options), conf);
+ }
}
po::notify(conf);
diff --git a/decoder/ff_fsa.h b/decoder/ff_fsa.h
index 2ffd6ef8..0b60ff81 100755
--- a/decoder/ff_fsa.h
+++ b/decoder/ff_fsa.h
@@ -32,7 +32,8 @@ struct FsaFeatureFunction {
// regular bottom up scorer from Fsa feature
template <class Impl>
-struct FeatureFunctionFromFsa {
+struct FeatureFunctionFromFsa : public FeatureFunction,Impl {
+ FeatureFunctionFromFsa(
};
diff --git a/decoder/sparse_vector.h b/decoder/sparse_vector.h
index 5e785210..9894d662 100644
--- a/decoder/sparse_vector.h
+++ b/decoder/sparse_vector.h
@@ -1,5 +1,8 @@
#ifndef _SPARSE_VECTOR_H_
#define _SPARSE_VECTOR_H_
+/* TODO: use dense_hash_map for sparsevector
+ use SparseVectorList (pair smallvector) for feat funcs / hypergraphs (you rarely need random access; just append a feature to the list)
+*/
/* hack: index 0 never gets printed because cdyer is creative and efficient. features which have no weight got feature dict id 0, see, and the models all clobered that value. nobody wants to see it. except that vlad is also creative and efficient and stored the oracle bleu there. */