0

Could anyone please help me to fix this? I am trying to install pyenchant in colab to perform a possible suggestion if a word is spelled wrongly. I would like to use pyenchant. This is what I tried;

!pip install pyenchant==1.6.8 

but it output the following error;

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

My idea is to get some possible suggestion if a word is wrong, I plan to do the following

import enchant
test = enchant.Dict("en_US")
test.suggest("Posible")

Could anyone suggest how can I achieve this? I am working on colab. Please help me on how to install pyenchant in colab or any other possible way I can achieve possible suggestion if a word is wrong.

2 Answers 2

2

You need to install with apt first

!apt install enchant

Then with pip

!pip install pyenchant
Sign up to request clarification or add additional context in comments.

Comments

1

Another possibility based on NLTK without enchant is NLTK's words corpus

>>> from nltk.corpus import words
>>> "would" in words.words()
True
>>> "could" in words.words()
True
>>> "should" in words.words()
True
>>> "I" in words.words()
True
>>> "you" in words.words()
True

Or if you still want to use enchant https://stackoverflow.com/a/57444274/11339475 Have look at this solution, It has already been addressed.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.