summaryrefslogtreecommitdiff
path: root/decoder/cdec.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-04-30 17:38:26 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2011-04-30 17:38:26 -0400
commit3b922ac2ee37efd1d606373ae599976bfcaf4b43 (patch)
tree43ea28ed1a078165771ae17b355d8873ba41e1df /decoder/cdec.cc
parent0a0c377cd92368ed1f6f476d16661a27bea28a65 (diff)
enable list of features to be displayed at the end of decoding
Diffstat (limited to 'decoder/cdec.cc')
-rw-r--r--decoder/cdec.cc7
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;
}