Skip to content

Commit 660b9f0

Browse files
author
blechdom
committed
fixed travis errors
1 parent d1cc395 commit 660b9f0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

speech/cloud-client/transcribe_dlp.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ def deidentify(file_name, project_id):
9090
# Currently social security numbers and credit card numbers
9191
# are interpreted as phone numbers
9292

93-
regex = (r".([A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`"
94-
r"{|}~-]+)*)(\sat\s+)((?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+"
95-
r"[a-z0-9](?:[a-z0-9-]*[a-z0-9]))")
93+
regex = (
94+
r".([A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`"
95+
r"{|}~-]+)*)(\sat\s+)((?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+"
96+
r"[a-z0-9](?:[a-z0-9-]*[a-z0-9]))"
97+
)
9698

9799
updated_transcript = re.sub(regex, r" \1@\3", transcript)
98100

@@ -108,7 +110,7 @@ def deidentify(file_name, project_id):
108110

109111
# Print out the results.
110112
print('Final Result with sensitive content redacted: {}'
111-
.format(dlp_response.item.value))
113+
.format(dlp_response.item.value))
112114
# [END dlp_deidentify_masking]
113115

114116

0 commit comments

Comments
 (0)