Add a minimum data threshold to CharDistributionAnalysis::GetConfidence() to reduce false positives. Bug 306272, r=jshin, sr=rbs

This commit is contained in:
smontagu%smontagu.org 2006-08-08 10:35:30 +00:00
Родитель a8b6f71fef
Коммит 0dc20af420
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -46,11 +46,15 @@
#define SURE_YES 0.99f
#define SURE_NO 0.01f
#define MINIMUM_DATA_THRESHOLD 4
//return confidence base on received data
float CharDistributionAnalysis::GetConfidence()
{
//if we didn't receive any character in our consideration range, return negative answer
if (mTotalChars <= 0)
//if we didn't receive any character in our consideration range, or the
// number of frequent characters is below the minimum threshold, return
// negative answer
if (mTotalChars <= 0 || mFreqChars <= MINIMUM_DATA_THRESHOLD)
return SURE_NO;
if (mTotalChars != mFreqChars) {