diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-04-30 17:38:26 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-04-30 17:38:26 -0400 |
commit | 97aa3c199f53c93f7b5cabdf815be99adc06ea02 (patch) | |
tree | e09bc499e64c0a0ad612f83fd0caca3836688d66 /decoder/cdec.cc | |
parent | 2738a4d902757d60108dccb2ddbb778251be63e3 (diff) |
enable list of features to be displayed at the end of decoding
Diffstat (limited to 'decoder/cdec.cc')
-rw-r--r-- | decoder/cdec.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/decoder/cdec.cc b/decoder/cdec.cc index b47ab380..5c40f56e 100644 --- a/decoder/cdec.cc +++ b/decoder/cdec.cc @@ -12,6 +12,7 @@ int main(int argc, char** argv) { Decoder decoder(argc, argv); const string input = decoder.GetConf()["input"].as<string>(); + const bool show_feature_dictionary = decoder.GetConf().count("show_feature_dictionary"); if (!SILENT) cerr << "Reading input from " << ((input == "-") ? "STDIN" : input.c_str()) << endl; ReadFile in_read(input); istream *in = in_read.stream(); @@ -23,6 +24,12 @@ int main(int argc, char** argv) { if (buf.empty()) continue; decoder.Decode(buf); } + if (show_feature_dictionary) { + int num = FD::NumFeats(); + for (int i = 1; i < num; ++i) { + cout << FD::Convert(i) << endl; + } + } return 0; } |