Metaphone is a Python library that provides implementations of the Metaphone and Double Metaphone phonetic algorithms. These algorithms are designed to index words by their English pronunciation, offering an improvement over Soundex for matching similar-sounding words and names, even with variations in spelling. The Double Metaphone algorithm further refines this by accounting for spelling peculiarities from various languages and can return both a primary and a secondary phonetic code. The current version is 0.6, and the project has a very slow release cadence, with the last PyPI update in 2016 and the latest GitHub release in 2020.
pip install metaphoneVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import and use both the `doublemetaphone` and `metaphone` functions to generate phonetic codes for words. Double Metaphone returns a tuple of two codes (primary and secondary), while Metaphone returns a single code.
Users are advised to use a Python 3 compatible fork or implement a workaround by renaming the `next` method in the source code if direct use of this specific package is required. Several alternative, actively maintained libraries (e.g., `phonetics`, `abydos`) provide Metaphone and Double Metaphone algorithms with Python 3 support.
For highly accurate phonetic matching across diverse languages, consider specialized phonetic libraries or commercial alternatives like Metaphone 3 if your use case demands it. For this library, be aware of its English-centric design.
This issue requires modifying the library's source code to rename the `next` method (e.g., to `_next_char`). Alternatively, use a Python 3 compatible fork or a different library that supports Metaphone algorithms on Python 3.
As above, this requires a modification of the library's source code to rename the conflicting `next` method or usage of a Python 3 compatible alternative library. For example, changing `self.next` to `self._next` in the original library's `metaphone.py` file could resolve this.
No dependency data recorded yet.