In 4.3, constitution = "http://www.archives.gov/exhibits/charters/constitution_transcript.html" now goes to a redirected homepage, and the following exercises' outputs look very different as a result. The new URL should be https://www.archives.gov/founding-docs/constitution-transcript.
In 4.4. the last two lines of the function are:
freqdist = nltk.FreqDist(word.lower() for word in word_tokenize(text))return [word for (word, _) in fd.most_common(n)]
In the last line, fd.most_common(n) should be freqdist.most_common(n).
In 4.3,
constitution = "http://www.archives.gov/exhibits/charters/constitution_transcript.html"
now goes to a redirected homepage, and the following exercises' outputs look very different as a result. The new URL should be https://www.archives.gov/founding-docs/constitution-transcript.In 4.4. the last two lines of the function are:
freqdist = nltk.FreqDist(word.lower() for word in word_tokenize(text))
return [word for (word, _) in fd.most_common(n)]
In the last line,
fd.most_common(n)
should befreqdist.most_common(n)
.Thank you for the excellent resource.