{ "info": { "author": "KITT.AI", "author_email": "kittdotai@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "===============================================\nParsetron - A natural language semantic parser\n===============================================\n\n.. pypi version and download:\n .. image:: https://pypip.in/d/parsetron/badge.png\n :target: https://pypi.python.org/pypi/parsetron\n\n.. image:: https://travis-ci.org/Kitt-AI/parsetron.svg?branch=develop\n :target: https://travis-ci.org/Kitt-AI/parsetron\n\n.. image:: https://coveralls.io/repos/Kitt-AI/parsetron/badge.svg?branch=develop\n :target: https://coveralls.io/r/Kitt-AI/parsetron?branch=develop\n\n.. image:: https://readthedocs.org/projects/parsetron/badge/?version=latest\n :alt: Documentation Status\n :scale: 100%\n :target: https://readthedocs.org/projects/parsetron/\n\n\nA natural language semantic parser\n\nInstallation\n------------\n\n``pip install parsetron``\n\nParsetron is tested under Python 2.7 and Pypy. It doesn't support Python 3 yet.\n\nQuick Start\n-----------\n\nThe following is a grammar that parses natural language instruction on lights:\n\n.. code-block:: python\n\n from parsetron import Set, Regex, Optional, OneOrMore, Grammar, RobustParser\n\n class LightGrammar(Grammar):\n\n action = Set(['change', 'flash', 'set', 'blink'])\n light = Set(['top', 'middle', 'bottom'])\n color = Regex(r'(red|yellow|blue|orange|purple|...)')\n times = Set(['once', 'twice', 'three times']) | Regex(r'\\d+ times')\n one_parse = action + light + Optional(times) + color\n GOAL = OneOrMore(one_parse)\n\n @staticmethod\n def test():\n parser = RobustParser((LightGrammar()))\n sents = [\n \"set my top light to red\",\n \"set my top light to red and change middle light to yellow\",\n \"set my top light to red and change middle light to yellow and \"\n \"flash bottom light twice in blue\"\n ]\n for sent in sents:\n tree, result = parser.parse(sent)\n assert result.one_parse[0].color == 'red'\n\n print '\"%s\"' % sent\n print \"parse tree:\"\n print tree\n print \"parse result:\"\n print result\n print\n\n\nDependencies\n------------\n\nNone. Parsetron is a single ``parsetron.py`` file.\n\nParsetron is inspired by `pyparsing `_.\n\nGrammar Modules\n---------------\n\nParsetron supports modularized grammars: each grammar focuses on an individual\nsmall domain and can be imported via, for instance:\n\n.. code-block:: python\n\n from parsetron.grammars.colors import ColorsGrammar\n\n class YourCustomizedGrammar(Grammar):\n color = ColorsGrammar.GOAL\n\n\nYou are welcome to contribute your own grammar here (under\n``parsetron.grammars``). Send us a pull request!\n\nDevelopment\n-----------\n\n1. fork this repository\n2. install dev-specific packages::\n\n pip install -r requirements.txt\n\n3. then make your changes and follow the ``Makefile``.\n\n\nTODO\n----\n\n- [ ] Python 3 compatible\n- [ ] Unicode support\n\n\n\nDocumentation\n-------------\n\nThe full documentation is at http://parsetron.rtfd.org.\n\n\n\nHistory\n-------\n\n0.1.1 (2015-08-24)\n++++++++++++++++++\n\n* ParseResult now supports lex_span() method.\n\n0.1.0 (2015-06-19)\n++++++++++++++++++\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Kitt-AI/parsetron", "keywords": "parsetron", "license": "Apache", "maintainer": null, "maintainer_email": null, "name": "parsetron", "package_url": "https://pypi.org/project/parsetron/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/parsetron/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Kitt-AI/parsetron" }, "release_url": "https://pypi.org/project/parsetron/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "A natural language semantic parser", "version": "0.1.1" }, "last_serial": 1664630, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "99f6b5c156bb1445dc796fb1a3435ea6", "sha256": "3ec35eb405a999e1bce65f4d60ccc7c3f4c2a41a53c58dcdf953f6d08cd556ef" }, "downloads": -1, "filename": "parsetron-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "99f6b5c156bb1445dc796fb1a3435ea6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 34496, "upload_time": "2015-06-19T18:26:09", "url": "https://files.pythonhosted.org/packages/e1/64/eeabbabd01f96b702dbb78cf232c1fee02d564a5d105cb3c0596a45ecbf2/parsetron-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "75784fb56b527c951b403f21923ab5e5", "sha256": "43c004c0aec7b76b1b7e60d48966344e50b3fa75d23e34f9792ec6ec8460d59c" }, "downloads": -1, "filename": "parsetron-0.1.0.tar.gz", "has_sig": false, "md5_digest": "75784fb56b527c951b403f21923ab5e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39636, "upload_time": "2015-06-19T18:26:05", "url": "https://files.pythonhosted.org/packages/ce/0b/214ea73707afa54b0b5108e4950dc8ad8ea54c4597d3db5bf23ef439cf5b/parsetron-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "aff9f3001349d7e40109927358b60426", "sha256": "769c21a4d3ae3434bdb5b74b82da4d9f87fe76f9e967830100ceddf946ae2b33" }, "downloads": -1, "filename": "parsetron-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aff9f3001349d7e40109927358b60426", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 35570, "upload_time": "2015-08-05T01:02:22", "url": "https://files.pythonhosted.org/packages/8e/12/74a09e3a6bb03d8f926e2f58302276adfb23a9fe3def0d527021f0f22ec0/parsetron-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "24cee8fe079670c12ff1897fcccb2b80", "sha256": "97324cec1bfc011e0728640fe16d46ee2cf064253863c7174aa5a8d329ffa980" }, "downloads": -1, "filename": "parsetron-0.1.1.tar.gz", "has_sig": false, "md5_digest": "24cee8fe079670c12ff1897fcccb2b80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40962, "upload_time": "2015-08-05T01:02:18", "url": "https://files.pythonhosted.org/packages/5d/85/aa5a6c53471386f6d7a8502d6a172e146807cccd3026825d374a1f4f4888/parsetron-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aff9f3001349d7e40109927358b60426", "sha256": "769c21a4d3ae3434bdb5b74b82da4d9f87fe76f9e967830100ceddf946ae2b33" }, "downloads": -1, "filename": "parsetron-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aff9f3001349d7e40109927358b60426", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 35570, "upload_time": "2015-08-05T01:02:22", "url": "https://files.pythonhosted.org/packages/8e/12/74a09e3a6bb03d8f926e2f58302276adfb23a9fe3def0d527021f0f22ec0/parsetron-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "24cee8fe079670c12ff1897fcccb2b80", "sha256": "97324cec1bfc011e0728640fe16d46ee2cf064253863c7174aa5a8d329ffa980" }, "downloads": -1, "filename": "parsetron-0.1.1.tar.gz", "has_sig": false, "md5_digest": "24cee8fe079670c12ff1897fcccb2b80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40962, "upload_time": "2015-08-05T01:02:18", "url": "https://files.pythonhosted.org/packages/5d/85/aa5a6c53471386f6d7a8502d6a172e146807cccd3026825d374a1f4f4888/parsetron-0.1.1.tar.gz" } ] }