From 3f01c8ed777aec011181dc515d9d28aa81e8530b Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sat, 26 Dec 2009 12:49:06 -0600 Subject: increase intersection speed by a couple orders of magnitude for linear chain graphs --- decoder/tagger.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'decoder/tagger.cc') 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; } -- cgit v1.2.3