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.1.tar.gz (62.4 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.1-cp311-abi3-win_amd64.whl (162.2 kB view details)

Uploaded CPython 3.11+Windows x86-64

goldenphonetic-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl (292.1 kB view details)

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

goldenphonetic-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl (310.6 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

goldenphonetic-0.1.1-cp311-abi3-macosx_11_0_arm64.whl (289.0 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

goldenphonetic-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl (290.1 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: goldenphonetic-0.1.1.tar.gz
  • Upload date:
  • Size: 62.4 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.1.tar.gz
Algorithm Hash digest
SHA256 ae14656de3cd1d4b073dc9be0b9b58328446a748aa4db92d253b088337c5eb23
MD5 dadadd7beee7e230420aea68358656e9
BLAKE2b-256 d3488d78be4a0c2caef16cf16d3e3d80d4b95a2d5ceac99f8219556eb38e17c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for goldenphonetic-0.1.1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f8e0a9008358f60a37b6c5a8c655488da56df14899e5f10c340a17bf40532568
MD5 3dfd56d0ed9564848a994f56161b0025
BLAKE2b-256 c8694dfb2430f3373963fdfbe436398c8ac87f7f21d76bf69bb23000701568d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for goldenphonetic-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 082202ec259d348c9a5447146a6198e54b5188fba47b47b197c8b826227a3aba
MD5 14bc3342da72435fb4056b8125df4d03
BLAKE2b-256 56ba00d72cd76ab201b033e29743bcdffcb91b8fcfdcd2842aedbd1bb2eb2b19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for goldenphonetic-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ec8213b26bd184c8cc2e4da3ec5652260d84eda7df910ff68bd8e6a5ef56ee20
MD5 9ed0bc2a587fd3176787d1ea1bf089ef
BLAKE2b-256 a581de396133e9fd9a39ac3a1fc9e804b41726dad87617990c946286a4c54e09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for goldenphonetic-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 003362eea130a66dd00496b6b62792ecfecb0ee923c6caabb514dc9825f28c25
MD5 5733e95c2bc06a67c76d800e1790d9fc
BLAKE2b-256 e090fd4763b56597531e359d3497394c159899a66ff04d5aad81dc0bc61ccbf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for goldenphonetic-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 84e16d63ee6c4dd1118118544a438fcd260dcd41dd5fb98ee6ddf485af633c25
MD5 afaa1a661ea0e2d5ef1575cc078e8f9d
BLAKE2b-256 6ba83968d605306babc579f682631d912b04179a5d37f51e37bf21d6b84d61c2

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