am 8f9f55dd: Merge "Fix a bug where the bigram freq would be underevaluated" into jb-dev
* commit '8f9f55dd9d27f6c759c12416c872138b9b4661dc':
Fix a bug where the bigram freq would be underevaluated
diff --git a/native/jni/src/binary_format.h b/native/jni/src/binary_format.h
index e42589b..85fdd94 100644
--- a/native/jni/src/binary_format.h
+++ b/native/jni/src/binary_format.h
@@ -537,7 +537,7 @@
// while a value of 15 represents the middle of the top step.
// See makedict.BinaryDictInputOutput for details.
const float stepSize = ((float)MAX_FREQ - unigramFreq) / (1.5f + MAX_BIGRAM_FREQ);
- return (int)(unigramFreq + bigramFreq * stepSize);
+ return (int)(unigramFreq + (bigramFreq + 1) * stepSize);
}
// This returns a probability in log space.