A Python 3 phonetics library.
Pyphonetics is a Python 3 library for phonetic algorithms. Right now, the following algorithms are implemented and supported:
- Refined Soundex
- Fuzzy Soundex
- Matching Rating Approach
More will be added in the future.
The module is available in PyPI, just use pip install pyphonetics.
>>> from pyphonetics import Soundex >>> soundex = Soundex() >>> soundex.phonetics('Rupert') 'R163' >>> soundex.phonetics('Robert') 'R163' >>> soundex.sounds_like('Robert', 'Rupert') True
The same API applies to every algorithm, e.g:
>>> from pyphonetics import Metaphone >>> metaphone = Metaphone() >>> metaphone.phonetics('discrimination') 'TSKRMNXN'
You can also use the distance(word1, word2, metric=’levenshtein’) method to find the distance between 2 phonetic representations.
>>> from pyphonetics import RefinedSoundex >>> rs = RefinedSoundex() >>> rs.distance('Rupert', 'Robert') 0 >>> rs.distance('assign', 'assist', metric='hamming') 2
The module was largely based on the implementation of phonetic algorithms found in the Talisman.js (https://github.com/Yomguithereal/talisman) Node NLP library.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pyphonetics-0.5.3-py2.py3-none-any.whl (10.7 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size pyphonetics-0.5.3.tar.gz (10.3 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for pyphonetics-0.5.3-py2.py3-none-any.whl