A pure Python implementation of HFST for using HFST optimized lookup transducers (with or without weights)
Project description
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
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:
Hämäläinen, Mika, & Alnajjar, Khalid. (2023). Pyhfst: A Pure Python Implementation of HFST (1.0.0). Zenodo. https://doi.org/10.5281/zenodo.7791470
@article{pyhfst_2023,
title={Pyhfst: A Pure Python Implementation of HFST},
DOI={10.5281/zenodo.7791470},
publisher={Zenodo},
author={Hämäläinen, Mika and Alnajjar, Khalid},
year={2023}
}
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 Distribution
pyhfst-1.0.1-py2.py3-none-any.whl
(14.7 kB
view hashes)
Close
Hashes for pyhfst-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9120f3b9feb036d2e2a3bf82ecddba4fdb1560f0017b300b81c4555f8fc30315 |
|
MD5 | 5e928cc69f040f0ba85dd013f15fb720 |
|
BLAKE2b-256 | fde39b7a0cc11dee543ad691c52db6ce88e31f38c04d44a6d6b6062a485a151d |