Skip to content

fix: add common English words to false positives list (#32) - #41

Merged
deemonic merged 1 commit into
mainfrom
fix/false-positive-common-words
Jan 27, 2026
Merged

deemonic merged 1 commit into
mainfrom
fix/false-positive-common-words

Conversation

@deemonic

@deemonic deemonic commented Jan 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds ~200 common English words to the false_positives list that contain profanity substrings (e.g. "ass" in "assignment", "tit" in "title", "cum" in "document", "nig" in "night")
  • Covers words containing: ass, tit, cum, nig, rap, nob
  • Adds 11 tests verifying common words are not flagged while actual profanity still is

Closes #32

Test plan

  • All 180 tests pass (including 10 new data-driven cases)
  • "assignment", "passion", "classroom", "passenger", "assassin", "massive", "embassy", "harassment", "compassion", "association" all clean
  • Standalone "ass" still detected
  • All existing profanity detection rates unchanged (English 100%, German 100%, Spanish 99.49%, French 98.12%)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Expanded profanity filter datasets with additional common terms and false positive handling to improve accuracy of content moderation.
  • Tests

    • Added comprehensive test suite to verify legitimate words are not incorrectly flagged while maintaining detection of actual profanities.

✏️ Tip: You can customize this high-level summary in your review settings.

Words like "assignment", "passion", "classroom", "passenger" were
falsely flagged because they contain the substring "ass". Expanded
the false_positives list with ~200 common English words containing
profanity substrings (ass, tit, cum, nig, rap, nob).

Closes #32

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jan 27, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The pull request addresses false positive detection in the Blasp profanity filter by expanding the false_positives configuration with legitimate words containing common profanity substrings (e.g., "ass", "tit", "cum"), and introduces test coverage to verify legitimate words are not flagged as profane while actual profanity remains detected.

Changes

Cohort / File(s) Summary
Configuration Data
config/languages/english.php
Added 241 lines of legitimate words grouped by profanity substring cues to the false_positives array. Words grouped by patterns such as "ass" (assignment, passion, classroom), "tit" (constitution), "cum" (circumstance), "ho/hoe" (household), "nig" (legitimate terms), "rap" (wrap), and "nob" variants. These entries prevent substring-based false positives while maintaining profanity detection.
Test Coverage
tests/Issue32FalsePositiveTest.php
New PHPUnit test file validating the false positive fix. Includes test_legitimate_words_not_flagged (parameterized with provider of common legitimate words) to ensure they are not flagged as profanity, and test_actual_profanity_still_detected to confirm actual profanities like "ass" are still correctly detected.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

A rabbit's filter now runs true,
"Assignment" passes right on through!
False flags are gone, the words ring clear,
No more false positives we fear! 🐰✨
Legitimate words dance and play,
While actual profanity stays away.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding common English words to the false positives list to address issue #32.
Linked Issues check ✅ Passed The PR partially addresses the linked issue by adding false positives entries, but does not implement the suggested architectural solutions (whole-word matching or override hooks) that were requested.
Out of Scope Changes check ✅ Passed All changes directly support the goal of reducing false positives: expanding the false_positives list and adding comprehensive test coverage for the fix.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Docstrings were successfully generated.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented Jan 27, 2026 •

Copy link
Copy Markdown

Caution

Docstrings generation - FAILED

No docstrings were generated.

@deemonic
deemonic merged commit c4037af into main Jan 27, 2026
3 checks passed
@deemonic
deemonic deleted the fix/false-positive-common-words branch January 27, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive detection for words containing "ass" (e.g. "assignment", "passion", etc.)

1 participant