banwords: Generalized word blacklister

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

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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 && <0.11), data-default (>=0.5 && <0.6), 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 repo head: git clone git://github.com/fanjam/banwords.git
Uploaded by fanjam at 2015-07-14T16:27:32Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2365 total (10 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-07-14 [all 1 reports]

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.