A text analyzer

The problem

Build a program that reads a text from the input and reports statistics: the number of lines, words and characters, the most common words, the longest word and how often each letter appears.

Requirements

Technologies

Step by step

  1. Read the lines and count lines, words and characters.
  2. Clean each word: lower case and no punctuation at the ends.
  3. Count the words and letters with maps.
  4. Sort the results by count and then by name, and print the report.

Expected result

A report that is the same on every run and correct for texts with punctuation and accents.

How it is evaluated

Ways to improve it