Skip to main content

Krovetz Stemmer

Project description

Build Status

Py Krovetz

This is a Python wrapper for Krovetz Stemmer C++ library. It uses Cython to build a wrapper and allow access to the cpp object in python.

Usage

import krovetz
ks = krovetz.PyKrovetzStemmer()
ks.stem('walked')

Installation

Requirements

Python

All the requirements are handled automatic. However, tests have been made on Linux GNU and OSX using Python 3.5-3.6. Notice that using python 3.5 and macos might not work as some compilation of python 3.5 are linked to older versions of OpenSSL. This affects the communication of pip and PyPI website when retrieving libraries. If you plan to use this combination, make sure that Python is linked to an updated version of OpenSSL.

python -c 'import ssl; print(ssl.OPENSSL_VERSION)'

Version should be 1.*.*

C++ compiler

The original code of the stemmer is written in C++. Thus, a C++ compiler is needed when building yourself. If this is your decision, make sure you have a C++ compiler installed. We have tested gcc in Linux system and clang in MacOS. Regardless of this, other combinations and compilers might also work.

Setup

PyPI

PyPI provides a ready-to-go version (wheel) for different systems and Python versions.

pip install -i https://test.pypi.org/simple/ krovetz

If you want to force binary version:

pip install -i https://test.pypi.org/simple/ --only-binary=krovetz krovetz

Currently, we support distributions for Python 3.5 - 3.7 in Linux and Python 3.6 in macOS >= 10.9.

Compiling yourself

If you prefer to compile your own package, you can do it using the following command.

pip3 install -i https://test.pypi.org/simple/ --no-binary=krovetz krovetz

Using your own Cython

You can use your own Cython to generate the c++ source. Our git repo only includes cython files (.pxd) and not the files generated by Cython. Therefore, if you plan to install from here, you need to have Cython installed in order to generate C++ files.

pip install cython

Then just do:

pip install git+https://github.com/ptorrestr/py_krovetz.git

Development

We are using pipenv to handle the development environment. This tool is very handy to manage different python versions and configurations.

Import

First, import the project in your machine

git clone https://github.com/ptorrestr/py_krovetz.git

Environment setup

You can install the environment needed just using the following command

pipenv install

Have a look on files Pipfile and Pipfile.lock in order to check the versions of the dependencies used in our development machine.

Testing

Test can be run using the environment defined by pipenv.

pienv run python setup.py test

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

krovetz-1.0.2.tar.gz (137.6 kB view hashes)

Uploaded Source

Built Distributions

krovetz-1.0.2-cp37-cp37m-manylinux1_x86_64.whl (421.5 kB view hashes)

Uploaded CPython 3.7m

krovetz-1.0.2-cp36-cp36m-manylinux1_x86_64.whl (421.0 kB view hashes)

Uploaded CPython 3.6m

krovetz-1.0.2-cp36-cp36m-macosx_10_6_intel.whl (311.8 kB view hashes)

Uploaded CPython 3.6m macOS 10.6+ intel

krovetz-1.0.2-cp35-cp35m-manylinux1_x86_64.whl (420.4 kB view hashes)

Uploaded CPython 3.5m

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