summaryrefslogtreecommitdiff
path: root/decoder/decoder.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-09-13 17:57:32 +0100
committerChris Dyer <cdyer@cs.cmu.edu>2011-09-13 17:57:32 +0100
commitbff9f7f6e3ed777c9379c0373657eeaf43a6a213 (patch)
tree0f7aa5f43b31929ec3c4ac96f2a82b76f0ee9db3 /decoder/decoder.cc
parent251da4347ea356f799e6c227ac8cf541c0cef2f2 (diff)
fix for crash with no rescoring
Diffstat (limited to 'decoder/decoder.cc')
-rw-r--r--decoder/decoder.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc
index 4d4b6245..45404c47 100644
--- a/decoder/decoder.cc
+++ b/decoder/decoder.cc
@@ -181,7 +181,7 @@ struct DecoderImpl {
~DecoderImpl();
bool Decode(const string& input, DecoderObserver*);
vector<weight_t>& CurrentWeightVector() {
- return *rescoring_passes.back().weight_vector;
+ return (rescoring_passes.empty() ? *init_weights : *rescoring_passes.back().weight_vector);
}
void SetId(int next_sent_id) { sent_id = next_sent_id - 1; }