From 0199c2d78c6375e71f055f541ed47d83c14a86f6 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 15 Aug 2015 15:04:11 +0200 Subject: Fix overentusiastic flood detector --- flood.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'flood.go') diff --git a/flood.go b/flood.go index 9ba541e..ae9afaf 100644 --- a/flood.go +++ b/flood.go @@ -13,11 +13,8 @@ func Flood(s string) bool { return false } v := strings.Fields(s) - if CommonWord(v) >= len(v)/2 { - return true - } - if len(v) >= 10 && MedianLength(v) == 1 { - return true + if len(v) >= 4 { + return CommonWord(v) >= len(v)/2 || MedianLength(v) == 1 } return false } -- cgit v1.2.3