August 2018
Intermediate to advanced
522 pages
12h 45m
English
A subset of the Gutenberg project is provided and can be freely accessed in this way:
from nltk.corpus import gutenbergprint(gutenberg.fileids())[u'austen-emma.txt', u'austen-persuasion.txt', u'austen-sense.txt', u'bible-kjv.txt', u'blake-poems.txt', u'bryant-stories.txt', u'burgess-busterbrown.txt', u'carroll-alice.txt', u'chesterton- ...
A single document can be accessed as a raw version, or it can be split into sentences or words:
print(gutenberg.raw('milton-paradise.txt'))[Paradise Lost by John Milton 1667] Book I Of Man's first disobedience, and the fruit Of that forbidden tree whose mortal taste...print(gutenberg.sents('milton-paradise.txt')[0:2])[[u'[', u'Paradise', u'Lost', u'by', u'John', u'Milton', u'1667', u']'], ...Read now
Unlock full access