chore: set insanity_threshold dynamically
This commit is contained in:
parent
c6215e6146
commit
fce2c7c0de
@ -70,8 +70,9 @@ class da_detector:
|
||||
t_len = len(text)
|
||||
# list of random n-grams
|
||||
r_ngrams = []
|
||||
# how many times to attempt to skin the cat
|
||||
insanity_threshold = 1000
|
||||
# how many times to attempt to skin the cat, dynamically set depending
|
||||
# on total length of the subject text examined
|
||||
insanity_threshold = t_len * 20
|
||||
sanity_ctr = 0
|
||||
|
||||
while (len(r_ngrams) < how_many and sanity_ctr < insanity_threshold):
|
||||
|
Reference in New Issue
Block a user