from pattern.en import conjugate get zipfile.BadZipFile error
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
I dived into source code and found that in pattern\text\en\wordnet\__init__.py
when trying get necessary corpora of nltk, the code(as below) doesn't handle zipfile.BadZipFile: File is not a zip file error
for token in ("wordnet", "wordnet_ic", "sentiwordnet"):
try:
nltk.data.find("corpora/" + token)
And I find that download these packages("wordnet", "wordnet_ic", "sentiwordnet") from nltk mannually can fix this bug.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pattern\text\en\wordnet_init_.py and inspect the loop that calls nltk.data.find for wordnet, wordnet_ic, and sentiwordnet. Reproduce the import with a corrupted corpus archive, then verify that the BadZipFile case is handled and that manually downloaded corpora still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100