Fuzzy string matching?

Hans Nowak hnowak at cuci.nl
Thu Aug 26 19:44:56 CEST 1999


...Anyone know of such a beast in Python?

The background is this... I want to write a deck managing program for 
Magic the Gathering (or other CCGs or similar games). The program has 
a collection of cards it knows (ideally, all kinds of cards in 
existance). Now I want people to enter decks, by entering names of 
cards. However, since some card names are quite difficult or have 
funny characters in them, I expect that some of their input will not 
be recognized in the card database. In such cases, I would like to 
present the user with a list of card names which match the input 
closely, but not entirely... strings that 'almost match'. OK, so it's 
just a fuzzy string match. Is such a thing done in Python already? If 
not, would it be difficult to do? (I obviously don't how to do it 
myself otherwise I would have done so already... :-/  )

TIA,

--Hans Nowak (zephyrfalcon at hvision.nl)
Homepage: http://fly.to/zephyrfalcon
Python Snippets: http://www.hvision.nl/~ivnowa/snippets/
The Purple Kookaburra Forum: http://www.delphi.com/kookaburra/




More information about the Python-list mailing list