Skip to main content

Fast and parallel snowball stemmer

Reason this release was yanked:

bad release

Project description

py-rust-stemmers

py-rust-stemmers is a high-performance Python wrapper around the rust-stemmers library, utilizing the Snowball stemming algorithm. This library allows for efficient stemming of words with support for parallel processing, making it a powerful tool for text processing tasks. The library is built using maturin to compile the Rust code into a Python package.

Features

  • Snowball Stemmer: Uses the well-known Snowball stemming algorithms for efficient word stemming in multiple languages.
  • Parallelism Support: Offers parallel processing for batch stemming, providing significant speedup for larger text sequences.
  • Rust Performance: Leverages the performance of Rust for fast, reliable text processing.

Installation

You can install py-rust-stemmers via pip:

pip install py-rust-stemmers

Usage

Here's a simple example showing how to use py-rust-stemmers to stem words using the Snowball algorithm:

from py_rust_stemmers import SnowballStemmer

# Initialize the stemmer for the English language
s = SnowballStemmer('english')

# Input text
text = """This stem form is often a word itself, but this is not always the case as this is not a requirement for text search systems, which are the intended field of use. We also aim to conflate words with the same meaning, rather than all words with a common linguistic root (so awe and awful don't have the same stem), and over-stemming is more problematic than under-stemming so we tend not to stem in cases that are hard to resolve. If you want to always reduce words to a root form and/or get a root form which is itself a word then Snowball's stemming algorithms likely aren't the right answer."""
words = text.split()

# Example usage of the methods
stemmed = s.stem_word(words[0])
print(f"Stemmed word: {stemmed}")

# Stem a list of words
stemmed_words = s.stem_words(words)
print(f"Stemmed words: {stemmed_words}")

# Stem words in parallel
stemmed_words_parallel = s.stem_words_parallel(words)
print(f"Stemmed words (parallel): {stemmed_words_parallel}")

Methods

stem_word(word: str) -> str

This method stems a single word. It is best used for small or isolated stemming tasks.

Example:

s.stem_word("running")  # Output: "run"

stem_words(words: List[str]) -> List[str]

This method stems a list of words sequentially. It is ideal for processing short to moderately sized text sequences.

Example:

s.stem_words(["running", "jumps", "easily"])  # Output: ["run", "jump", "easili"]

stem_words_parallel(words: List[str]) -> List[str]

This method stems a list of words in parallel. It provides significant speedup for longer text sequences (e.g., sequences longer than 512 tokens) by utilizing parallel processing. It is ideal for batch processing of large datasets.

Example:

s.stem_words_parallel(["running", "jumps", "easily"])  # Output: ["run", "jump", "easili"]

Build from source

  • Install maturin
  • Go to project dir
maturin build --release
pip install target/wheels/py_rust_stemmers-<your os/architecture/etc>.whl

License

This project is licensed under the MIT License. See the LICENSE file for more 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 Distributions

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

