{ "info": { "author": "Eddie Antonio Santos", "author_email": "easantos@ualberta.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "FST Lookup\n==========\n\n[![Build Status](https://travis-ci.org/eddieantonio/fst-lookup.svg?branch=master)](https://travis-ci.org/eddieantonio/fst-lookup)\n[![codecov](https://codecov.io/gh/eddieantonio/fst-lookup/branch/master/graph/badge.svg)](https://codecov.io/gh/eddieantonio/fst-lookup)\n[![PyPI version](https://img.shields.io/pypi/v/fst-lookup.svg)](https://pypi.org/project/fst-lookup/)\n[![calver YYYY.MM.DD](https://img.shields.io/badge/calver-YYYY.MM.DD-22bfda.svg)](http://calver.org/)\n\nImplements lookup for FOMA format finite state transducers.\n\nSupports Python 3.5 and up.\n\nInstall\n-------\n\n pip install fst-lookup\n\nUsage\n-----\n\nImport the library, and load an FST from a file:\n\n> Hint: Test this module by [downloading the `eat` FST](https://github.com/eddieantonio/fst-lookup/raw/master/tests/data/eat.fomabin)!\n\n```python\n>>> from fst_lookup import FST\n>>> fst = FST.from_file('eat.fomabin')\n```\n\n### Assumed format of the FSTs\n\n`fst_lookup` assumes that the **lower** label corresponds to the surface\nform, while the **upper** label corresponds to the lemma, and linguistic\ntags and features: e.g., your `LEXC` will look something like\nthis---note what is on each side of the colon (`:`):\n\n```lexc\nMultichar_Symbols +N +Sg +Pl\nLexicon Root\n cow+N+Sg:cow #;\n cow+N+Pl:cows #;\n goose+N+Sg:goose #;\n goose+N+Pl:geese #;\n sheep+N+Sg:sheep #;\n sheep+N+Pl:sheep #;\n```\n\nIf your FST has labels on the opposite sides--e.g., the **upper** label\ncorresponds to the surface form and the **upper** label corresponds to\nthe lemma and linguistic tags---then instantiate the FST by providing\nthe `labels=\"invert\"` keyword argument:\n\n```python\nfst = FST.from_file('eat-inverted.fomabin', labels=\"invert\")\n```\n\n> **Hint**: FSTs originating from the HFST suite are often inverted, so\n> try to loading the FST inverted first if `.generate()` or `.analyze()`\n> aren't working correctly!\n\n\n### Analyze a word form\n\nTo _analyze_ a form (take a word form, and get its linguistic analyzes)\ncall the `analyze()` function:\n\n```python\ndef analyze(self, surface_form: str) -> Iterator[Analysis]\n```\n\nThis will yield all possible linguistic analyses produced by the FST.\n\nAn analysis is a tuple of strings. The strings are either linguistic\ntags, or the _lemma_ (base form of the word).\n\n`FST.analyze()` is a generator, so you must call `list()` to get a list.\n\n```python\n>>> list(sorted(fst.analyze('eats')))\n[('eat', '+N', '+Mass'),\n ('eat', '+V', '+3P', '+Sg')]\n```\n\n\n### Generate a word form\n\nTo _generate_ a form (take a linguistic analysis, and get its concrete\nword forms), call the `generate()` function:\n\n```python\ndef generate(self, analysis: str) -> Iterator[str]\n```\n\n`FST.generate()` is a Python generator, so you must call `list()` to get\na list.\n\n```python\n>>> list(fst.generate('eat+V+Past')))\n['ate']\n```\n\n\nLicense\n-------\n\nCopyright \u00a9 2019 Eddie Antonio Santos. Released under the terms of the\nApache license. See `LICENSE` for more info.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/eddieantonio/fst-lookup", "keywords": "fst lookup transducer morphology", "license": "", "maintainer": "", "maintainer_email": "", "name": "fst-lookup", "package_url": "https://pypi.org/project/fst-lookup/", "platform": "", "project_url": "https://pypi.org/project/fst-lookup/", "project_urls": { "Bug Reports": "https://github.com/eddieantonio/fst-lookup/issues", "Homepage": "https://github.com/eddieantonio/fst-lookup", "Source": "https://github.com/eddieantonio/fst-lookup" }, "release_url": "https://pypi.org/project/fst-lookup/2019.7.17/", "requires_dist": null, "requires_python": "", "summary": "Lookup FOMA FSTs", "version": "2019.7.17" }, "last_serial": 5546729, "releases": { "2019.1.22a0": [ { "comment_text": "", "digests": { "md5": "6f3107e54e5d44f072086b0f8552ced5", "sha256": "65e077f1b891c23a1ce972b45e5d64948f841044db74d86340d66a54f9d58f94" }, "downloads": -1, "filename": "fst_lookup-2019.1.22a0-py3-none-any.whl", "has_sig": false, "md5_digest": "6f3107e54e5d44f072086b0f8552ced5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9024, "upload_time": "2019-01-22T23:53:19", "url": "https://files.pythonhosted.org/packages/90/61/acc51d12caa2ee252244070c83f7a372ec539706a35da98f583f23a082ed/fst_lookup-2019.1.22a0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e86bfc268f62b6f8267b9c663a23dfd1", "sha256": "eda0308b958b611da2ffba8d71a84df020a487dc2e78a9f4f55a351ce0d0df7f" }, "downloads": -1, "filename": "fst-lookup-2019.1.22a0.tar.gz", "has_sig": false, "md5_digest": "e86bfc268f62b6f8267b9c663a23dfd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6240, "upload_time": "2019-01-22T23:53:21", "url": "https://files.pythonhosted.org/packages/23/e0/ff182955738da05b815594b54f2baa26aeae77e062bd7deedc6d6bca0e22/fst-lookup-2019.1.22a0.tar.gz" } ], "2019.1.30a0": [ { "comment_text": "", "digests": { "md5": "21ec550dfdaa89ca6c5e0aaf5c4a0609", "sha256": "069f74e558b01c942a17e510fe2d910c99e6687d1e8076afd73ae4f7a05e5c7e" }, "downloads": -1, "filename": "fst_lookup-2019.1.30a0-py3-none-any.whl", "has_sig": false, "md5_digest": "21ec550dfdaa89ca6c5e0aaf5c4a0609", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16290, "upload_time": "2019-01-31T00:02:09", "url": "https://files.pythonhosted.org/packages/64/e9/6a0c3434a522a6cf7f3adfebbbee66e4133f02faf5c5cfbe358784767d95/fst_lookup-2019.1.30a0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "584f6fd6f3f7221fd612da803f23d6c8", "sha256": "568de67662f4b55fd7529cb80729d2efb8343bfc274e54fab215876c537af592" }, "downloads": -1, "filename": "fst-lookup-2019.1.30a0.tar.gz", "has_sig": false, "md5_digest": "584f6fd6f3f7221fd612da803f23d6c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10955, "upload_time": "2019-01-31T00:01:57", "url": "https://files.pythonhosted.org/packages/c6/2b/a8792e0ea8d4dfd6f1d9bfd694bb7660ceb8eb31a1c918e7bf6cd29bf692/fst-lookup-2019.1.30a0.tar.gz" } ], "2019.1.31a0": [ { "comment_text": "", "digests": { "md5": "28a6d6b932140e7e6b3f076965c83238", "sha256": "4695ab357bb355d1d24054c6396f680622ea341773492851f70ca4c9374b36bc" }, "downloads": -1, "filename": "fst_lookup-2019.1.31a0-py3-none-any.whl", "has_sig": false, "md5_digest": "28a6d6b932140e7e6b3f076965c83238", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17358, "upload_time": "2019-02-01T00:35:59", "url": "https://files.pythonhosted.org/packages/ab/53/be0a3215b2ab2a36fcb94ebc7e96ac1e0425263872817a27377951031f82/fst_lookup-2019.1.31a0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "68ed38684cfb114bf3d773e22d916a2f", "sha256": "c47eb4ed5c7119ebc554618d25a3a24ea2d2d174165509b68efffa59c03cae28" }, "downloads": -1, "filename": "fst-lookup-2019.1.31a0.tar.gz", "has_sig": false, "md5_digest": "68ed38684cfb114bf3d773e22d916a2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12400, "upload_time": "2019-02-01T00:36:02", "url": "https://files.pythonhosted.org/packages/cd/68/94d1fc901ce62ab57648225a72ac8d091d37d96632d60e961fe41e893356/fst-lookup-2019.1.31a0.tar.gz" } ], "2019.2.1": [ { "comment_text": "", "digests": { "md5": "3b1918bd31dfe9bd8974ac83cdaef30c", "sha256": "3103c840bd58869b6ab3f6f2bbd254defffe0767df487ac2d4ccf07fa27d1d7c" }, "downloads": -1, "filename": "fst_lookup-2019.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3b1918bd31dfe9bd8974ac83cdaef30c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17529, "upload_time": "2019-02-01T17:27:14", "url": "https://files.pythonhosted.org/packages/0c/6b/16ef6ea384df273faf0e08b93608ebbe6964183e8fbbcd9e6e48168a152b/fst_lookup-2019.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e587a18c286ca2748195fc2c4cf32a22", "sha256": "09bb7a370d2d7fd9c698338eb69a4ad888c01a7f30b1539bc0e2a1a1311f0655" }, "downloads": -1, "filename": "fst-lookup-2019.2.1.tar.gz", "has_sig": false, "md5_digest": "e587a18c286ca2748195fc2c4cf32a22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12571, "upload_time": "2019-02-01T17:27:16", "url": "https://files.pythonhosted.org/packages/b3/28/d461f66728f9a86d3f2b845c859c8a792f20f4fd7302a8df12ebf7b2b6bc/fst-lookup-2019.2.1.tar.gz" } ], "2019.3.25": [ { "comment_text": "", "digests": { "md5": "813f7c157b83f2ba4575c2cc413bad4b", "sha256": "ac6d173fba9e2c33a7b8f6c6e120367f26a21f9add825aa188c3d6ed7057ed63" }, "downloads": -1, "filename": "fst_lookup-2019.3.25-py3-none-any.whl", "has_sig": false, "md5_digest": "813f7c157b83f2ba4575c2cc413bad4b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17709, "upload_time": "2019-03-25T18:53:57", "url": "https://files.pythonhosted.org/packages/1b/8b/84641d31190584b80f4bff32100a23e03c78f62e03eb3d6a87d4d34ff1a6/fst_lookup-2019.3.25-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6bd4dc02629da059ddb677ccb827addf", "sha256": "992a6ff51ce5d486864ced2de8111f646044e6f1f004b5e6e2b6a712308af202" }, "downloads": -1, "filename": "fst-lookup-2019.3.25.tar.gz", "has_sig": false, "md5_digest": "6bd4dc02629da059ddb677ccb827addf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12693, "upload_time": "2019-03-25T18:53:59", "url": "https://files.pythonhosted.org/packages/0c/e5/52f08ccbf752f636dfd34537cd338e5cf09148824f3c485e0cd27295ddc3/fst-lookup-2019.3.25.tar.gz" } ], "2019.6.10": [ { "comment_text": "", "digests": { "md5": "77da7eefd174bd82ec9f0f79735e2d05", "sha256": "22311e3b630b0d06115d68a52bf7fa5f0edb40990ae485d1c9734aa17a612d5e" }, "downloads": -1, "filename": "fst_lookup-2019.6.10-py3-none-any.whl", "has_sig": false, "md5_digest": "77da7eefd174bd82ec9f0f79735e2d05", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17661, "upload_time": "2019-06-10T23:58:30", "url": "https://files.pythonhosted.org/packages/11/4a/37f3ed62eb932ee21545b9ace411c0869236314d5c565e147edb05408bde/fst_lookup-2019.6.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "791391a9fc17d9a4f2395ca267da3a0e", "sha256": "5253c641a452f2c5de9c141ac9c68e0242d1bf097fecf15278455d63f9ff9ea7" }, "downloads": -1, "filename": "fst-lookup-2019.6.10.tar.gz", "has_sig": false, "md5_digest": "791391a9fc17d9a4f2395ca267da3a0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12670, "upload_time": "2019-06-10T23:58:32", "url": "https://files.pythonhosted.org/packages/73/40/1fff686b1d6e8f051d13d8befd89ae2d49b0a9f108dcadb795bdbc481b56/fst-lookup-2019.6.10.tar.gz" } ], "2019.7.17": [ { "comment_text": "", "digests": { "md5": "16120753dd66433871491d9051432e21", "sha256": "7c55b520942ab890d68ebfce3b50b0104e507b87f8c85e787185d5231cd10cbb" }, "downloads": -1, "filename": "fst_lookup-2019.7.17-py3-none-any.whl", "has_sig": false, "md5_digest": "16120753dd66433871491d9051432e21", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18123, "upload_time": "2019-07-17T16:23:46", "url": "https://files.pythonhosted.org/packages/68/a0/0686462fd4c355f7a3020d0688a70c88daf6f5ea0d2fc81c7487a0c9427b/fst_lookup-2019.7.17-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a00b8e173740552c481ab215e5d0da37", "sha256": "839c37e53c75c4e9fcd14c79c1960c40fa2f3fbc073f2e321d3d9c6cafeb026f" }, "downloads": -1, "filename": "fst-lookup-2019.7.17.tar.gz", "has_sig": false, "md5_digest": "a00b8e173740552c481ab215e5d0da37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13294, "upload_time": "2019-07-17T16:23:48", "url": "https://files.pythonhosted.org/packages/4d/23/5f8b3d6cad8be1cb9b79b376d18f6f5e71491a80c480857af832b5d785bf/fst-lookup-2019.7.17.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "16120753dd66433871491d9051432e21", "sha256": "7c55b520942ab890d68ebfce3b50b0104e507b87f8c85e787185d5231cd10cbb" }, "downloads": -1, "filename": "fst_lookup-2019.7.17-py3-none-any.whl", "has_sig": false, "md5_digest": "16120753dd66433871491d9051432e21", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18123, "upload_time": "2019-07-17T16:23:46", "url": "https://files.pythonhosted.org/packages/68/a0/0686462fd4c355f7a3020d0688a70c88daf6f5ea0d2fc81c7487a0c9427b/fst_lookup-2019.7.17-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a00b8e173740552c481ab215e5d0da37", "sha256": "839c37e53c75c4e9fcd14c79c1960c40fa2f3fbc073f2e321d3d9c6cafeb026f" }, "downloads": -1, "filename": "fst-lookup-2019.7.17.tar.gz", "has_sig": false, "md5_digest": "a00b8e173740552c481ab215e5d0da37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13294, "upload_time": "2019-07-17T16:23:48", "url": "https://files.pythonhosted.org/packages/4d/23/5f8b3d6cad8be1cb9b79b376d18f6f5e71491a80c480857af832b5d785bf/fst-lookup-2019.7.17.tar.gz" } ] }