diff options
author | Genqing Wu <wugenqing@android.com> | 2009-04-29 14:41:43 +0800 |
---|---|---|
committer | Genqing Wu <wugenqing@android.com> | 2009-05-04 11:28:02 +0800 |
commit | 7ebaf2381c91649d700097491af171c7e486bf6f (patch) | |
tree | a80a134ed0865a5d4c2828ed283834eb0c3579ca | |
parent | 8fb7e16cb2c271cb378c2d395594955369e2fb47 (diff) | |
download | PinyinIME-7ebaf2381c91649d700097491af171c7e486bf6f.tar.gz |
PinyinIME - Fix a bug in score compensation.
After user adds new words to user dictionary, the compensation score for system
dictionary was wrongly computed. The numerator should be kSysDictTotalFreq, not
total_freq_none_sys_. This commit fixes this bug.
-rw-r--r-- | jni/share/ngram.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/jni/share/ngram.cpp b/jni/share/ngram.cpp index d95477a..104b853 100644 --- a/jni/share/ngram.cpp +++ b/jni/share/ngram.cpp @@ -218,7 +218,7 @@ void NGram::set_total_freq_none_sys(size_t freq_none_sys) { if (0 == total_freq_none_sys_) { sys_score_compensation_ = 0; } else { - double factor = static_cast<double>(total_freq_none_sys_) / ( + double factor = static_cast<double>(kSysDictTotalFreq) / ( kSysDictTotalFreq + total_freq_none_sys_); sys_score_compensation_ = static_cast<float>( log(factor) * kLogValueAmplifier); |