am e382bcc3: am 8f9f55dd: Merge "Fix a bug where the bigram freq would be underevaluated" into jb-dev

* commit 'e382bcc39aa6aa64504a0fcd2ca59ad09dda0d25':
  Fix a bug where the bigram freq would be underevaluated
main
Jean Chalard 2012-05-29 00:27:54 -07:00 committed by Android Git Automerger
commit 14c72f071e
1 changed files with 1 additions and 1 deletions

View File

@ -537,7 +537,7 @@ inline int BinaryFormat::computeFrequencyForBigram(const int unigramFreq, const
// while a value of 15 represents the middle of the top step. // while a value of 15 represents the middle of the top step.
// See makedict.BinaryDictInputOutput for details. // See makedict.BinaryDictInputOutput for details.
const float stepSize = ((float)MAX_FREQ - unigramFreq) / (1.5f + MAX_BIGRAM_FREQ); 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. // This returns a probability in log space.