diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-09-13 17:57:32 +0100 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-09-13 17:57:32 +0100 |
commit | 409165b237b571a8b9e4108639667301b7243147 (patch) | |
tree | 96c6dda0185d97454b2df744a5c2b2709458bbb9 | |
parent | bb86637332d49f71c485df34576e464eaf053656 (diff) |
fix for crash with no rescoring
-rw-r--r-- | decoder/decoder.cc | 2 |
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; } |