Skip to main content

Heaps' law and Heaps functions in tagged texts: Evidences of their linguistic relevance

Cite this dataset

Zanette, Damián; Chacoma, Andrés (2020). Heaps' law and Heaps functions in tagged texts: Evidences of their linguistic relevance [Dataset]. Dryad.


We study the relationship between vocabulary size and text length in a corpus of 75 literary works in English, authored by six writers, distinguishing between the contributions of three grammatical classes (or ``tags,'' namely, nouns, verbs, and others), and analyze the progressive appearance of new words of each tag along each individual text. We find that, as prescribed by Heaps' law, vocabulary sizes and text lengths follow a well-defined power-law relation. Meanwhile, the appearance of new words in each text does not obey a power law, and is on the whole well described by the average of random shufflings of the text. Deviations from this average, however, are statistically significant and show systematic trends across the corpus. Specifically, we find that the appearance of new words along each text is predominantly retarded with respect to the average of random shufflings. Moreover, different tags add systematically distinct contributions to this tendency, with verbs and others being respectively more and less retarded than the mean trend, and nouns following instead the overall mean. These statistical systematicities are likely to point to the existence of linguistically relevant information stored in the different variants of Heaps' law, a feature that is still in need of extensive assessment.


The original versions of the corpus files were obtained from the public domain (, and processed to eliminate spurious text, not belonging to the original works. Computational codes were produced by the authors.

Usage notes

This file collection is a complete version of the analyzed corpus, and of the codes used to perform the analysis.

This dataset contains (1) plain-text files with the texts of  75 literary works in English, used in the analysis of Heaps' law both accross the corpus and within each work, as explained in the manuscript RSOS-200008 submitted to Royal Society Open Science, and (2) six Python codes to perform the Heaps analysis of the texts, plus three auxiliary files used by the codes.