зеркало из https://github.com/mozilla/pjs.git
Add a minimum data threshold to CharDistributionAnalysis::GetConfidence() to reduce false positives. Bug 306272, r=jshin, sr=rbs
This commit is contained in:
Родитель
a8b6f71fef
Коммит
0dc20af420
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче