Skip to content

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

@data-wombat

Description

@data-wombat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions