raymondjavaxx / swearjar-node

Profanity detection and filtering library.
MIT License
73 stars 33 forks source link

Censored words should be ranked and proper nouns excluded based on severity #19

Open swhisnant opened 5 years ago

swhisnant commented 5 years ago

Steps to reproduce:

  1. Load swearjar-node (I did so by running npm install --no-save swearjar in an empty temporary directory)
  2. Run the following in the node.js console:
    
    const swearjar = require('swearjar')

swearjar.censor('Mick Jagger') swearjar.censor('Dick Tracy')


Expected:

Console should display:
```javascript
'Mick Jagger'
'Dick Tracy'

Actual:

Console displays:

'**** Jagger'
'**** Tracy'

This is affecting a use case where thousands of license texts are processed with this module and at least one of the authors' first names is Mick. Perhaps an easy solution to this would be to add a new category to these specific entries and allow excluding that category when methods of swearjar are called.