profanity_filter
2.0.0, released 5 years ago by an unverified publisher
Check and censor strings against profanity and obscene words with a built-in English list.
What it does
Provides a simple Dart class to detect profanity, retrieve profane words, and censor strings. Includes a default English word list from LDNOOBW and supports custom words, additions, and exclusions.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to check user input for profanity in chat or comments.
- You want to automatically censor bad words in strings with customizable lists.
Skip it when
- You need advanced natural language processing beyond simple dictionary lookup.
Strengths
- Includes a default English profanity word list out of the box.
- Supports custom lists, additions, and exclusions.
- Case-agnostic censorship and exact substring matching.
Weaknesses
- Relies on a static word list which may miss creative spellings or context-dependent slurs.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
final filter = ProfanityFilter();
String badString = 'You are an ass';
bool hasProfanity = filter.hasProfanity(badString);
String cleanString = filter.censor(badString);Alternatives
Packages that do the same job and could replace profanity_filter.
- validators2
String validation and sanitization for Dart.
83Compare - pluralize
Pluralize and singularize any word and check if it is singular or plural.
50Compare - simple_mustache
Dart implementation of a mustache subset for simple String templates with filters.
47Compare - alphanum_comparator
Sorts string lists alphanumerically using The Alphanum Algorithm.
55Compare