banwords: Generalized word blacklister

[ deprecated, heuristics, library, mit ] [ Propose Tags ]

[Skip to Readme]
Versions [RSS] [faq],,
Dependencies attoparsec (>=0.12.1 && <0.14), base (>=4.6 && <5.0), bytestring (==0.10.*), data-default (==0.5.*), text (>=1.1 && <1.3), vector (>=0.10.12 && <0.11) [details]
License MIT
Author Ian Grant Jeffries
Category Heuristics
Home page
Source repo head: git clone git://
Uploaded by fanjam at 2015-07-14T16:27:32Z
Distributions NixOS:
Downloads 2115 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2015-07-14 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees


Readme for banwords-

[back to package description]


A few tools for checking if a word is a close match against a blacklist.


{-# LANGUAGE OverloadedStrings #-}

module Main where

import Data.Monoid
import Data.Text (Text)
import Data.Vector (Vector)
import qualified Data.Vector as V
import Heuristics.BanWords

main :: IO ()
main =
  case passBlacklist banAlmostExact blacklist "acme " of
    Nothing -> putStrLn "Blocked 'acme '"
    Just _  -> error "This shouldn't happen!"

blacklist :: Vector Text
blacklist = exampleReserved -- Includes "admin", "security", and a few others.
         <> V.fromList ["gosh", "darn"] -- Supply your own profanity list.
         <> V.fromList ["acme"] -- Prevent users from impersonating your company.