Python Polars plugin for Rust-built phonetic algorithms
Project description
Polars-Phonetics: A Polars Plugin for Phonetic Algorithms
v0.2.0 Release: Metaphone, Soundex & Nysiis Algorithms added!
Welcome to Polars-Phonetics, a Polars plugin for phonetic algorithms built in Rust for Python users. This second release includes the Metaphone, Soundex & Nysiis algorithms, in addition to the Double-Metaphone algorithm in the initial release.
With the current algorithms, Polars-Phonetics can replace the 'phonetics' Python module, no need for map_elements(soundex)
from now on!
Installation
To use Polars-Phonetics, install the polars-phonetics package using pip:
pip install polars-phonetics
Example Usage
Here's an example of how to use the double_metaphone, metaphone, soundex & nysiis functions in Polars Phonetics:
import polars as pl
from polars_phonetics import dmetaphone, soundex, metaphone, nysiis
# Create a sample dataframe
df = pl.DataFrame(
{
"words": ["hello", "this", "is", "the", "phonetics", "plugin", "in", "polars", None],
}
)
print(df)
# This would output:
# shape: (9, 1)
# ┌───────────┐
# │ words │
# │ --- │
# │ str │
# ╞═══════════╡
# │ hello │
# │ this │
# │ is │
# │ the │
# │ phonetics │
# │ plugin │
# │ in │
# │ polars │
# │ null │
# └───────────┘
# Apply the double_metaphone, soundex, metaphone & nysiis functions to the 'words' column
result = df.with_columns(
dmetaphone=dmetaphone("words"),
soundex=soundex("words"),
metaphone=metaphone("words"),
nysiis=nysiis("words"),
)
print(result)
# shape: (9, 5)
# ┌───────────┬──────────────┬─────────┬───────────┬────────┐
# │ words ┆ dmetaphone ┆ soundex ┆ metaphone ┆ nysiis │
# │ --- ┆ --- ┆ --- ┆ --- ┆ --- │
# │ str ┆ str ┆ str ┆ str ┆ str │
# ╞═══════════╪══════════════╪═════════╪═══════════╪════════╡
# │ hello ┆ [HL, HL] ┆ H400 ┆ HL ┆ HAL │
# │ this ┆ [0S, TS] ┆ T200 ┆ 0S ┆ T │
# │ is ┆ [AS, AS] ┆ I200 ┆ IS ┆ I │
# │ the ┆ [0, T] ┆ T000 ┆ 0 ┆ T │
# │ phonetics ┆ [FNTK, FNTK] ┆ P532 ┆ FNTK ┆ FANATA │
# │ plugin ┆ [PLJN, PLKN] ┆ P425 ┆ PLJN ┆ PLAGAN │
# │ in ┆ [AN, AN] ┆ I500 ┆ IN ┆ IN │
# │ polars ┆ [PLRS, PLRS] ┆ P462 ┆ PLRS ┆ PALAR │
# │ null ┆ null ┆ null ┆ null ┆ null │
# └───────────┴──────────────┴─────────┴───────────┴────────┘
Acknowledgments
I would like to extend my gratitude to:
- Marco Gorelli for his comprehensive guide on writing Polars Plugins.
- The team behind the Rust crate rphonetic.
- The Discord server for Polars, especially the plugins channel.
Future Releases
Future releases of Polars-Phonetics will include additional phonetic algorithms with options to customise outputs through arguments. Stay tuned for updates!
Contributing
If you'd like to contribute to Polars-Phonetics, please open an issue or pull request on this repository. I welcome any feedback, bug reports, or new algorithm implementations.
License
Polars-Phonetics is licensed under the MIT License. See the LICENSE file for details.
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
File details
Details for the file polars_phonetics-0.2.0.tar.gz
.
File metadata
- Download URL: polars_phonetics-0.2.0.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e216e6f97a21305c8d3f04503968f84a276495616cdbaa70c2a80ec3ecc94f7 |
|
MD5 | 962b362926a8c4be355c6d59033d4942 |
|
BLAKE2b-256 | a92b3af1893c4b40f460145b35b464bbac53c9b1b187319355cca2f621186a2a |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a7e62bf7d1acce95a4abd38f2ff84642887eb6706db634e4f3cac276b255da5 |
|
MD5 | 4f3d8b437fb04652b7199c35496ea89d |
|
BLAKE2b-256 | 96b8f4b72ba2f4ea77212ab7e55b1c6af679f10c63fe92a6596b2183e144ac8d |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-win32.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-win32.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.8+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c729371a4b4160d6c900da7184642483e958abba633fed90ba6b2d5206e7d2c3 |
|
MD5 | 11c053e92a0d2d60c90a6e52375a733b |
|
BLAKE2b-256 | e60770af67463112448962a70063c7dfa3c36489ab01543aa2f34b024107d78e |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-musllinux_1_2_x86_64.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.8+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e80a20eb493f5fb91ffb28c074d69df2441d6202dd627f02817a907a92ede11 |
|
MD5 | 291fa9923f7f62af6e13d6dc3ac70e87 |
|
BLAKE2b-256 | dee7dcf110c5f670ed092aecf38cb429c276f23f82cd7096cf2b06e958e6e1ca |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-musllinux_1_2_i686.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-musllinux_1_2_i686.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.8+, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 240a7d3fcc0ab3da6b95d39e257255b7fb8522ed1825bca14d8215798c9a1764 |
|
MD5 | 6a8d36b7a3449d100bdbcce1d0da8460 |
|
BLAKE2b-256 | b0d7231a2ae3ae02c482344918278017364c4b0e97fc649978dc6d77b5d028dd |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-musllinux_1_2_armv7l.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.8+, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 824e7b39c3e3ad2aca4d9b6c0f010cc70cfe1cca1d782cbfc6f5fed7c4d51019 |
|
MD5 | 1e3b61023a64c1793bd2ec8747957c89 |
|
BLAKE2b-256 | 0aa83524772dc36d3066373906ca52cdd9e77906c8fd0c4e1effa71c15d721f3 |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-musllinux_1_2_aarch64.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.8+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5036ab9c7eb7eeb2d8824e21a83c5ef5f4903c0e5a4d916a5c94f7f39520f004 |
|
MD5 | 21457c9698d3f410ad33c1107fb5d5b2 |
|
BLAKE2b-256 | ea0a0dc4a030f60740db802c077daec841f7e8850421c32dce1d2d8a5167b131 |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0b9aa3721823350639315efabe18a2d60bcbf14b7f7607ca60f62b4a4358890 |
|
MD5 | e651bd7be66062457eb0df5fd8e63c58 |
|
BLAKE2b-256 | 0c911d7827438a3c9919f8bb85994ca987dac10f767b2864563422e8e6c888ab |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c3300db734c6d620d48d81079e87dfc5772e8d59f66ed50a1bce2326880e37c |
|
MD5 | d6b1db64f916cd5d3c657c1543175e05 |
|
BLAKE2b-256 | ec8aef375ecaeb5ff80c2f806bc6d567cac2beca82fccadd18c30099d0dd57dd |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21e2cdb6c8db688bc1e7789e4c9de3cd68b41e3f55680f0138ebab7e581835d6 |
|
MD5 | 34e75a11433ee85f10f59cd017592020 |
|
BLAKE2b-256 | d6bf01359930a7450053e94fb6cc932142daf3dda2adbc1ad3ed34f1fd456ec8 |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00a002dbab196805e867adfbf67eca30e528e65b0ff9ea17662165755e1a1a90 |
|
MD5 | 0d03a78ba6635bb7bd227e12fc1fd7c2 |
|
BLAKE2b-256 | b8d4760f801228e63541bc76f7ee34e6963ac3010b57c6eecebef72ce35a9421 |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc95b582b84fa33899acdc5b156d0a4debac2095189517c11fae705caabce045 |
|
MD5 | d98c435296a7e4ccf8f14d09ee9a117d |
|
BLAKE2b-256 | 2d1818928ee865dcbaadf88199d95d26a06a6f7eec2a46d57feac9f8317a8838 |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c9f15c5aa2a51a2bbd01c1db79b446b347501eb9495e170edaea1b749904655 |
|
MD5 | 8096b1acb8ac4519acfe08b3b0534427 |
|
BLAKE2b-256 | 1473b035ba12a08ef8cf629f0656a81c98f2123ea1e8967c50ca8d4a4a17ee16 |
File details
Details for the file polars_phonetics-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: polars_phonetics-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5712d91bf4a828cdaed2d8b83fb66ae751ebfe169c23fa5ad19d6b07026d2a1 |
|
MD5 | faa478d2f7ebd624a91318602850e95b |
|
BLAKE2b-256 | 0207f3c4317a9f2bf95135a0aab2d50aadb83bb965d0aa5beaf11296c12ee744 |