summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2014-02-23 02:13:32 -0500
committerChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2014-02-23 02:13:32 -0500
commit5669b4dcdf99afddd1a6e15bbec3b36ddf1ecc9c (patch)
tree7e8fd29de4047a46dc4d76983193bb7c06d78c94 /decoder
parent039fc3fa3a60137fc9f61c3e1505c9bef89fe4da (diff)
fix rule emission behavior
Diffstat (limited to 'decoder')
-rw-r--r--decoder/decoder.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc
index e02c7730..f8104c5e 100644
--- a/decoder/decoder.cc
+++ b/decoder/decoder.cc
@@ -662,11 +662,6 @@ DecoderImpl::DecoderImpl(po::variables_map& conf, int argc, char** argv, istream
oracle.show_derivation=conf.count("show_derivations");
remove_intersected_rule_annotations = conf.count("remove_intersected_rule_annotations");
- if (conf.count("extract_rules")) {
- stringstream ss;
- ss << sent_id;
- extract_file.reset(new WriteFile(str("extract_rules",conf)+"/"+ss.str()));
- }
combine_size = conf["combine_size"].as<int>();
if (combine_size < 1) combine_size = 1;
sent_id = -1;
@@ -720,6 +715,11 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
}
cerr << " id = " << sent_id << endl;
}
+ if (conf.count("extract_rules")) {
+ stringstream ss;
+ ss << sent_id << ".gz";
+ extract_file.reset(new WriteFile(str("extract_rules",conf)+"/"+ss.str()));
+ }
string to_translate;
Lattice ref;
ParseTranslatorInputLattice(buf, &to_translate, &ref);