{ "info": { "author": "Sushain K. Cherivirala", "author_email": "sushain@skc.name", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Text Processing :: Linguistic" ], "description": "# Apertium Streamparser\n\n[![Build Status](https://travis-ci.org/apertium/streamparser.svg)](https://travis-ci.org/apertium/streamparser)\n[![Coverage Status](https://coveralls.io/repos/github/apertium/streamparser/badge.svg?branch=master)](https://coveralls.io/github/apertium/streamparser?branch=master)\n[![PyPI](https://img.shields.io/pypi/v/apertium-streamparser.svg)](https://pypi.org/project/apertium-streamparser/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/apertium-streamparser.svg)]((https://pypi.org/project/apertium-streamparser/))\n[![PyPI - Implementation](https://img.shields.io/pypi/implementation/apertium-streamparser.svg)]((https://pypi.org/project/apertium-streamparser/))\n\nPython 3 library to parse [Apertium stream format][1], generating `LexicalUnit`s.\n\n## Installation\n\nStreamparser is available through [PyPi][2]:\n\n $ pip install apertium-streamparser\n $ apertium-streamparser\n $^vino/vino/venir$\n [[SReading(baseform='vino', tags=['n', 'm', 'sg'])], [SReading(baseform='venir', tags=['vblex', 'ifi', 'p3', 'sg'])]]\n\nInstallation through PyPi will also install the `streamparser` module.\n\n## Usage\n\n### As a library\n\n#### With string input\n\n```python\n>>> from streamparser import parse\n>>> lexical_units = parse('^hypercholesterolemia/*hypercholesterolemia$\\[\\]\\^\\$[^ignoreme/yesreally$]^a\\/s/a\\/s$^vino/vino/venir$.eefe^d\u00edmelo/decir+me+lo/decir+me+lo$')\n>>> for lexical_unit in lexical_units:\n print('%s (%s) \u2192 %s' % (lexical_unit.wordform, lexical_unit.knownness, lexical_unit.readings))\n```\n\n hypercholesterolemia () \u2192 [[SReading(baseform='*hypercholesterolemia', tags=[])]]\n a\\/s () \u2192 [[SReading(baseform='a\\\\/s', tags=['n', 'nt'])]]\n vino () \u2192 [[SReading(baseform='vino', tags=['n', 'm', 'sg'])], [SReading(baseform='venir', tags=['vblex', 'ifi', 'p3', 'sg'])]]\n d\u00edmelo () \u2192 [[SReading(baseform='decir', tags=['vblex', 'imp', 'p2', 'sg']), SReading(baseform='me', tags=['prn', 'enc', 'p1', 'mf', 'sg']), SReading(baseform='lo', tags=['prn', 'enc', 'p3', 'nt'])], [SReading(baseform='decir', tags=['vblex', 'imp', 'p2', 'sg']), SReading(baseform='me', tags=['prn', 'enc', 'p1', 'mf', 'sg']), SReading(baseform='lo', tags=['prn', 'enc', 'p3', 'm', 'sg'])]]\n\n#### With file input\n\n```python\n>>> from streamparser import parse_file\n>>> lexical_units = parse_file(open('~/Downloads/analyzed.txt'))\n>>> for lexical_unit in lexical_units:\n print('%s (%s) \u2192 %s' % (lexical_unit.wordform, lexical_unit.knownness, lexical_unit.readings))\n```\n\n H\u00f8gre () \u2192 [[SReading(baseform='H\u00f8gre', tags=['np'])], [SReading(baseform='h\u00f8gre', tags=['n', 'nt', 'sp'])], [SReading(baseform='h\u00f8g', tags=['un', 'sint', 'sp', 'comp', 'adj'])], [SReading(baseform='h\u00f8gre', tags=['f', 'n', 'ind', 'sg'])], [SReading(baseform='h\u00f8gre', tags=['f', 'n', 'ind', 'sg'])], [SReading(baseform='h\u00f8gre', tags=['sg', 'nt', 'ind', 'posi', 'adj'])], [SReading(baseform='h\u00f8gre', tags=['mf', 'sg', 'ind', 'posi', 'adj'])], [SReading(baseform='h\u00f8gre', tags=['un', 'ind', 'pl', 'posi', 'adj'])], [SReading(baseform='h\u00f8gre', tags=['un', 'def', 'sp', 'posi', 'adj'])]]\n kolonne () \u2192 [[SReading(baseform='kolonne', tags=['m', 'n', 'ind', 'sg'])], [SReading(baseform='kolonne', tags=['m', 'n', 'ind', 'sg'])]]\n Grunnprinsipp () \u2192 [[SReading(baseform='grunnprinsipp', tags=['n', 'nt', 'ind', 'sg'])], S[Reading(baseform='grunnprinsipp', tags=['n', 'nt', 'pl', 'ind'])], [SReading(baseform='grunnprinsipp', tags=['n', 'nt', 'ind', 'sg'])], [SReading(baseform='grunnprinsipp', tags=['n', 'nt', 'pl', 'ind'])]]\n 7 () \u2192 [[SReading(baseform='7', tags=['qnt', 'pl', 'det'])]]\n px () \u2192 []\n\n### From the terminal\n\n#### With standard input\n\n```bash\n$ bzcat ~/corpora/nnclean2.txt.bz2 | apertium-deshtml | lt-proc -we /usr/share/apertium/apertium-nno/nno.automorf.bin | python3 streamparser.py\n[[SReading(baseform='H\u00f8gre', tags=['np'])],\n [SReading(baseform='h\u00f8gre', tags=['n', 'sp', 'nt'])],\n [SReading(baseform='h\u00f8g', tags=['un', 'sp', 'adj', 'comp', 'sint'])],\n [SReading(baseform='h\u00f8gre', tags=['n', 'f', 'ind', 'sg'])],\n [SReading(baseform='h\u00f8gre', tags=['n', 'f', 'ind', 'sg'])],\n [SReading(baseform='h\u00f8gre', tags=['posi', 'ind', 'adj', 'nt', 'sg'])],\n [SReading(baseform='h\u00f8gre', tags=['posi', 'ind', 'adj', 'mf', 'sg'])],\n [SReading(baseform='h\u00f8gre', tags=['posi', 'ind', 'adj', 'un', 'pl'])],\n [SReading(baseform='h\u00f8gre', tags=['posi', 'def', 'sp', 'adj', 'un'])]]\n[[SReading(baseform='kolonne', tags=['n', 'm', 'ind', 'sg'])],\n [SReading(baseform='kolonne', tags=['n', 'm', 'ind', 'sg'])]]\n...\n```\n\n#### With file input in terminal\n\n```bash\n$ bzcat ~/corpora/nnclean2.txt.bz2 | apertium-deshtml | lt-proc -we /usr/share/apertium/apertium-nno/nno.automorf.bin > analyzed.txt\n$ python3 streamparser.py analyzed.txt\n[[SReading(baseform='H\u00f8gre', tags=['np'])],\n [SReading(baseform='h\u00f8gre', tags=['n', 'sp', 'nt'])],\n [SReading(baseform='h\u00f8g', tags=['un', 'sp', 'adj', 'comp', 'sint'])],\n [SReading(baseform='h\u00f8gre', tags=['n', 'f', 'ind', 'sg'])],\n [SReading(baseform='h\u00f8gre', tags=['n', 'f', 'ind', 'sg'])],\n [SReading(baseform='h\u00f8gre', tags=['posi', 'ind', 'adj', 'nt', 'sg'])],\n [SReading(baseform='h\u00f8gre', tags=['posi', 'ind', 'adj', 'mf', 'sg'])],\n [SReading(baseform='h\u00f8gre', tags=['posi', 'ind', 'adj', 'un', 'pl'])],\n [SReading(baseform='h\u00f8gre', tags=['posi', 'def', 'sp', 'adj', 'un'])]]\n[[SReading(baseform='kolonne', tags=['n', 'm', 'ind', 'sg'])],\n [SReading(baseform='kolonne', tags=['n', 'm', 'ind', 'sg'])]]\n...\n```\n\n## Contributing\n\nStreamparser uses [TravisCI][3] for continous integration. Locally, use\n`make test` to run the same checks it does. Use `pip install -r requirements.txt`\nto install the requirements required for development, e.g. linters.\n\n[1]: http://wiki.apertium.org/wiki/Apertium_stream_format\n[2]: https://pypi.org/project/apertium-streamparser/\n[3]: https://travis-ci.org/apertium/streamparser", "description_content_type": "text/markdown; charset=UTF-8", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/apertium/streamparser", "keywords": "apertium parsing linguistics", "license": "GPLv3+", "maintainer": "", "maintainer_email": "", "name": "apertium-streamparser", "package_url": "https://pypi.org/project/apertium-streamparser/", "platform": "", "project_url": "https://pypi.org/project/apertium-streamparser/", "project_urls": { "Homepage": "https://github.com/apertium/streamparser" }, "release_url": "https://pypi.org/project/apertium-streamparser/5.0.2/", "requires_dist": null, "requires_python": ">=3.4", "summary": "Python library to parse Apertium stream format", "version": "5.0.2" }, "last_serial": 3785638, "releases": { "5.0.0": [ { "comment_text": "", "digests": { "md5": "f6ed3768e743137551964c0b07136a15", "sha256": "54d75fbe7573af4a59d637041264f42ff115c2d29fbd26ebfd1618d8f8a6623c" }, "downloads": -1, "filename": "apertium_streamparser-5.0.0-py3-none-any.whl", "has_sig": true, "md5_digest": "f6ed3768e743137551964c0b07136a15", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7110, "upload_time": "2018-03-22T04:04:49", "url": "https://files.pythonhosted.org/packages/14/47/c731fe4e2a2029d8a0a4636066139d26ae41f10e568381d57b9996d9e035/apertium_streamparser-5.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd0b35427141fac5ff142a01d6867c68", "sha256": "48ec6f337a2727367836539c038194c625fe40774ed551ef18ba0adf62d5a497" }, "downloads": -1, "filename": "apertium-streamparser-5.0.0.tar.gz", "has_sig": true, "md5_digest": "bd0b35427141fac5ff142a01d6867c68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18512, "upload_time": "2018-03-22T04:04:46", "url": "https://files.pythonhosted.org/packages/84/43/5d292edf92a24af913f422ebaac13d2bd92a0833e788ef221c9597484417/apertium-streamparser-5.0.0.tar.gz" } ], "5.0.1": [ { "comment_text": "", "digests": { "md5": "cfe263db91f5718f0bf4c9f6bf82bcaf", "sha256": "a864c2ada76a96a0645f0c3db2b99e0ccf6d92a80cad33215c3eea71242cbd28" }, "downloads": -1, "filename": "apertium_streamparser-5.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "cfe263db91f5718f0bf4c9f6bf82bcaf", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7709, "upload_time": "2018-03-25T01:42:09", "url": "https://files.pythonhosted.org/packages/31/ff/73e2d3d78a050d3a594c1ebc0bae9dbe061af3ec32658e16768a7021730e/apertium_streamparser-5.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95e67adfc4a012946b824067b188d9b5", "sha256": "88dd0c4b0334610092f2fe275d1b42e6ad58349c4149de0a0f623a1750d6f2b8" }, "downloads": -1, "filename": "apertium-streamparser-5.0.1.tar.gz", "has_sig": true, "md5_digest": "95e67adfc4a012946b824067b188d9b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18861, "upload_time": "2018-03-25T01:42:07", "url": "https://files.pythonhosted.org/packages/1a/eb/75a801d0735d7d6832efe9055272c934bc110892ab8971dc827382a20e58/apertium-streamparser-5.0.1.tar.gz" } ], "5.0.2": [ { "comment_text": "", "digests": { "md5": "c78164e8f3a530bf1a53fc17888b4c04", "sha256": "e14e99f9a682725b6f8c0955f86d79319d7786d2e43b1dcaa50f4151b0410771" }, "downloads": -1, "filename": "apertium_streamparser-5.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c78164e8f3a530bf1a53fc17888b4c04", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 5659, "upload_time": "2018-04-20T19:48:02", "url": "https://files.pythonhosted.org/packages/ca/47/85027843345b1d7e4d0beca98c3c55ac8bb1b2d9069a126877b645be481c/apertium_streamparser-5.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bfd1392e541c7e51d4a69995c9277bc0", "sha256": "fd83d3d573d23c54b34339865cdd40cded3687311c18629d2d39c4e8ad1da597" }, "downloads": -1, "filename": "apertium-streamparser-5.0.2.tar.gz", "has_sig": true, "md5_digest": "bfd1392e541c7e51d4a69995c9277bc0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 19285, "upload_time": "2018-04-20T19:47:26", "url": "https://files.pythonhosted.org/packages/6e/04/c85695308d203650dc0d9f550fbdc0e6a839364b7515d77a76f2e8e19de9/apertium-streamparser-5.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c78164e8f3a530bf1a53fc17888b4c04", "sha256": "e14e99f9a682725b6f8c0955f86d79319d7786d2e43b1dcaa50f4151b0410771" }, "downloads": -1, "filename": "apertium_streamparser-5.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c78164e8f3a530bf1a53fc17888b4c04", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 5659, "upload_time": "2018-04-20T19:48:02", "url": "https://files.pythonhosted.org/packages/ca/47/85027843345b1d7e4d0beca98c3c55ac8bb1b2d9069a126877b645be481c/apertium_streamparser-5.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bfd1392e541c7e51d4a69995c9277bc0", "sha256": "fd83d3d573d23c54b34339865cdd40cded3687311c18629d2d39c4e8ad1da597" }, "downloads": -1, "filename": "apertium-streamparser-5.0.2.tar.gz", "has_sig": true, "md5_digest": "bfd1392e541c7e51d4a69995c9277bc0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 19285, "upload_time": "2018-04-20T19:47:26", "url": "https://files.pythonhosted.org/packages/6e/04/c85695308d203650dc0d9f550fbdc0e6a839364b7515d77a76f2e8e19de9/apertium-streamparser-5.0.2.tar.gz" } ] }