Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example 4.4 (code_freq_words2.py) typo and Example 4.3 (code_freq_words1.py) outdated link #255

Open
data-wombat opened this issue Jan 19, 2022 · 0 comments

Comments

@data-wombat
Copy link

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).

Thank you for the excellent resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant