https://github.com/tigregotico/phonetic_matcher
match strings by how they sound
https://github.com/tigregotico/phonetic_matcher
fuzzy-match fuzzy-matching matching phonemes phonemic-awareness phonetic-algorithm
Last synced: 11 months ago
JSON representation
match strings by how they sound
- Host: GitHub
- URL: https://github.com/tigregotico/phonetic_matcher
- Owner: TigreGotico
- License: apache-2.0
- Created: 2020-12-25T15:01:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-14T21:27:56.000Z (over 4 years ago)
- Last Synced: 2025-06-15T22:07:18.211Z (about 1 year ago)
- Topics: fuzzy-match, fuzzy-matching, matching, phonemes, phonemic-awareness, phonetic-algorithm
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Phonetic matcher
match strings based on how they sound
# Install
```bash
pip install phonetic_matcher
```
NOTE: rapidfuzz is optional but strongly recommended
```bash
pip install rapidfuzz
```
# Usage
```python
import phonetic_matcher
# match scores
score = phonetic_matcher.fuzzy_match("mycroft", "microsoft") # 0.7571428571428571
score = phonetic_matcher.fuzzy_match("cat", "dog") # 0.4999999999999999
# best match selection
query = "mycroft"
choices = ["microsoft", "minecraft", "mike roft", "mein kampf", "my raft"]
best, score = phonetic_matcher.best_match(query, choices) # mike roft 0.9047095761381476
# all matches
matches = phonetic_matcher.match(query, choices)
# [('mike roft', 0.9047095761381476),
# ('minecraft', 0.7416326530612245),
# ('microsoft', 0.7387755102040816),
# ('my raft', 0.7083333333333333),
# ('mein kampf', 0.48752834467120176)]
```