Compute phonetic key of strings for indexing or fuzzy matching
The phonetics module computes the phonetic key of a string using different algorithms.
- Double Metaphone
Table of contents
pip install phonetics
Pull and install in the current directory:
pip install -e git+https://github.com/Zack--/phonetics.git@master#egg=phonetics
>>> import phonetics >>> phonetics.dmetaphone('Danger') ('TNJR', 'TNKR')
The phonetics module defines the following function:
- phonetics. soundex(source [, size=4])
- Use the soundex algorithm to create the phonetic key of the source string.
- phonetics. nysiis(source)
- Use the New York State Identification and Intelligence System to create the phonetic key of the source string.
- phonetics. metaphone(source)
- Use the metaphone algorithm to create the phonetic key of the source string.Based on Lawrence Philips’ Metaphone Algorithm.
- phonetics. dmetaphone(source)
- Use the double methaphone algorithm to create the phonetic key of the source string.Based on Lawrence Philips’ Metaphone Algorithm.
All source code is hosted on GitHub. Contributions are welcome.
See the CONTRIBUTING file for more information.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.