raymondjavaxx / swearjar-node

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

Censoring a word should sufficiently hint as to what was removed #20

Open swhisnant opened 5 years ago

swhisnant commented 5 years ago

Censoring a word should conceal its characters while still allowing the reader to use context clues to understand the sentence it was in, otherwise, the entire sentence may not be understood.

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('Don\'t snatch your little sister\'s toys.')


Expected:

Console should display:
```javascript
'Don\'t s****h your little sister\'s toys.'

or

'Don\'t s***** your little sister\'s toys.'

Actual:

Console displays:

'Don\'t ****** your little sister\'s toys.'