Pyhfst
Pyhfst is a pure Python implementation of HFST. The library makes it possible to use HFST optimized lookup FSTs without any C dependencies. Both weighted and unweighted FSTs are supported.
The library will run on all operting systems that support Python 3.
Installation
pip install pyhfst
Pyhfst can run way faster if you have Cython installed. After installing Cython, you must reinstall Pyhfst
pip install cython
pip install --upgrade --force-reinstall pyhfst --no-cache-dir
Usage
import pyhfst
input_stream = pyhfst.HfstInputStream("./analyser")
tr = input_stream.read()
print(tr.lookup("voi"))
>> [['voida+V+Act+Ind+Prs+Sg3', 0.0], ['voida+V+Act+Ind+Prs+ConNeg', 0.0], ['voida+V+Act+Ind+Prt+Sg3', 0.0], ['voida+V+Act+Imprt+Prs+ConNeg+Sg2', 0.0], ['voida+V+Act+Imprt+Sg2', 0.0], ['voi+N+Sg+Nom', 0.0], ['voi+Pcle', 0.0], ['voi+Interj', 0.0]]
Citation
Please cite the library as follows:
Alnajjar, K., & Hämäläinen, M. (2023, December). PYHFST: A Pure Python Implementation of HFST. In Lightning Proceedings of NLP4DH and IWCLUL 2023 (pp. 32-35).
@article{pyhfst_2023,
title={PyHFST: A Pure Python Implementation of HFST},
author={Alnajjar, Khalid and H{\"a}m{\"a}l{\"a}inen, Mika},
booktitle={Lightning Proceedings of NLP4DH and IWCLUL 2023},
pages={32--35},
year={2023}
}
Metadata
Release files for pyhfst 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyhfst-1.4.0.tar.gz | 23.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyhfst-1.4.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 51.7 kB
Release files / pyhfst-1.4.0.tar.gz
| Download URL | pyhfst-1.4.0.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
848ec5a22528166cdaa6f0df1f4e9e38c765c64b3ec2eaca9874aed57fcfda55
|
|
BLAKE2b-256 checksum How to use checksums |
6ed440c2965130aa8efac56e19d0e4a1923d190daa0ee8f681b45158c214f4f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / pyhfst-1.4.0-py2.py3-none-any.whl
| Download URL | pyhfst-1.4.0-py2.py3-none-any.whl |
|---|---|
| Size | 28.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
dd3fea517b8b8abf424992f4b301ec21ed9e7ce733f2ee353bbdda2cad9773ab
|
|
BLAKE2b-256 checksum How to use checksums |
d88c2156c6aab5bfd7d024b8f44bbf83c7822760921e9a262fdfd8ee7b63f120
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|