summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);