Skip to content

bug/feature: Spaced profanity not picked up #98

Description

@IvanYu327

Expected behavior

Entering f u c k and f u ck using the default english match should count as profanity.

Actual behavior

Entries like fu ck are picked up but f u c k and f u ck are not. So is s h i t and any other similarly spaced profanity.

Minimal reproducible example

import {
  englishDataset,
  englishRecommendedTransformers,
  RegExpMatcher,
} from "obscenity";

const matcher = new RegExpMatcher({
  ...englishDataset.build(),
  ...englishRecommendedTransformers,
});

export function containsProfanity(text: string): boolean {
  return matcher.hasMatch(text);
}

console.log(containsProfanity("f u c k"))

Steps to reproduce

No response

Additional context

No response

Node.js version

v20.11.0

Obscenity version

v0.4.3

Priority

  • Low
  • Medium
  • High

Terms

  • I agree to follow the project's Code of Conduct.
  • I have searched existing issues for similar reports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions