typtokenratio
Type-token ratio is a measure used in linguistics and natural language processing to quantify lexical diversity. It is calculated by dividing the number of unique words (types) in a text by the total number of words (tokens) in that text. A higher type-token ratio indicates greater lexical richness, meaning a wider variety of words are used relative to the text's overall length. Conversely, a lower ratio suggests more repetition of words.
The type-token ratio is a simple metric, but its interpretation can be influenced by text length. Shorter