Skip to content

Download cmudict if not found in path#215

Merged
alxwrd merged 1 commit intotextstat:mainfrom
mitanshu7:fix_nltk_download
Nov 4, 2025
Merged

Download cmudict if not found in path#215
alxwrd merged 1 commit intotextstat:mainfrom
mitanshu7:fix_nltk_download

Conversation

@mitanshu7
Copy link
Contributor

I was trying to run textstat in an AWS lambda environment, and the nltk.download('cmudict', quiet=True) function is triggering an OSError since we do not get write rights in any directory other than /tmp.

I have updated the code to first look for the already downloaded corpus, and only download if it does not find it.

Copy link
Member

@alxwrd alxwrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitanshu7 thanks for this 🎉

@alxwrd alxwrd merged commit 0db2bc4 into textstat:main Nov 4, 2025
6 checks passed
@alxwrd
Copy link
Member

alxwrd commented Nov 5, 2025

Released as 0.7.11 - https://github.com/textstat/textstat/releases

@mitanshu7
Copy link
Contributor Author

Thank you, @alxwrd!

@mitanshu7 mitanshu7 deleted the fix_nltk_download branch November 5, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants