For the given user input, get similar words through Enchant module.
Enchant is a module in python which is used to check the spelling of a word, gives suggestions to correct words. Also, gives antonym and synonym of words. It checks whether a word exists in dictionary or not. Other dictionaries can also be added, as, (“en_UK”), (“en_CA”), (“en_GB”) etc.
To install enchant :
pip install pyenchant
Input : Helo Output : Hello, Help, Hero, Helot, Hole Input : Trth Output : Truth, Trash, Troth, Trench
Below is the implementation :
Enter word: aple ['pale', 'ale', 'ape', 'maple', 'ample', 'apple', 'plea', 'able', 'apse']
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python - Spelling checker using Enchant
- Python - Tokenize text using Enchant
- Python - Filtering text using Enchant
- Python - Chunking text using Enchant
- Python - Find the Levenshtein distance using Enchant
- enchant.list_languages() in Python
- enchant.dict_exists() in Python
- enchant.Dict() in Python
- enchant.DictWithPWL() in Python
- enchant.request_pwl_dict() in Python
- enchant.get_enchant_version() in Python
- enchant.request_dict() in Python
- Python - Group Similar Start and End character words
- Combine similar characters in Python using Dictionary Get() Method
- Python - Get number of characters, words, spaces and lines in a file
- Python program to crawl a web page and get most frequent words
- Detecting obects of similar color in Python using OpenCV
- Python | Extract similar index elements
- Python | Add similar value multiple times in list
- Python | Grouping similar substrings in list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.