Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding words from Wordnet separated by a fixed Edit Distance from a given word

I am writing a spell checker using nltk and wordnet, I have a few wrongly spelt words say "belive". What I want to do is find all words from wordnet that are separated by a leveshtein's edit distance of 1 or 2 from this given word. Does nltk provide any methods to accomplish this? How to do this?


May be, I put it wrongly. the edit_distance method takes 2 arguments like edit_distance(word1,word2) returns the levenshtein's distance between word1 and word2. What I want is to find edit distance between the word I give with every other word in wordnet.

like image 941
Nihar Sarangi Avatar asked Nov 14 '22 17:11

Nihar Sarangi


1 Answers

It does in fact provide an edit_distance method. See the docs here

like image 104
brc Avatar answered Dec 31 '22 04:12

brc