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.
import krovetz ks = krovetz.PyKrovetzStemmer() ks.stem('walked')
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
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.
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.
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
pip install cython
Then just do:
pip install git+https://github.com/ptorrestr/py_krovetz.git
We are using pipenv to handle the development environment. This tool is very handy to manage different python versions and configurations.
First, import the project in your machine
git clone https://github.com/ptorrestr/py_krovetz.git
You can install the environment needed just using the following command
Have a look on files
Pipfile.lock in order to check the versions of the dependencies used in our development machine.
Test can be run using the environment defined by
pienv run python setup.py test
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for krovetz-1.0.2-cp37-cp37m-manylinux1_x86_64.whl
Hashes for krovetz-1.0.2-cp36-cp36m-manylinux1_x86_64.whl
Hashes for krovetz-1.0.2-cp36-cp36m-macosx_10_6_intel.whl
Hashes for krovetz-1.0.2-cp35-cp35m-manylinux1_x86_64.whl