summaryrefslogtreecommitdiff
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
commit409165b237b571a8b9e4108639667301b7243147 (patch)
tree96c6dda0185d97454b2df744a5c2b2709458bbb9
parentbb86637332d49f71c485df34576e464eaf053656 (diff)
fix for crash with no rescoring
-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; }