INTRODUCTION
------------
Soundex is an algorithm that hashes English strings into
alpha-numerical values. Strings that sound the same are transformed
into the same value. This allows for non-literal string matching.
FILES
-----
README This file.
soundexmodule.c C source file that extends Python interpreter
with soundex and sound_similar methods.
soundex.py Python source that implements soundex and
sound_similar methods. This code is slow.
INSTALLATION
------------
You can import the soundex.py file into your Python program to see if
you want to use this algorithm. If it turns out to be too slow for
your application, then you can extend your Python interpreter with the
C module by following these directions.
Copy soundexmodule.c into your python/Modules directory. Edit
Setup. Add the following lines if they are not present.
# David Williams' soundex string comparison module.
#
soundex soundexmodule.c
Now go to the Python root directory and type make. The soundex module
will then be available in the new interpreter.
USAGE
-----
Python 1.2 (May 3 1995) [GCC 2.4.5]
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import soundex
>>> soundex.soundex("David")
'D13000'
>>> soundex.soundex("Dabid")
'D13000'
>>> soundex.sound_similar("Calahan","Callaham")
1
>>> if soundex.sound_similar("Guido","God"):
.. print "Python is cool!"
..
Python is cool!
MODULE METHODS
--------------
string soundex(string)
Soundex returns the soundex hash string value of an input string.
integer sound_similar(string, string)
Return 1 if the input strings sound similar. Return 0 otherwise. Two
strings sound similar if they have the same soundex hash value.
AUTHOR
------
David Williams
[email protected]
I.U. Cyclotron Facility
http://www.iucf.indiana.edu/~dwwillia
Network Administrator / Programmer Linux, PGP, the Web: I love this NET!