py_rust_stemmers-0.1.6-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (318.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARMv7l

py_rust_stemmers-0.1.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (314.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

py_rust_stemmers-0.1.6-cp311-cp311-macosx_11_0_arm64.whl (275.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

py_rust_stemmers-0.1.6-cp311-cp311-macosx_10_12_x86_64.whl (290.5 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

py_rust_stemmers-0.1.6-cp310-cp310-win_amd64.whl (208.5 kB view details)

Uploaded CPython 3.10Windows x86-64

py_rust_stemmers-0.1.6-cp310-cp310-musllinux_1_2_x86_64.whl (538.2 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

py_rust_stemmers-0.1.6-cp310-cp310-musllinux_1_2_armv7l.whl (595.7 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ ARMv7l

py_rust_stemmers-0.1.6-cp310-cp310-musllinux_1_2_aarch64.whl (492.5 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ ARM64

py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_28_x86_64.whl (320.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (320.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (319.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARMv7l

py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (314.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

py_rust_stemmers-0.1.6-cp310-cp310-macosx_11_0_arm64.whl (276.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

py_rust_stemmers-0.1.6-cp310-cp310-macosx_10_12_x86_64.whl (290.9 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file py_rust_stemmers-0.1.6-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 725494662d65833299fdd2b9e40fcc01616e9089301b48228a2e50efaa56e18c
MD5 89d3baab823912ffd050cfd2607a4f85
BLAKE2b-256 1620acd74efa923c66474624fe63d8f5dd2ec194d52e12c95e58f507748bb33d

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fa11b9bcd6f3fa7381039f514b19e9c54a3f36996221a8a66bd3b170e39aa7c1
MD5 049de1de6fdc6d2d63221d988a7b3bb8
BLAKE2b-256 b311c69da6ea37d38e24aac5afa61172bd944e8883b0785abc9d1a0848fb7b94

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 156fbce2f2a50ac255a36b1bbb42c12e6c013af2fc35f62ede446cde8aa4c675
MD5 ab40ab9d55c02f9f351cbb2d5ed33693
BLAKE2b-256 b6c50178d6bd382be165c6a4f09e0303eaf51557560f650424883a85aa4f9616

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 add938767f9556ee5cb503226cdd1ece175d3b3e04852cf049a625a469c87504
MD5 9aeb5520a9164c9200f4f7c73cf2cce2
BLAKE2b-256 cc83b7d61b767323912f78d9ab28c992f4b2c606a5696b9219bb023f992322f3

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3e74cc2e288be5bfc94aa19713c53af133cc002a8cd8739d85475966ec6bc601
MD5 38499d64c2a264befc6f8ca932994df2
BLAKE2b-256 1466a60d6571b1e08cd07e00a0f8224802949696fbc5d2fbd96d2552e7c90c09

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 da03a804d7b1c8f67c87070bc9945d657c92ea7a710a7b9a0232b3a56d2a8d1d
MD5 24ef888aa5f11d1cf6068374e4526c32
BLAKE2b-256 eabb81c3367888489de46e542b363ebe9b3e292dc624e23a1554965fc0c6edae

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp310-cp310-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp310-cp310-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 56accce1302e706c40487f50efc538b84940d90c46765a266aa967ede99db29a
MD5 4fcb715f3aca515060cd35945d7add6a
BLAKE2b-256 5a69b8cd1cdeb552d59bf5cb05a604cb3b28a4b7c099ddd9af4f4806bcb7714c

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp310-cp310-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp310-cp310-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0abf42f36cec5a0cf46cecc8b1b326fdd011f2c55755cad6fb9ab4dc4841059c
MD5 faaad4093cadafca85c341bf1f1fd533
BLAKE2b-256 dee0c3e8ba7fb3a6f3c6bbcf693fd71a57d75fb4d262c6d8a483d2abb9a14eb2

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d982ccc90282bdd695c881a8d5b6918b122ec408a7a8e10bc3b400380045ef43
MD5 72702c12d4d39a0c0ff6e9eae5d89ca2
BLAKE2b-256 d5c53808f21d9b5fd587f40da4e17a19ac681990bcbc001d494cb5141aeb54cc

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2fbc1f49054dbfa9011cb86353357133959266e051917a516bf192803474e31
MD5 8b4dbe3e010572950aba313ee2d4279d
BLAKE2b-256 47efb13d3096cefd53f6622edee9e16a89c02db68c27e2eb2df0f2830753a730

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 0518804548733a6f57aae0af8b2ec9976929ffd3be322f4ce69a0d73ce7514a2
MD5 7e5a09ab5b2b0b86d874cd1d2062c3a9
BLAKE2b-256 52d3e0d08da5a58bbddf10ccbe3ff2b20a0cdb399a52acb358861bc1a1db327d

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 199b11e79c6ed38a7457b6af4d0d8d85506428673743de17fea639415350897d
MD5 417d54766357e04498cbdf2a8ac5df80
BLAKE2b-256 e759e9c92337afa8f826aa284d3ed5fb71cbd371a9299c06f88715c391ac5907

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e1eb2f01b992f61300beb14afa64fc7dfb0c752d52b4c17ad43504d71e95408
MD5 fa8c00e43390fe11605c8e8c5f723efd
BLAKE2b-256 d32744291355331b87ed1a061f9d02eac879a19d0cfacbdb57e9d678346696b9

See more details on using hashes here.

File details

Details for the file py_rust_stemmers-0.1.6-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for py_rust_stemmers-0.1.6-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 53d0beb86028c4dc1a118c37a513dc743f6e5bda9ddfb0fc48078f3f49dfd70e
MD5 bf13699bbcc068a833f409e5a2f018ac
BLAKE2b-256 7ceb7af54c3a88d82b08f75aa01790f773198bfc6b53c563a1c25dfc6bef04fc

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