(Optional, Only 1.5.2) The soundex module implements a simple hash algorithm, which converts words to 6-character strings based on their English pronunciation.
As of Version 2.0, this module is no longer included.
get_soundex(word) returns the soundex string for the given word. Words that sound similar should give the same soundex string. sound_similar(word1, word2) returns true if the two words have the same soundex. Example 14-24 uses both functions.
File: soundex-example-1.py import soundex a = "fredrik" b = "friedrich" print soundex.get_soundex(a), soundex.get_soundex(b) print soundex.sound_similar(a, b) F63620 F63620 1
Core Modules
More Standard Modules
Threads and Processes
Data Representation
File Formats
Mail and News Message Processing
Network Protocols
Internationalization
Multimedia Modules
Data Storage
Tools and Utilities
Platform-Specific Modules
Implementation Support Modules
Other Modules