lingz / pyphone

Python Phonetic Tools and Distance Metrics

Repository from Github https://github.comlingz/pyphoneRepository from Github https://github.comlingz/pyphone

Phonetic Distance Metric

pip install pyphone

Simple library that will give you the phonetic distance between two phones, represented as IPA unicode.

You can find the full mapping of accepted symbols in data.py

>>> from phonetic_distance import distance
>>> distance('m', 'n')
0.26086956521739135
>>> distance('b', 'p')
0.04347826086956522
>>> distance('e', 'i')
0.058823529411764705
>>> distance('a', 'e')
0.11764705882352941
>>> distance('f', 'v')
0.04347826086956522
>>> distance('p', 'k')
0.3478260869565218

About

Python Phonetic Tools and Distance Metrics

License:MIT License


Languages

Language:Python 100.0%