IPA-based phonetic distance: strict edit distance, listener-confusion distance, and per-phoneme acoustic and perceptual scoring.
Project description
phonetics
IPA-based phonetic distance for Python, built on a Rust core.
Install
pip install phonetics-ipa
The PyPI package is phonetics-ipa (the bare phonetics name is held
by an unrelated metaphone library). The importable module is still
phonetics:
import phonetics
Usage
import phonetics
# Strict per-phoneme acoustic distance, 0..1
phonetics.distance("p", "b") # 0.15 (voicing flip)
phonetics.distance("ɑ", "ɔ") # ~0.21 (acoustically distinct)
# Listener-confusion distance, Mad Gab calibrated
target = "ɪtsdʒʌstəstupɪdgeɪm" # "It's just a stupid game"
clue = "hɪtsdʒʌstɪsduphɪdkeɪm" # "Hits Justice Dupe Hid Came"
phonetics.confusion(target, clue) # ~0.77
phonetics.similarity(target, clue) # ~0.96 (high listener overlap)
# Perceptual per-phoneme (with empirical confusion overlay)
phonetics.sub_cost("t", "ɾ") # ~0.10 (American t-flapping)
phonetics.sub_cost("ɑ", "ɔ") # ~0.05 (cot/caught merger, WCE)
# Tokenisation
phonetics.tokenize("kɑɪt") # ['k', 'ɑɪ', 't'] (diphthong atomic)
phonetics.tokenize("it is", boundaries=True) # ['i', 't', '#', 'i', 's']
See https://github.com/JackDanger/phonetics for the extended write-up of the metric design and the parity tests against Mad Gab puzzles.
License
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phonetics_ipa-0.2.0.tar.gz.
File metadata
- Download URL: phonetics_ipa-0.2.0.tar.gz
- Upload date:
- Size: 26.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5785103f3fa5cbb8cf97537d9105a7fcdd937c09e98e3d6c3c10c099adea6303
|
|
| MD5 |
8694497fb6e7db4d8d13af7656390c1a
|
|
| BLAKE2b-256 |
0f5468158381daa6a908e555e1710e01621ccf0ca1d88c8cbf38efac597d6079
|
Provenance
The following attestation bundles were made for phonetics_ipa-0.2.0.tar.gz:
Publisher:
publish.yml on JackDanger/phonetics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phonetics_ipa-0.2.0.tar.gz -
Subject digest:
5785103f3fa5cbb8cf97537d9105a7fcdd937c09e98e3d6c3c10c099adea6303 - Sigstore transparency entry: 1520425876
- Sigstore integration time:
-
Permalink:
JackDanger/phonetics@dddb7b9d6f499128729e6c6ffb193e4158b63f52 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/JackDanger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dddb7b9d6f499128729e6c6ffb193e4158b63f52 -
Trigger Event:
push
-
Statement type:
File details
Details for the file phonetics_ipa-0.2.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: phonetics_ipa-0.2.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 123.4 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2eb3eae976c9cc3b9c01a86f99e2fd4312d85c858c3ff47507e439d298152f0
|
|
| MD5 |
2f3b81f8df4aee36840ccc302f053b26
|
|
| BLAKE2b-256 |
03911c0033ef3a8e2f09ed70512258620575b747d3136104f219cd8d5bd57f13
|
Provenance
The following attestation bundles were made for phonetics_ipa-0.2.0-cp39-abi3-win_amd64.whl:
Publisher:
publish.yml on JackDanger/phonetics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phonetics_ipa-0.2.0-cp39-abi3-win_amd64.whl -
Subject digest:
d2eb3eae976c9cc3b9c01a86f99e2fd4312d85c858c3ff47507e439d298152f0 - Sigstore transparency entry: 1520425897
- Sigstore integration time:
-
Permalink:
JackDanger/phonetics@dddb7b9d6f499128729e6c6ffb193e4158b63f52 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/JackDanger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dddb7b9d6f499128729e6c6ffb193e4158b63f52 -
Trigger Event:
push
-
Statement type:
File details
Details for the file phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 262.7 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e85c56d4f01ef3cc3a0a8dbf9a4464e66a51306bd4e6050fb9545ea71ed3117
|
|
| MD5 |
4157058116f8ed07e7484efa069d37da
|
|
| BLAKE2b-256 |
8b8069174ed5220cf4068623f119c17ee7bf85021f7456062c42225e61645ed1
|
Provenance
The following attestation bundles were made for phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on JackDanger/phonetics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
5e85c56d4f01ef3cc3a0a8dbf9a4464e66a51306bd4e6050fb9545ea71ed3117 - Sigstore transparency entry: 1520425922
- Sigstore integration time:
-
Permalink:
JackDanger/phonetics@dddb7b9d6f499128729e6c6ffb193e4158b63f52 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/JackDanger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dddb7b9d6f499128729e6c6ffb193e4158b63f52 -
Trigger Event:
push
-
Statement type:
File details
Details for the file phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 260.1 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81385d5d56561cf8e7c8654eaee90627542ea1b7230373fc4a7cbb7932749b63
|
|
| MD5 |
0c582a4a7e27ea8d321982a05c31fabc
|
|
| BLAKE2b-256 |
f4faaffb845608fa0745d0e20b8d0a87504b87fd61123ab39f2e60b7acc2f66a
|
Provenance
The following attestation bundles were made for phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on JackDanger/phonetics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
81385d5d56561cf8e7c8654eaee90627542ea1b7230373fc4a7cbb7932749b63 - Sigstore transparency entry: 1520425885
- Sigstore integration time:
-
Permalink:
JackDanger/phonetics@dddb7b9d6f499128729e6c6ffb193e4158b63f52 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/JackDanger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dddb7b9d6f499128729e6c6ffb193e4158b63f52 -
Trigger Event:
push
-
Statement type:
File details
Details for the file phonetics_ipa-0.2.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: phonetics_ipa-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 224.8 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b7790b8ecf8a0750a8f06f49623cd0d995cc1160d87a0adff1e91cb9570062b
|
|
| MD5 |
900a8b148ae9cb325317cb16ff9e71ea
|
|
| BLAKE2b-256 |
70b2bc554d26a8dfa95e6516deaf276ca43a4372b3c674b26a09fce37ed2c2d1
|
Provenance
The following attestation bundles were made for phonetics_ipa-0.2.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on JackDanger/phonetics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phonetics_ipa-0.2.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
6b7790b8ecf8a0750a8f06f49623cd0d995cc1160d87a0adff1e91cb9570062b - Sigstore transparency entry: 1520425911
- Sigstore integration time:
-
Permalink:
JackDanger/phonetics@dddb7b9d6f499128729e6c6ffb193e4158b63f52 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/JackDanger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dddb7b9d6f499128729e6c6ffb193e4158b63f52 -
Trigger Event:
push
-
Statement type: