File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 2727LEVEN_DOMAIN_DISTANCE = 3
2828SIMILAR_THRESHOLD = 0.95
2929SIMILAR_ANSWER_THRESHOLD = 0.7
30- BODY_TITLE_SIMILAR_THRESHOLD = 0.99 # That's enough
30+ BODY_TITLE_SIMILAR_THRESHOLD = 0.90
3131CHARACTER_USE_RATIO = 0.42
3232REPEATED_CHARACTER_RATIO = 0.20
3333EXCEPTION_RE = r"^Domain (.*) didn't .*!$"
@@ -731,9 +731,12 @@ def mostly_dots(s, *args):
731731
732732 body = strip_urls_and_tags (body )
733733
734- dot_count = len (regex .findall (r"\." , body ))
734+ dot_count = body .count ("." )
735+ s = strip_urls_and_tags (s )
736+ if not s :
737+ return False , ""
735738
736- if dot_count / float ( len (s ) ) >= 0.4 :
739+ if dot_count / len (s ) >= 0.4 :
737740 return True , u"Post contains {} dots out of {} characters" .format (dot_count , len (s ))
738741 else :
739742 return False , ""
You can’t perform that action at this time.
0 commit comments