summaryrefslogtreecommitdiff
path: root/decoder/apply_models.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-09 15:12:46 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-09 15:12:46 +0000
commit31d21ec50cb9689a73ee58617d282741396ca510 (patch)
tree403fcb8f0832a3098d1ca4334c3a57b71476a385 /decoder/apply_models.cc
parentf4baa1d18527bdec27a4f122a9c52c1596332ca2 (diff)
exhaustive rather than cube, if ModelSet is stateless
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@195 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/apply_models.cc')
-rw-r--r--decoder/apply_models.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/decoder/apply_models.cc b/decoder/apply_models.cc
index 0b667de0..78f37e68 100644
--- a/decoder/apply_models.cc
+++ b/decoder/apply_models.cc
@@ -408,18 +408,17 @@ void ApplyModelSet(const Hypergraph& in,
const ModelSet& models,
const IntersectionConfiguration& config,
Hypergraph* out) {
- // TODO special handling when all models are stateless
- if (config.algorithm == 1) {
+ if (models.stateless() && config.algorithm == 0) {
+ NoPruningRescorer ma(models, smeta, in, out); // avoid overhead of best-first when no state
+ ma.Apply();
+ } else if (config.algorithm == 1) {
int pl = config.pop_limit;
if (pl > 100 && in.nodes_.size() > 80000) {
- cerr << " Note: reducing pop_limit to " << pl << " for very large forest\n";
pl = 30;
+ cerr << " Note: reducing pop_limit to " << pl << " for very large forest\n";
}
CubePruningRescorer ma(models, smeta, in, pl, out);
ma.Apply();
- } else if (config.algorithm == 0) {
- NoPruningRescorer ma(models, smeta, in, out);
- ma.Apply();
} else {
cerr << "Don't understand intersection algorithm " << config.algorithm << endl;
exit(1);