Closed scarroll32 closed 3 years ago
When following the documentation on text_stats I am getting an error about a missing argument.
text_stats
Python 3.8.2 (default, Dec 21 2020, 15:06:04) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import textacy >>> from textacy import datasets, text_stats >>> text = next(textacy.datasets.CapitolWords().texts(limit=1)) >>> doc = textacy.make_spacy_doc(text) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: make_spacy_doc() missing 1 required positional argument: 'lang'
https://textacy.readthedocs.io/en/latest/api_reference/text_stats.html#module-textacy.text_stats.api
>>> import textacy >>> from textacy import datasets, text_stats >>> text = next(textacy.datasets.CapitolWords().texts(limit=1)) >>> doc = textacy.make_spacy_doc(text, lang='en_core_web_md') >>> ts = textacy.text_stats.TextStats(doc) >>> ts.n_words 137 >>> ts.n_unique_words 81 >>> ts.entropy 6.02267943673824 >>> ts.flesch_kincaid_grade_level 9.176341240875914 >>> ts.flesch_reading_ease 59.77429288321167
I'm happy to make a PR on this, but it is this the correct approach or am I doing something wrong here?
Hey @seanfcarroll , thanks for catching this! I made so many changes for v0.11, some docs were bound to fall through the cracks... I'll fix it, no problem.
what's wrong?
When following the documentation on
text_stats
I am getting an error about a missing argument.relevant page or section
https://textacy.readthedocs.io/en/latest/api_reference/text_stats.html#module-textacy.text_stats.api
How to fix
I'm happy to make a PR on this, but it is this the correct approach or am I doing something wrong here?