7.4.3. Ch07 Lab — Text Analysis with Dictionaries#

7.4.3.1. Overview#

In this lab you will analyze a text file using dictionaries and Counter to answer questions about word usage.

7.4.3.2. Part 1 — Load and Clean (recall)#

Load any plain-text file (e.g. a Project Gutenberg book) and build a cleaned word frequency dictionary: lowercase, strip punctuation, exclude words shorter than 3 characters.

# Your solution here

7.4.3.3. Part 2 — Top Words (application)#

Use Counter to find the 10 most common words. Display them as a table (word, count).

# Your solution here

7.4.3.4. Part 3 — Word Length Groups (extension)#

Build a dictionary that groups words by length. Report:

  • The number of words in each length group

  • The five most common word lengths

  • One example word from each of the five most common groups

# Your solution here