Skip to main content

Pyphonetics is a Python 3 library for phonetic algorithms. Right now, the following algorithms are implemented and supported:

  • Soundex

  • Metaphone

  • Refined Soundex

  • Fuzzy Soundex

  • Lein

  • Matching Rating Approach

More will be added in the future.

Instalation

The module is available in PyPI, just use pip install pyphonetics.

Usage

>>> 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

Credits

The module was largely based on the implementation of phonetic algorithms found in the Talisman.js (https://github.com/Yomguithereal/talisman) Node NLP library.

Metadata

Release files for pyphonetics 0.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyphonetics 0.5.3
File Size Uploaded
pyphonetics-0.5.3.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyphonetics 0.5.3
File Interpreter ABI Platform
pyphonetics-0.5.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 21.0 kB

Release files / pyphonetics-0.5.3.tar.gz

Download URL pyphonetics-0.5.3.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2d3c2e359fde91a3c57914f0b5468bba7a5daf38e7927fd999992ea68990fbe4
BLAKE2b-256 checksum
How to use checksums
d67c7c45a9e9bf6ddb57b67e66cf4e8076a7baf3a790a3411daac1a7a2df0c5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.18.4

Release files / pyphonetics-0.5.3-py2.py3-none-any.whl

Download URL pyphonetics-0.5.3-py2.py3-none-any.whl
Size 10.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e6b29671d0d624dda1cac59c0c5a8a7216d8db504bae4941bfc482e04a0621d1
BLAKE2b-256 checksum
How to use checksums
bddda7d0a860efd3d4335d538b4361b8e9af8311f2aba2e8c7e4c7a47d623b6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.18.4

Release history Release notifications | RSS feed

This release

0.5.3 This release

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5

2 release files

0.4.1

1 release file

0.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page