solvvy / redact-pii

Remove personally identifiable information from text.
MIT License
187 stars 56 forks source link

Example from documentation doesn't work #70

Open erezarnon opened 1 year ago

erezarnon commented 1 year ago
const redactor = new SyncRedactor({
  builtInRedactors: {
    names: {
      replaceWith: 'ANONYMOUS_PERSON'
    }
  }
});

redactor.redact('Dear David Johnson');

Expected: Dear ANONYMOUS_PERSON Actual: Dear PERSON_NAME

Also, ideally we could pass in replaceWith: 'REDACTED__$3' which would allow to do some post-processing and keep track of what's being redacted.

const redactor = new SyncRedactor({
  builtInRedactors: {
    names: {
      replaceWith: 'REDACTED__$3'
    }
  }
});

redactor.redact('Dear David Johnson');

Expected: Dear REDACTED__David REDACTED__Johnson

alvis commented 11 months ago

I've the same problem. Seems like exactly the same as #34 and fixed by #46