A Python library for calculating lexical diversity metrics such as TTR, HDD, MTLD, and vocd-D. Version 0.1.1 is current, with an irregular release cadence.
pip install lexical-diversityVerified import paths — ran on the pinned version, not inferred.
Calculate Type-Token Ratio using Flemm's method.
Strip punctuation and lowercase text before passing to MTLD.
Ensure input is a string: ' '.join(tokens) if needed.
Use ' '.join(tokens) to convert the list to a string.
Convert input to string using str() or ensure you pass a proper text string.
No dependency data recorded yet.