Skip to main content

No project description provided

Project description

Polars-Phonetics: A Polars Plugin for Phonetic Algorithms

Initial Release: Double-Metaphone Algorithm

Welcome to Polars-Phonetics, a Polars plugin for phonetic algorithms built in Rust for Python users. This initial release includes the Double-Metaphone algorithm only.

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 function in Python Polars:

import polars as pl
from polars_phonetics import dmetaphone

# 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 function to the 'words' column
result = df.with_columns(dmetaphone=dmetaphone("words"))

print(result)

# shape: (9, 2)
# ┌───────────┬──────────────┐
# │ words     ┆ dmetaphone   │
# │ ---       ┆ ---          │
# │ str       ┆ str          │
# ╞═══════════╪══════════════╡
# │ hello     ┆ [HL, HL]     │
# │ this      ┆ [0S, TS]     │
# │ is        ┆ [AS, AS]     │
# │ the       ┆ [0, T]       │
# │ phonetics ┆ [FNTK, FNTK] │
# │ plugin    ┆ [PLJN, PLKN] │
# │ in        ┆ [AN, AN]     │
# │ polars    ┆ [PLRS, PLRS] │
# │ null      ┆ null         │
# └───────────┴──────────────┘

Acknowledgments

I would like to extend my gratitude to:

Future Releases

Future releases of Polars-Phonetics will include additional phonetic algorithms. 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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

polars_phonetics-0.1.0-cp38-abi3-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.8+ Windows x86-64

File details

Details for the file polars_phonetics-0.1.0-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for polars_phonetics-0.1.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1451ef626522b4da691e281fcece938cdb85e5cf47ef29d85c80a77ba280ed79
MD5 d1f0c21448728da4576f5c621866b071
BLAKE2b-256 3bfee64f300cc19f4a031261a94563b6daf38ca718eecde5f69ada05cd046617

See more details on using hashes here.

Supported by

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