Last updated:
0 purchases
flutter profanity filter
Profanity Filter #
Profanity Filter is a Dart package that helps you detect and censor profanity in text strings. It provides a simple API to check if a given text contains profanity and to censor profanity by replacing it with asterisks.
Installation #
To use Profanity Filter in your Dart project, add it to your pubspec.yaml file:
dependencies:
flutter_profanity_filter: ^0.0.2
copied to clipboard
// example/main.dart
import 'package:flutter_profanity_filter/profanity_filter.dart';
void main() {
final filter = ProfanityFilter();
// Check if a text contains profanity
print(filter.hasProfanity('This is a fuck')); // true
print(filter.hasProfanity('This is clean')); // false
// Censor profanity in a text
print(filter.censor('This is a fuck')); // 'This is a *******'
print(filter.censor('This is clean')); // 'This is clean'
}
copied to clipboard
Supported languages:
English
Spanish
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.