Skip to main content

Python interface for HFST

Project description

Package hfst_dev contains a development version of Python bindings for HFST (Helsinki Finite-State Technology) C++ library. HFST toolkit is intended for processing natural language morphologies. The toolkit is demonstrated by wide-coverage implementations of a number of languages of varying morphological complexity.

Requirements

We offer binary wheels on PyPI for Linux, Mac OS X and Windows.

Wheels for Linux are compiled with a 64-bit docker image (quay.io/pypa/manylinux1_x86_64) for python versions 2.7, 3.4, 3.5, 3.6 and 3.7.

Wheels for Mac are compiled as universal binaries for python versions 2.7, 3.5, 3.6 and 3.7. OS X must be 10.7 or higher.

Wheels for Windows are 32-bit and also require a 32-bit python to work correctly. They are available for python versions 3.5 and 3.6; earlier versions would need an older compiler that does not support C++11 features. Wheels for version 3.7. may be added to future releases.

Compiling hfst_dev from source requires at least C++ compiler (tested with gcc 5.4.0), readline and getline libraries and setuptools package for python (tested with version 28.8.0). Swig is no longer needed as pre-generated files are included in source distribution.

Support for python version 2 is experimental and may be left out at some point. We recommend python version 3 as it works better with unicode.

Installation via PyPI

We recommend using pip tool for installation. Before installation, see that dependencies given under heading ‘Requirements’ are met.

For python version 3, the pip tool is usually named pip3, plain pip being used for python version 2. Basic installation is done with:

pip3 install [--upgrade] hfst_dev

pip install [--upgrade] hfst_dev

Starting from python 3.4.0 and 2.7.9, pip is included by default and can be called via python with option -m pip:

python3 -m pip install [--upgrade] hfst_dev

python -m pip install [--upgrade] hfst_dev

The commands above are run in a shell/terminal/command prompt, but they can also be run on python command line or via a graphical user interface (e.g. IDLE) with pip.main that takes arguments in a list:

import pip
pip.main(['install','--upgrade','hfst_dev'])

The option --upgrade makes sure that the newest version of hfst will be installed replacing any earlier versions installed. The option --verbose will show what happens during the installation process. This can be useful when compiling from source.

Documentation

See wiki-based package documentation on our Github pages. In python, you can also use dir and help commands, e.g.:

dir(hfst_dev)

help(hfst_dev.HfstTransducer)

License

HFST is licensed under Gnu GPL version 3.0.

Troubleshooting

(In the commands below, python[3] means either python or python3 depending of the version of python you are using; the same goes for pip[3] meaning pip or pip3.)

Pip starts to compile from source although there is a wheel available:

Try upgrading pip with

pip[3] install --upgrade pip

or

python[3] -m pip install --upgrade pip.

Another reason for this can be that the source package on PyPI is newer (i.e. has a higher version number) than the corresponding wheel for the given environment.

Error message “command … failed with error code …”:

Try rerunning pip in verbose mode with

pip[3] install --verbose [--upgrade] hfst_dev

or

python[3] -m pip install --verbose [--upgrade] hfst_dev

to get more information.

Error message “error: could not delete … : permission denied”:

You do not have sufficient rights to install packages. On Mac and Linux, try installing as super user with

sudo pip[3] install [--upgrade] hfst_dev

or

sudo python[3] -m pip install [--upgrade] hfst_dev.

On Windows, reopen Command Prompt/Python command line/IDLE by right-clicking and choose “Run as administrator”, then run pip again.

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.

hfst_dev-3.15.0.8b0-cp37-cp37m-manylinux1_x86_64.whl (31.7 MB view details)

Uploaded CPython 3.7m

hfst_dev-3.15.0.8b0-cp36-cp36m-manylinux1_x86_64.whl (31.7 MB view details)

Uploaded CPython 3.6m

hfst_dev-3.15.0.8b0-cp35-cp35m-manylinux1_x86_64.whl (31.7 MB view details)

Uploaded CPython 3.5m

File details

Details for the file hfst_dev-3.15.0.8b0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: hfst_dev-3.15.0.8b0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 31.7 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.5.2

File hashes

Hashes for hfst_dev-3.15.0.8b0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b4ccfb6d8de62915e08ea68f213453f85c9e4567d5f716d50549514d1f21db76
MD5 f82eb8ff06f5b902ed48c1c97a482a5f
BLAKE2b-256 dd45a530bdb306a1403e51c8a53e82f0f75af7c2c45eaa4b7a4ec3e5ee96dd2f

See more details on using hashes here.

File details

Details for the file hfst_dev-3.15.0.8b0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: hfst_dev-3.15.0.8b0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 31.7 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.5.2

File hashes

Hashes for hfst_dev-3.15.0.8b0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ae6760bd6279f4b65f038ba60eed074d3dd14b5ab71d4a01e27109ab651ea5b1
MD5 4551d6a1b3611e2b01bbcac85ef32873
BLAKE2b-256 af4f3fd0abb92b2253a9a59905e9439a3ed45238f9ab5c2a6baf4754507468ca

See more details on using hashes here.

File details

Details for the file hfst_dev-3.15.0.8b0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: hfst_dev-3.15.0.8b0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 31.7 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.5.2

File hashes

Hashes for hfst_dev-3.15.0.8b0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7452574ec5ada67bceafdb5ccd9ff6973085af7bab6098297b45791db6f6ac00
MD5 108a666dd68eecedd7bc4cd5faba781e
BLAKE2b-256 06fdef7a4b88abd95a2cc5f3f03dce2539b80867bb30da456f52792ccb44e34b

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