Skip to main content

Fast, byte-identical-to-jellyfish phonetic encoders (soundex / metaphone / nysiis / match_rating)

Project description

goldenphonetic

Fast, byte-identical-to-jellyfish phonetic encoders. A thin PyO3 wheel over the pyo3-free goldenphonetic-core Rust crate, with zero runtime dependencies.

import goldenphonetic as gp

gp.soundex("Robert")               # -> 'R163'   (American Soundex)
gp.metaphone("Thompson")           # -> '0MPSN'  (original Metaphone, Philips 1990)
gp.nysiis("Catherine")             # -> 'CATARAN'
gp.match_rating_codex("Byrne")     # -> 'BYRN'   (Match Rating Approach codex)
gp.match_rating_comparison("Byrne", "Boern")   # -> True

Every function is a byte-for-byte drop-in for the corresponding function in the Python jellyfish package (>= 1.0), including jellyfish's exact uppercasing and Unicode (NFKD / grapheme) handling — verified against jellyfish over a 6,000-input + 2,500-pair fuzz corpus (goldenphonetic-core/scripts/check_phonetic_parity.py), with no jellyfish at runtime.

Functions

Function Returns Notes
soundex(s) str American Soundex
metaphone(s) str Original Metaphone (Lawrence Philips, 1990) — not double-metaphone
nysiis(s) str NYSIIS
match_rating_codex(s) str Match Rating Approach codex
match_rating_comparison(s1, s2) bool or None MRA comparison

Error semantics (mirrors jellyfish exactly)

  • match_rating_codex raises ValueError when the input contains any non-alphabetic, non-space character ("O'Brien", "Smith-Jones", "123").
  • match_rating_comparison never raises — it returns None when the two codices can't be compared: a codex-length difference of 3 or more (match_rating_comparison("Tim", "Timothy") is None), or either input rejected by the codex (non-alphabetic).

Unicode

Inputs are uppercased with the same algorithm jellyfish uses, then soundex/metaphone apply full NFKD decomposition (vendored as generated static data — no unicode-normalization dependency) and nysiis segments grapheme clusters (UAX-29 GB9 over a vendored combining-mark table). Accented names match in both precomposed and decomposed form.

Part of the golden suite.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goldenphonetic-0.1.0.tar.gz (58.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

goldenphonetic-0.1.0-cp311-abi3-win_amd64.whl (160.6 kB view details)

Uploaded CPython 3.11+Windows x86-64

goldenphonetic-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl (290.9 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

goldenphonetic-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl (309.8 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

goldenphonetic-0.1.0-cp311-abi3-macosx_11_0_arm64.whl (258.1 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

goldenphonetic-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl (261.2 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file goldenphonetic-0.1.0.tar.gz.

File metadata

  • Download URL: goldenphonetic-0.1.0.tar.gz
  • Upload date:
  • Size: 58.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for goldenphonetic-0.1.0.tar.gz
Algorithm Hash digest
SHA256 efd25d96c00db63da810117a58375ccf0010a4737643654262d2a0e5777c3fed
MD5 8575ed73408101235b0f78b047ed8007
BLAKE2b-256 74db1406432927433a65d2d4881bab6718ba5e2ab96139ceca64448f15298661

See more details on using hashes here.

File details

Details for the file goldenphonetic-0.1.0-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for goldenphonetic-0.1.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7f17453422df123d85a2ac7f2baa5f67fbbc39d3b2d1fea1dd75c8249b6003e4
MD5 e9ff2b3eee298cf102678d7556b13390
BLAKE2b-256 3b857bf33a489474c4c012cf7f75cbd6f0189f92ecb02182f70f65b41027f449

See more details on using hashes here.

File details

Details for the file goldenphonetic-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goldenphonetic-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4f3736273e7220772bef94cd3c3d206d4cbbddc26bc22db64c7920a537218ee4
MD5 72c85c7adc52083459ff77a46664dbe1
BLAKE2b-256 2267ab04fb2d69f9a9af3b485ecbd5089b8bc22825cf25f7b8d4fa9b70d533e0

See more details on using hashes here.

File details

Details for the file goldenphonetic-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for goldenphonetic-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a26dbbc877c148d1c93ed8a6cb07cb987ab18974053be8985db052d9bf230031
MD5 fce207985dbfcc3931998dbae9412de9
BLAKE2b-256 34b020a08ff495e01d8987fdc3046d55395fc19b0605d445236a0a518d2d0c08

See more details on using hashes here.

File details

Details for the file goldenphonetic-0.1.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for goldenphonetic-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dc3985bc400f52a7260c310751ec240e47480b1f66947d439d59e9a6ddd8386c
MD5 f2534806909a92fc9a0f6f40a8e0807a
BLAKE2b-256 676ad73af290793e6372c2090fa3e6c055950f4738069b35374f06abd5d17877

See more details on using hashes here.

File details

Details for the file goldenphonetic-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for goldenphonetic-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4f730fca2b49ced761cb91ed4eac7988bdd527ea4b7bd2b64a3f9b8d3b2f9e5c
MD5 3a82f31694fc154491a594de7ae79c54
BLAKE2b-256 db6f096d18da9432fea528de99b510fac71ce196c8a6f65d805b5384bd0f79e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page