Aproximative string matching

Tim Heaney theaney at cablespeed.com
Mon Nov 21 08:02:44 EST 2005


"javuchi" <javuchi at gmail.com> writes:

> I'm searching for a library which makes aproximative string matching,
> for example, searching in a dictionary the word "motorcycle", but
> returns similar strings like "motorcicle".
>
> Is there such a library?

I kind of like the one at 

  http://www.personal.psu.edu/staff/i/u/iua1/python/apse/

which you might use something like

  >>> import Apse
  >>> ap = Apse.Approx('motorcycle', edit=1)
  >>> ap.match(['motorcycle', 'motorcicle', 'motorscooter'])
  ['motorcycle', 'motorcicle']

That page mentions several alternatives, as well.

I hope this helps,

Tim



More information about the Python-list mailing list