-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes to redaction #213
changes to redaction #213
Conversation
/gcbrun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, have one comment.
If implemented behavior for RedactionType.REDACT_MONONYM_LN
is as we wanted, it's good to merge, otherwise, please either use the function I provided, or rewrite it accordingly
@@ -104,6 +106,19 @@ def redact_field(field, redact_type): | |||
rv += ' ' | |||
rv += word[0:1] + '***' | |||
redacted_field = rv | |||
elif redact_type == RedactionType.REDACT_MONONYM_LN: | |||
rv = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this function locally, and for Little Red Riding Hood
I get: Little Red R*** H***
is that what we want ?
if we want to redact every word you can use following:
temp = []
words = field.split()
for word in words:
temp.append(word[0:1] + '***')
rv = ' '.join(temp)
return rv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We aren't using REDACT_MONONYM_LN I was working on it and realized this case and when I dug into it we aren't using the modifiers as we have to show the full name. The other use potential problem with the function is when for instance someone is 'Jr.' or 'the III' because these go after the last name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the above stated I have updated the function to properly only redact the last word so Little Red Riding Hood becomes Little Red Riding H*** and Queen Elizabeth II becomes Queen Elizabeth I***
*Issue:*bcgov/entity#23402
Description of changes:
Redaction is now the same (currently) across Staff and Public. The rules have also changed to match the spreadsheet in the ticket.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namex license (Apache 2.0).