[go: nahoru, domu]

Skip to content

v0.5.0

Compare
Choose a tag to compare
@LSYS LSYS released this 06 Mar 06:30
· 1 commit to master since this release
27995dc

What's Changed

  • Add new measures #65
    • Yule's K
    • Yule's I
    • Herdan's Vm
    • Simpson's D
  • Add new measures to example notebook (example.ipynb) #70
  • Add new measures to docs #71
  • Add the example.ipynb to the docs #72
  • Tidy up imports using isort #69

LexicalRichness

To install: pip install lexicalrichness

Example usage

from lexicalrichness import LexicalRichness

# text example
text = """Measure of textual lexical diversity, computed as the mean length of sequential words in
                a text that maintains a minimum threshold TTR score.

                Iterates over words until TTR scores falls below a threshold, then increase factor
                counter by 1 and start over. McCarthy and Jarvis (2010, pg. 385) recommends a factor
                threshold in the range of [0.660, 0.750].
                (McCarthy 2005, McCarthy and Jarvis 2010)"""

lex = LexicalRichness(text)

lex.vocd_fig(
    ntokens=50,  # Maximum number for the token/word size in the random samplings
    within_sample=100,  # Number of samples
    seed=42,  # Seed for reproducibility
)

image

Full Changelog: v0.4.1...v0.5.0