Skip to main content

A python wrapper around surgebase's Go implimentation of the Porter2 stemmer

Project description

porter2

A python wrapper around surgebase's porter2 implimentation.

The surgebase library impliments a finate state machine and as such has very good performance. For more information see Credits

Usage

from porter2 import stem

print(stem("running"))
# "run"

What does the python library do?

In order to make this wrapper library I took the porter2.go file from Surgebase, made a few small modifications including making the stem function accept and return C strings and renaming the package to main. I then compiled that file to C, and provided a small wrapper to call the c version.

Becuase the C version of porter2.go is 2.4 MB, I went ahead and compressed it using Python's built in bz2 and added the zipper module to unzip it on first use. The bz2 version is about 0.8 MB. As a result of the decompression step, the very first time porter2 is imported it will take a fraction of a second longer than future imports.

Alternatives for Porter2 in Python

Credits and Info

I'm not clear on the relationship between surgebase and Jian Zhen but zhenjl appears to deserve authorship credit and surgebase is where I found the go implimentation.

Additional Info

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

porter2-0.1.1.tar.gz (820.2 kB view details)

Uploaded Source

Built Distribution

porter2-0.1.1-py3-none-any.whl (817.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: porter2-0.1.1.tar.gz
  • Upload date:
  • Size: 820.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for porter2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ecd64e7bb9b768cf64bc9b2d459fedad666b9bd0414f331b331928a2833aef85
MD5 116921e4cb1642d0fc544646e642ebf1
BLAKE2b-256 68ec60bf82bec2bc77d5417555a13c0d9e2db09a2366010e5dae1f6e69504a86

See more details on using hashes here.

File details

Details for the file porter2-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: porter2-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 817.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for porter2-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc2cd6d3dfe61c57ec1e482cf03044cdc3b1a9c8730fa444d1b6226374a0daeb
MD5 08a64fd962b8c1a91e8b39e506169cd5
BLAKE2b-256 ffead5829c638158aa2870af74640c52836021db83d5cb7fc1766329dca164a0

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