Python implementations of various stemming algorithms.
Project description
Python implementations of the Porter, Porter2, Paice-Husk, and Lovins stemming algorithms for English. These implementations are straightforward and efficient, unlike some Python versions of the same algorithms available on the Web. This package is an extraction of the stemming code included in the Whoosh search engine.
Note that these are pure Python implementations. Python wrappers for, e.g. the Snoball stemmers and the C implementation of the Porter stemmer are available on PyPI and will be faster if using compiled code is an option for you.
Stemming algorithms attempt to automatically remove suffixes (and in some cases prefixes) in order to find the “root word” or stem of a given word. This is useful in various natural language processing scenarios, such as search.
In general porter2 is the best overall stemming algorithm, but not necessarily the fastest or most aggressive.
The stemming package contains modules for each algorithm (lovins, paicehusk, porter, and porter2). Each module contains a stem() function:
>> from stemming.porter2 import stem >> stem("factionally") faction
(The Paice-Husk algorithm allows custom stemming rule sets, so the paicehusk module also includes a PaiceHuskStemmer class you can instantiate with custom rules.)
The source code for this package is available on BitBucket:
http://bitbucket.org/mchaput/stemming
Please use BitBucket to file bug reports or feature requests:
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 Distributions
Built Distribution
File details
Details for the file stemming-1.0.zip
.
File metadata
- Download URL: stemming-1.0.zip
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eb08584c54f4382f49f7df65c038f9909c25e66ab8b65d20055295061bffa99 |
|
MD5 | 06fc620bc2e568e13d663340cbdd60fa |
|
BLAKE2b-256 | 993a3246e48ee4336afc2f190d5b8b15fb2c55a203fe00d903818f57504116f7 |
File details
Details for the file stemming-1.0.tar.gz
.
File metadata
- Download URL: stemming-1.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a59805684fff9038c7665bb5212afb1bef642373a8f89b8e6cdf74f36a3527d0 |
|
MD5 | 13e99ce387aebd04d4b67e0882c4bc4e |
|
BLAKE2b-256 | 271a92ff4b37acc28a934f52b9d23b39bfb06da0d71b50a69e93e044855adb38 |
File details
Details for the file stemming-1.0-py2.5.egg
.
File metadata
- Download URL: stemming-1.0-py2.5.egg
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f62f699adbc7da07ea740346d2a88211ba9ca1947d156af3301d6229281649a |
|
MD5 | 52dc906a433f9647abc0e7cbda72e415 |
|
BLAKE2b-256 | 861f3e582f97455d08e14692339148f31343aba079f89a79c9ebb500d3592d52 |