We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2016966 commit c0f1ab5Copy full SHA for c0f1ab5
charade/chardistribution.py
@@ -40,6 +40,7 @@
40
ENOUGH_DATA_THRESHOLD = 1024
41
SURE_YES = 0.99
42
SURE_NO = 0.01
43
+MINIMUM_DATA_THRESHOLD = 3
44
45
46
class CharDistributionAnalysis:
@@ -82,7 +83,7 @@ def get_confidence(self):
82
83
"""return confidence based on existing data"""
84
# if we didn't receive any character in our consideration range,
85
# return negative answer
- if self._mTotalChars <= 0:
86
+ if self._mTotalChars <= 0 or self._mFreqChars <= MINIMUM_DATA_THRESHOLD:
87
return SURE_NO
88
89
if self._mTotalChars != self._mFreqChars:
0 commit comments