summaryrefslogtreecommitdiff
path: root/decoder/tagger.cc
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2009-12-26 12:49:06 -0600
committerChris Dyer <redpony@gmail.com>2009-12-26 12:49:06 -0600
commit3f01c8ed777aec011181dc515d9d28aa81e8530b (patch)
tree93d9f6bfb9c26cb8334ca97b42b42a27dc1dc323 /decoder/tagger.cc
parent9be811a26da86b87bac8696f155188d9a675e61b (diff)
increase intersection speed by a couple orders of magnitude for linear chain graphs
Diffstat (limited to 'decoder/tagger.cc')
-rw-r--r--decoder/tagger.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/decoder/tagger.cc b/decoder/tagger.cc
index 5a0155cc..68894abd 100644
--- a/decoder/tagger.cc
+++ b/decoder/tagger.cc
@@ -57,6 +57,8 @@ struct TaggerImpl {
Hypergraph::Edge* edge = forest->AddEdge(rule, Hypergraph::TailNodeVector());
edge->i_ = i;
edge->j_ = i+1;
+ edge->prev_i_ = i; // we set these for FastLinearIntersect
+ edge->prev_j_ = i+1; // " " "
forest->ConnectEdgeToHeadNode(edge->id_, new_node_id);
}
if (prev_node_id >= 0) {
@@ -104,6 +106,7 @@ bool Tagger::Translate(const string& input,
}
pimpl_->BuildTrellis(sequence, forest);
forest->Reweight(weights);
+ forest->is_linear_chain_ = true;
return true;
}