jo3-l / obscenity

Robust, extensible profanity filter for NodeJS
MIT License
83 stars 5 forks source link

bug: pattern for "dick" has many false positives #86

Closed eltoder closed 1 week ago

eltoder commented 1 week ago

Expected behavior

It applies to many innocent words like "duck", "dock", "deck", etc.

Actual behavior

    .setMetadata({ originalWord: 'dick' })
    .addPattern((0, Pattern_1.pattern) `d?ck|`)
    .addPattern((0, Pattern_1.pattern) `d?cke[e]s|`)
    .addPattern((0, Pattern_1.pattern) `d?cks|`)

I think this matches all of the above, even though it should not.

Minimal reproducible example

No response

Steps to reproduce

No response

Additional context

No response

Node.js version

v20

Obscenity version

v0.4.0

Priority

Terms

jo3-l commented 1 week ago

I'll get a patch release in today with the above fix. Thanks.

eltoder commented 1 week ago

Thanks! I made exactly the same change locally, so no need to rush.