don't feature shouting post topics

This commit is contained in:
Thibault Duplessis 2017-11-23 23:30:20 -05:00
parent bbcee7c31e
commit 2346af8256

View file

@ -42,7 +42,14 @@ object DataForm {
) {
def looksLikeVenting = List(name, post.text) exists { txt =>
ventingPattern.matcher(txt).find
mostlyUpperCase(txt) || ventingPattern.matcher(txt).find
}
}
private def mostlyUpperCase(txt: String) = {
val extract = txt.take(300)
(extract.contains(' ') || extract.size > 5) && {
extract.count(_.isUpper) > extract.count(_.isLower) * 2
}
}