aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-05-29 16:04:07 +0900
committerJean Chalard <jchalard@google.com>2012-05-29 16:04:07 +0900
commitcb99376307f0d57e2935449f93fc162253dcdd01 (patch)
tree0d1b91f2468139e226b21f455eabda5036a5daf2
parent19ebd936462ee6e4796b8755be82d67437406845 (diff)
downloadlatinime-cb99376307f0d57e2935449f93fc162253dcdd01.tar.gz
latinime-cb99376307f0d57e2935449f93fc162253dcdd01.tar.xz
latinime-cb99376307f0d57e2935449f93fc162253dcdd01.zip
Fix a bug where the bigram freq would be underevaluated
The difference in score is not large, but it's still a bug Change-Id: Ie22c2b6e1206e829c1c8af096469df05af14d47b
-rw-r--r--native/jni/src/binary_format.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/native/jni/src/binary_format.h b/native/jni/src/binary_format.h
index e42589b81..85fdd9418 100644
--- a/native/jni/src/binary_format.h
+++ b/native/jni/src/binary_format.h
@@ -537,7 +537,7 @@ inline int BinaryFormat::computeFrequencyForBigram(const int unigramFreq, const
// 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.