Skip to content

Commit

Permalink
Cap probability
Browse files Browse the repository at this point in the history
  • Loading branch information
kpu committed Mar 9, 2016
1 parent 15553b8 commit 77cd4b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lm/interpolate/backoff_reunification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "lm/common/ngram.hh"
#include "lm/common/compare.hh"

#include <algorithm>
#include <cassert>

namespace lm {
Expand All @@ -25,7 +26,7 @@ class MergeWorker {
util::stream::Stream boff_input(boff_pos_);
for (; prob_input && boff_input; ++prob_input, ++boff_input, ++stream) {
std::copy(prob_input->begin(), prob_input->end(), stream->begin());
stream->Value().prob = prob_input->Value();
stream->Value().prob = std::min(0.0f, prob_input->Value());
stream->Value().backoff = *reinterpret_cast<float *>(boff_input.Get());
}
UTIL_THROW_IF2(prob_input || boff_input,
Expand Down

0 comments on commit 77cd4b9

Please sign in to comment.