spell checking

Josiah Carlson jcarlson at uci.edu
Mon Nov 1 23:48:29 CET 2004


Erik Heneryd <erik at heneryd.com> wrote:
> 
> dataangel wrote:
> 
> > I was just curious if there were any spell checker python modules around 
> > that can guess at what the user meant to type in. I wrote up a quick 
> > function that splices a string up into bigrams and then checks how many 
> > bigrams are identical to a given word, which I think is how google does 
> > it. But support for trigrams etc. could be added, so I'm curious if 
> > anyone out there has done something more. Here's the script:
> 
> One tip is Levenshtein distance.  Some pointers:
> 
> http://www.merriampark.com/ld.htm
> http://www.hetland.org/python/distance.py
> http://trific.ath.cx/resources/python/levenshtein/

The problem with Levenshtein distance is that you must compute it for
all other words in your dictionary, if your word is not in your
dictionary.  Quite expensive.  Not the right thing to do.

 - Josiah




More information about the Python-list mailing list