mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Add a minimum data threshold to CharDistributionAnalysis::GetConfidence() to reduce false positives. Bug 306272, r=jshin, sr=rbs
This commit is contained in:
parent
816d9cf6b1
commit
3e78aa2e92
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user