A corpus is a structured collection of documents or language samples. Counting words across its documents reveals patterns that support linguistic analysis and model development. section 1.5.3
A corpus can support a simple statistical workflow:
- Decode character groups with a Morse or ASCII table. section 1.5.3
- Count words or short sequences and record the documents where they occur. section 1.5.3
- Use the resulting counts as statistical vectors, while recognizing that binning loses information about language. section 1.5.3
Counting words
Counter("Guten Morgen Rosa".split()) produces counts for Guten, Morgen, and Rosa; punctuation and capitalization affect the separate counts in "Good morning Rosa!". section 1.5.3



