From 97aa3c199f53c93f7b5cabdf815be99adc06ea02 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sat, 30 Apr 2011 17:38:26 -0400 Subject: enable list of features to be displayed at the end of decoding --- decoder/cdec.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'decoder/cdec.cc') 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(); + 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; } -- cgit v1.2.3