summaryrefslogtreecommitdiff
path: root/decoder/lexalign.cc
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-04-07 22:56:34 -0400
committerChris Dyer <redpony@gmail.com>2014-04-07 22:56:34 -0400
commitb9e6e7e24cc48021090b689e143288e2b7f2b5fc (patch)
tree273794b9723dd132518fddd0b99ffec6a015c2ce /decoder/lexalign.cc
parent6051462ad3f161ab129b5a2fb3a9cacd35201a3b (diff)
track node state for smarter union
Diffstat (limited to 'decoder/lexalign.cc')
-rw-r--r--decoder/lexalign.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/decoder/lexalign.cc b/decoder/lexalign.cc
index 6adb1892..11f20de7 100644
--- a/decoder/lexalign.cc
+++ b/decoder/lexalign.cc
@@ -124,6 +124,11 @@ bool LexicalAlign::TranslateImpl(const string& input,
pimpl_->BuildTrellis(lattice, *smeta, forest);
forest->is_linear_chain_ = true;
forest->Reweight(weights);
+ // since we don't do any pruning, the node_hash will be the same for
+ // every run of the composer
+ int nc = 0;
+ for (auto& node : forest->nodes_)
+ node.node_hash = ++nc;
return true;
}