diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-08-15 15:04:11 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-08-15 15:04:11 +0200 |
commit | 0199c2d78c6375e71f055f541ed47d83c14a86f6 (patch) | |
tree | cab417849d1e6ba48b19039ccba38c9f8e96042b /flood.go | |
parent | ef5ab7daa6a5df7794ed0b19a2092009e4adbaf8 (diff) |
Fix overentusiastic flood detector
Diffstat (limited to 'flood.go')
-rw-r--r-- | flood.go | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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 } |