Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug/feature: Spaced profanity not picked up #98

Open
3 of 5 tasks
IvanYu327 opened this issue Mar 11, 2025 · 0 comments
Open
3 of 5 tasks

bug/feature: Spaced profanity not picked up #98

IvanYu327 opened this issue Mar 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@IvanYu327
Copy link

IvanYu327 commented Mar 11, 2025

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.
@IvanYu327 IvanYu327 added the bug Something isn't working label Mar 11, 2025
@IvanYu327 IvanYu327 changed the title bug: Profanity not picked up bug: Spaced profanity not picked up Mar 12, 2025
@IvanYu327 IvanYu327 changed the title bug: Spaced profanity not picked up bug/feature: Spaced profanity not picked up Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant