Skip to content

Instantly share code, notes, and snippets.

@seangtkelley
Created June 26, 2018 20:05
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 seangtkelley/7d511f823dcea39c897d5ea848c236c2 to your computer and use it in GitHub Desktop.
Save seangtkelley/7d511f823dcea39c897d5ea848c236c2 to your computer and use it in GitHub Desktop.
cachedStopWords = stopwords.words("english")
punct = set(string.punctuation)
female_text = ' '.join(female_titles)
male_text = ' '.join(male_titles)
female_text = ''.join(ch for ch in female_text if ch not in punct)
male_text = ''.join(ch for ch in male_text if ch not in punct)
female_text = ' '.join([word for word in female_text.split() if word not in cachedStopWords])
male_text = ' '.join([word for word in male_text.split() if word not in cachedStopWords])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment