summaryrefslogtreecommitdiff
path: root/flood.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-08-15 15:04:11 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-08-15 15:04:11 +0200
commit0199c2d78c6375e71f055f541ed47d83c14a86f6 (patch)
treecab417849d1e6ba48b19039ccba38c9f8e96042b /flood.go
parentef5ab7daa6a5df7794ed0b19a2092009e4adbaf8 (diff)
Fix overentusiastic flood detector
Diffstat (limited to 'flood.go')
-rw-r--r--flood.go7
1 files changed, 2 insertions, 5 deletions
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
}