Skip to content

Instantly share code, notes, and snippets.

@YiLi225
Last active May 5, 2022 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YiLi225/97221bd2ee84689d81ebc6880cb82642 to your computer and use it in GitHub Desktop.
Save YiLi225/97221bd2ee84689d81ebc6880cb82642 to your computer and use it in GitHub Desktop.
import re
# curText = doc_set[122001]
curText = '''
six months ago we thought it would be a fun idea to release our album on election day but this is not the election to be cute .
we felt as though rather than making a commentary we were only riding the wave of the election . this seemed less and less like what we
intended to do and more of a gimmick .
'''
## Replace the words 'day', 'we', 'is'
print(' '.join(re.sub(r'|'.join(map(re.escape, ['day', 'we', 'is'])), ' ', curText).split()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment