Deprecated

banwords

Generalized word blacklister https://github.com/fanjam/banwords

Latest on Hackage:0.2.0.1

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

MIT licensed by Ian Grant Jeffries
Maintained by ian@housejeffries.com

Intro

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

Example

{-# 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.
comments powered byDisqus