Skip to content

Instantly share code, notes, and snippets.

@glickmac
Created December 20, 2019 15:59
Show Gist options
  • Save glickmac/1592f8a038678cc00412f40a8565fa99 to your computer and use it in GitHub Desktop.
Save glickmac/1592f8a038678cc00412f40a8565fa99 to your computer and use it in GitHub Desktop.
# Change the URL
url = 'http://www.gutenberg.org/files/16/16-0.txt'
# Edit the string split to pull the story
text = str(text)
text = text.split("Chapter 1 PETER BREAKS THROUGH")[2].split("THE END")[0]
text = text.replace("\n", " ").replace("\r", " ").replace("\\r", " ").replace("\\n", " ").replace("_", "").lower()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment