filter_text 1.0.2 copy "filter_text: ^1.0.2" to clipboard
filter_text: ^1.0.2 copied to clipboard

A package to filter sensitive text based on specified categories.

example/example.dart

import 'package:filter_text/filter_text.dart';

void main() {
  FilterText filterText = FilterText();

  // Example 1: Using default settings
  String result1 = filterText.filter("This is a test with adult and politics.");
  print(result1); // Filters out sensitive words based on defaults

  // Example 2: Using user-provided sensitive words
  String result2 = filterText.filter(
    "This is a test with drugs and spam. 💔",
    filterTypes: [FilterType.drugs, FilterType.spam, FilterType.longWords],
    userProvidedSensitiveWords: ['test'],
    filterType: FilterType.emojis,
    useUserProvidedOnly: false,
  );
  print(
      result2); // Filters out "test" only, retains default behavior for drugs and spam

  // Example 3: Transforming case
  String result3 = filterText.filter("This is a test string.",
      transformationType: TransformationType.uppercase);
  print(result3); // Outputs: THIS IS A TEST STRING.
}
4
likes
160
points
44
downloads

Publisher

unverified uploader

Weekly Downloads

A package to filter sensitive text based on specified categories.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on filter_text