The banwords package

[ Tags: deprecated, heuristics, library, mit ] [ Propose Tags ]
Deprecated.

[Skip to Readme]

Properties

Versions 0.1.0.0, 0.2.0.0, 0.2.0.1
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
Maintainer ian@housejeffries.com
Category Heuristics
Home page https://github.com/fanjam/banwords
Source repository head: git clone git://github.com/fanjam/banwords.git
Uploaded Tue Jul 14 16:27:32 UTC 2015 by fanjam
Distributions NixOS:0.2.0.1
Downloads 413 total (4 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-07-14 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for banwords-0.2.0.1

[back to package description]

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.