# Pyhfst
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7791470.svg)](https://doi.org/10.5281/zenodo.7791470)
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}
}
Raw data
{
"_id": null,
"home_page": "https://github.com/Rootroo-ltd/pyhfst",
"name": "pyhfst",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "hfst, fst, optimized lookup, hfstol, transducers",
"author": "Khalid Alnajjar and Mika H\u00e4m\u00e4l\u00e4inen",
"author_email": "hello@rootroo.com",
"download_url": "https://files.pythonhosted.org/packages/13/1c/352397d70827664eb887be8daeaa0be5709e7da53c106d71cb8cae73e0ae/pyhfst-1.3.0.tar.gz",
"platform": null,
"description": "# Pyhfst\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7791470.svg)](https://doi.org/10.5281/zenodo.7791470)\n\nPyhfst 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.\n\nThe library will run on all operting systems that support Python 3.\n\n# Installation\n\n pip install pyhfst\n \nPyhfst can run way faster if you have Cython installed. After installing Cython, you must reinstall Pyhfst\n\n pip install cython\n pip install --upgrade --force-reinstall pyhfst --no-cache-dir\n\n# Usage\n\n import pyhfst\n \n input_stream = pyhfst.HfstInputStream(\"./analyser\")\n tr = input_stream.read()\n print(tr.lookup(\"voi\"))\n \n >> [['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]]\n\n# Citation\n\nPlease cite the library as follows:\n\nAlnajjar, K., & H\u00e4m\u00e4l\u00e4inen, M. (2023, December). PYHFST: A Pure Python Implementation of HFST. In Lightning Proceedings of NLP4DH and IWCLUL 2023 (pp. 32-35).\n\n @article{pyhfst_2023, \n title={PyHFST: A Pure Python Implementation of HFST},\n author={Alnajjar, Khalid and H{\\\"a}m{\\\"a}l{\\\"a}inen, Mika},\n booktitle={Lightning Proceedings of NLP4DH and IWCLUL 2023},\n pages={32--35},\n year={2023} \n }\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A pure Python implementation of HFST for using HFST optimized lookup transducers (with or without weights)",
"version": "1.3.0",
"project_urls": {
"Bug Reports": "https://github.com/Rootroo-ltd/pyhfst/issues",
"Developer": "https://rootroo.com/",
"Homepage": "https://github.com/Rootroo-ltd/pyhfst"
},
"split_keywords": [
"hfst",
" fst",
" optimized lookup",
" hfstol",
" transducers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e002c10a69ff21d6679a6b6e28c42cd265bec2cdd9be3dcbbee830a10fa4b0e5",
"md5": "6ac63913b6ca9a85d789aaee23a301a0",
"sha256": "41f78b1c1d034ea57fd9d21fe152d629d9f97fdcddb0411628e18578f33b8ba8"
},
"downloads": -1,
"filename": "pyhfst-1.3.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "6ac63913b6ca9a85d789aaee23a301a0",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 27314,
"upload_time": "2024-03-26T20:28:46",
"upload_time_iso_8601": "2024-03-26T20:28:46.516278Z",
"url": "https://files.pythonhosted.org/packages/e0/02/c10a69ff21d6679a6b6e28c42cd265bec2cdd9be3dcbbee830a10fa4b0e5/pyhfst-1.3.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "131c352397d70827664eb887be8daeaa0be5709e7da53c106d71cb8cae73e0ae",
"md5": "9f4bb22ba38d71da83390587f4b27e3e",
"sha256": "47c95265a963b0e95a8ed21518ea2c8dc49b1a235d0e30044419a086b3b7c185"
},
"downloads": -1,
"filename": "pyhfst-1.3.0.tar.gz",
"has_sig": false,
"md5_digest": "9f4bb22ba38d71da83390587f4b27e3e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22015,
"upload_time": "2024-03-26T20:28:35",
"upload_time_iso_8601": "2024-03-26T20:28:35.723157Z",
"url": "https://files.pythonhosted.org/packages/13/1c/352397d70827664eb887be8daeaa0be5709e7da53c106d71cb8cae73e0ae/pyhfst-1.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-26 20:28:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Rootroo-ltd",
"github_project": "pyhfst",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyhfst"
}