banwords: Generalized word blacklister

[ deprecated, heuristics, library, mit ] [ Propose Tags ]
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 Tue Jul 14 16:27:32 UTC 2015
Distributions NixOS:
Downloads 831 total (9 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-07-14 [all 1 reports]
Hackage Matrix CI

[Skip to Readme]




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.