{ "info": { "author": "Aidan Pine", "author_email": "hello@aidanpine.ca", "bugtrack_url": null, "classifiers": [], "description": "# G\u2071-2-P\u2071\n\n[![Coverage Status](https://coveralls.io/repos/github/roedoejet/g2p/badge.svg?branch=master)](https://coveralls.io/github/roedoejet/g2p?branch=master)\n[![Build Status](https://travis-ci.org/roedoejet/g2p.svg?branch=master)](https://travis-ci.org/roedoejet/g2p)\n[![PyPI package](https://img.shields.io/pypi/v/g2p.svg)](https://pypi.org/project/g2p/)\n[![license](https://img.shields.io/github/license/roedoejet/g2p.svg)](LICENSE)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/roedoejet/g2p)\n\n> Grapheme-to-Phoneme transductions that preserve input and output indices!\n\nThis library is for handling arbitrary transductions between input and output segments while preserving indices.\n\n## Table of Contents\n- [G\u2071-2-P\u2071](#g%e2%81%b1-2-p%e2%81%b1)\n - [Table of Contents](#table-of-contents)\n - [Background](#background)\n - [Install](#install)\n - [Usage](#usage)\n - [Mapping](#mapping)\n - [Transducer](#transducer)\n - [Studio](#studio)\n - [Maintainers](#maintainers)\n - [Contributing](#contributing)\n - [Contributors](#contributors)\n - [License](#license)\n\n## Background\n\nThe initial version of this package was developed by [Patrick Littell](https://github.com/littell) and was developed in order to allow for g2p from community orthographies to IPA and back again in [ReadAlong-Studio](https://github.com/dhdaines/ReadAlong-Studio). We decided to then pull out the g2p mechanism from [Convertextract](https://github.com/roedoejet/convertextract) which allows transducer relations to be declared in CSV files, and turn it into its own library - here it is!\n\n## Install\n\nThe best thing to do is install with pip `pip install g2p`. \n\nOtherwise, clone the repo and pip install it locally.\n\n```sh\n$ git clone https://github.com/roedoejet/g2p.git\n$ cd g2p\n$ pip install -e .\n```\n\n## Usage\n\nIn order to initialize a `Transducer`, you must first create a `Mapping` object.\n\n### Mapping\n\nYou can create mappings either by initializing them directly with a list:\n\n```python\nfrom g2p.mappings import Mapping\n\nmappings = Mapping([{\"in\": 'a', \"out\": 'b'}])\n\n```\n\nAlternatively, you can add a CSV file to g2p/mappings/langs/``/``\n\n```python\nfrom g2p.mappings import Mapping\n\nmappings = Mapping(language={\"lang\": \"\", \"table\": \"\"})\n\n```\n\n### Transducer\n\nInitialize a `Transducer` with a `Mapping` object. Calling the `Transducer` then produces the output. In order to preserve the indices, pass index=True when calling the `Transducer`.\n\n```python\nfrom g2p.mappings import Mapping\nfrom g2p.transducer import Transducer\n\nmappings = Mapping([{\"in\": 'a', \"out\": 'b'}])\ntransducer = Transducer(mappings)\ntransducer('a')\n# 'b'\ntransducer('a', index=True)\n# ('b', )\n\n```\n\nTo make sense of the `IOStates` object that is produced, you can either call it, and produce a list of each character. Doing that for the above produces `[((0, 'a'), (0, 'b'))]` - a list of relation tuples where each relation tuple is comprised of an input and output. Each input tuple and output tuple is in turn comprised of an index and a corresponding character. You can also call `output()` and `input()` to see the plain text output and input respectively.\n\n## Studio\n\nYou can also run the `g2p Studio` which is a web interface for creating custom lookup tables to be used with g2p. To run the `g2p Studio` either visit ***** or run it locally using `python run_studio.py`. \n\nYou can also import the app directly from the package:\n\n```python\nfrom g2p import app\n\napp.run(host='0.0.0.0', port=5000, debug=True)\n```\n\n\n## Maintainers\n\n[@roedoejet](https://github.com/roedoejet).\n\n\n## Contributing\n\nFeel free to dive in! [Open an issue](https://github.com/roedoejet/g2p/issues/new) or submit PRs.\n\nThis repo follows the [Contributor Covenant](http://contributor-covenant.org/version/1/3/0/) Code of Conduct.\n\n### Contributors\n\nThis project exists thanks to all the people who contribute. \n\n[@littell](https://github.com/littell).\n[@finguist](https://github.com/finguist).\n\n\n## License\n\n[MIT](LICENSE) \u00a9 Aidan Pine\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/roedoejet/g2p", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "g2p", "package_url": "https://pypi.org/project/g2p/", "platform": "", "project_url": "https://pypi.org/project/g2p/", "project_urls": { "Homepage": "https://github.com/roedoejet/g2p" }, "release_url": "https://pypi.org/project/g2p/0.13.20190822/", "requires_dist": [ "openpyxl", "coloredlogs", "Flask", "flask-socketio", "flask-talisman", "pyyaml", "regex" ], "requires_python": ">=3.6", "summary": "Module for creating context-aware, rule-based G2P mappings that preserve indices", "version": "0.13.20190822" }, "last_serial": 5858244, "releases": { "0.1.20190801": [ { "comment_text": "", "digests": { "md5": "134f957ffd8d34ac81b9663ff298c241", "sha256": "2c7c4c039683cefa84356eea7583eb96638d3d3f84f64121a28dde3bf785c3e4" }, "downloads": -1, "filename": "g2p-0.1.20190801-py3-none-any.whl", "has_sig": false, "md5_digest": "134f957ffd8d34ac81b9663ff298c241", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 1297505, "upload_time": "2019-08-02T03:36:25", "url": "https://files.pythonhosted.org/packages/2f/2c/4c37b956600e9f8bb0318ec61f0f487eab11de44b13fda9f568a4bf340c4/g2p-0.1.20190801-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0bc8f77dcc78bc7b9f73dbe8aca50a1e", "sha256": "d817d1f4b1ed9bd159d6178476bbd535b34f89d71ed101c4c408c76699d643bb" }, "downloads": -1, "filename": "g2p-0.1.20190801.tar.gz", "has_sig": false, "md5_digest": "0bc8f77dcc78bc7b9f73dbe8aca50a1e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 633526, "upload_time": "2019-08-02T03:36:30", "url": "https://files.pythonhosted.org/packages/65/08/53b0f6802e2897911ff51c0a8e741c819cbde4726bfb80e247633fd87f6f/g2p-0.1.20190801.tar.gz" } ], "0.1.20190806": [ { "comment_text": "", "digests": { "md5": "bd9d76e40ed870fb1809de6b4189cb68", "sha256": "f7df807ed3991a81213e78d229bdf3477580a193531456d355b23ac385ac6b3f" }, "downloads": -1, "filename": "g2p-0.1.20190806-py3-none-any.whl", "has_sig": false, "md5_digest": "bd9d76e40ed870fb1809de6b4189cb68", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 1299019, "upload_time": "2019-08-07T00:38:53", "url": "https://files.pythonhosted.org/packages/e3/62/9e8916829c699c5c162d80fd233eaa7fc37a32e571f0a55cbd795e13c104/g2p-0.1.20190806-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "924e73035a983440ef8b1b675898baa5", "sha256": "ee385222edbaadff529e4629cfbb3d00fcdc5ebcb0a612f8b6f25515f573b380" }, "downloads": -1, "filename": "g2p-0.1.20190806.tar.gz", "has_sig": false, "md5_digest": "924e73035a983440ef8b1b675898baa5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 634434, "upload_time": "2019-08-07T00:38:57", "url": "https://files.pythonhosted.org/packages/f7/04/3ac60b2ceb17da37263059eb92703e5cb76af9367402b63d289e57756a8b/g2p-0.1.20190806.tar.gz" } ], "0.1.20190808": [ { "comment_text": "", "digests": { "md5": "10b6a8af12d80ba17d3596beaac10f2f", "sha256": "a8b8463afedf7efb2ed3504857538e96b9cfca01214eac50475b7d79e10075eb" }, "downloads": -1, "filename": "g2p-0.1.20190808-py3-none-any.whl", "has_sig": false, "md5_digest": "10b6a8af12d80ba17d3596beaac10f2f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 1299117, "upload_time": "2019-08-09T01:53:06", "url": "https://files.pythonhosted.org/packages/fa/90/c9c7eae37fcf013d3a63e515458ac8bcab194802d809daa736dd237fa128/g2p-0.1.20190808-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c87df692c252b0b35103f55de6d13f97", "sha256": "a7e5cd17860e0d8868447f627b93ff42bd5ef61e4f2ce4538f1001bfc0de765a" }, "downloads": -1, "filename": "g2p-0.1.20190808.tar.gz", "has_sig": false, "md5_digest": "c87df692c252b0b35103f55de6d13f97", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 634484, "upload_time": "2019-08-09T01:53:09", "url": "https://files.pythonhosted.org/packages/31/f7/677aec16be9eabb21e11f202fe145c462373ffbbb64b3da0baddad968039/g2p-0.1.20190808.tar.gz" } ], "0.1.20190816": [ { "comment_text": "", "digests": { "md5": "08497a671698ca0120017d1556722319", "sha256": "1a7c675ecdd7f9cf3746ebb7fac96cc3e14068da20ad12485775ac07278cf914" }, "downloads": -1, "filename": "g2p-0.1.20190816-py3-none-any.whl", "has_sig": false, "md5_digest": "08497a671698ca0120017d1556722319", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 1300869, "upload_time": "2019-08-16T18:51:14", "url": "https://files.pythonhosted.org/packages/ba/7d/ce41f7f2285a10f6926ec2a1673a7686677db105a20db0ca4daa4b8ea11b/g2p-0.1.20190816-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43025dd7aaec08d963b30cec30ee12a0", "sha256": "df499c666a49c954819ec4bcd1630156bb97dff93df656af67950a5ebab86706" }, "downloads": -1, "filename": "g2p-0.1.20190816.tar.gz", "has_sig": false, "md5_digest": "43025dd7aaec08d963b30cec30ee12a0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 636646, "upload_time": "2019-08-16T18:51:17", "url": "https://files.pythonhosted.org/packages/c1/da/e98b4bc48df0e6a10d94a1767bd07388aafe4ea1777ce3afa93463423362/g2p-0.1.20190816.tar.gz" } ], "0.11.20190816": [ { "comment_text": "", "digests": { "md5": "4739788e4f5273b5b474a639b6be654a", "sha256": "9438173c698532134aa80389507e4326c1e4fd07772f4820634701f17d1aebbf" }, "downloads": -1, "filename": "g2p-0.11.20190816-py3-none-any.whl", "has_sig": false, "md5_digest": "4739788e4f5273b5b474a639b6be654a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 1300945, "upload_time": "2019-08-16T18:57:29", "url": "https://files.pythonhosted.org/packages/11/52/3bf9577d6153e9044c194c1230f29d752b3abe0399f43fc1fefaa0a50c13/g2p-0.11.20190816-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0ef845a9d11405774f6356b5efadaa25", "sha256": "a1b7f4523749b2a27bbfc5dd41122f5e59dfd12f5aaac91ab508d08947843899" }, "downloads": -1, "filename": "g2p-0.11.20190816.tar.gz", "has_sig": false, "md5_digest": "0ef845a9d11405774f6356b5efadaa25", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 636684, "upload_time": "2019-08-16T18:57:32", "url": "https://files.pythonhosted.org/packages/f4/fa/3be83f43d84deda76e0ccc8c344d43308564286e5646338f6792063ab4f7/g2p-0.11.20190816.tar.gz" } ], "0.12.20190816": [ { "comment_text": "", "digests": { "md5": "cae77112949148b86ec4378fb97d7240", "sha256": "88fac5d69f9ee4f47df5caaf37c9bb141dc925127603a12f308eebde49798ad4" }, "downloads": -1, "filename": "g2p-0.12.20190816-py3-none-any.whl", "has_sig": false, "md5_digest": "cae77112949148b86ec4378fb97d7240", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 1300986, "upload_time": "2019-08-16T19:01:42", "url": "https://files.pythonhosted.org/packages/c0/d0/5757942431c89bfb9a8a571ba32e412b31877b4d1b9096009239c22b4aca/g2p-0.12.20190816-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "021a95d6a4bc648995598432f53087a5", "sha256": "f62e020d0c161ea745afc2eb63a9e84af575b7b9addfb7ef13cbf6e46f35eac3" }, "downloads": -1, "filename": "g2p-0.12.20190816.tar.gz", "has_sig": false, "md5_digest": "021a95d6a4bc648995598432f53087a5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 636787, "upload_time": "2019-08-16T19:01:45", "url": "https://files.pythonhosted.org/packages/30/05/36237eec69a71bc140a1fca88d2cc030a9cbd2ebae3b327a3f0ab6be0244/g2p-0.12.20190816.tar.gz" } ], "0.12.20190819": [ { "comment_text": "", "digests": { "md5": "346d166a3de944c37b6b54d8970665fd", "sha256": "c75d87a284d831980c90c59ed1e3703a335ee56b3f6687cd43c812c9215ca11f" }, "downloads": -1, "filename": "g2p-0.12.20190819-py3-none-any.whl", "has_sig": false, "md5_digest": "346d166a3de944c37b6b54d8970665fd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 1303111, "upload_time": "2019-08-19T18:03:29", "url": "https://files.pythonhosted.org/packages/52/38/abfca86f493518a37ed9fa98a34cf362e745e177007745f679c95cb3cb5c/g2p-0.12.20190819-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "758825ec5115f4da27ebcc2e6b81379a", "sha256": "782ab5bcbb6075d3fc9008cd6973280a9529a0ef016859bc6e3c7ad7abd20255" }, "downloads": -1, "filename": "g2p-0.12.20190819.tar.gz", "has_sig": false, "md5_digest": "758825ec5115f4da27ebcc2e6b81379a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 638930, "upload_time": "2019-08-19T18:03:32", "url": "https://files.pythonhosted.org/packages/16/c9/aafd93114393c87d78f1445e746d788b321e580ef27e8f67f486dcaaa5f0/g2p-0.12.20190819.tar.gz" } ], "0.12.20190822": [ { "comment_text": "", "digests": { "md5": "52831e873ac6553dd07644575120bd1a", "sha256": "1a520fb6ffca1f1db271269089f32adc729c1e25d321aaf22061cc654ae548ae" }, "downloads": -1, "filename": "g2p-0.12.20190822-py3-none-any.whl", "has_sig": false, "md5_digest": "52831e873ac6553dd07644575120bd1a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 2199825, "upload_time": "2019-08-22T22:35:24", "url": "https://files.pythonhosted.org/packages/33/e6/9aca7a034c648e33f410a26bc1b8598c800113897b2a15d2da3c80ce8d44/g2p-0.12.20190822-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1335b27de90bff3c22f33b9f7c9d15de", "sha256": "189065eeb1103436ddb72b2c1a2eac6389c69996f724a6ef7a76bc6a7fe73319" }, "downloads": -1, "filename": "g2p-0.12.20190822.tar.gz", "has_sig": false, "md5_digest": "1335b27de90bff3c22f33b9f7c9d15de", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 1519979, "upload_time": "2019-08-22T22:35:28", "url": "https://files.pythonhosted.org/packages/5a/e0/a078a3c9ccd58594e1ff2c3c4ceb7338f18e89bcf3f060dc7e33e3254589/g2p-0.12.20190822.tar.gz" } ], "0.13.20190822": [ { "comment_text": "", "digests": { "md5": "2977d927b277b08c4c49b610f4cfee9f", "sha256": "8711e0f1cfc963188616151cdb24562657d8d5c0f2882b907d5b4e8ec92f9905" }, "downloads": -1, "filename": "g2p-0.13.20190822-py3-none-any.whl", "has_sig": false, "md5_digest": "2977d927b277b08c4c49b610f4cfee9f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 2200064, "upload_time": "2019-08-22T22:41:51", "url": "https://files.pythonhosted.org/packages/f2/f3/c0e4e8216e003aa9f8c9c165237ea3a4eca91907208bbf9934399f602b79/g2p-0.13.20190822-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "05c115b2b2eeeffb7f48ebcb284fb35f", "sha256": "d55010ef7702d98cd281455a9a765eb02d2d91c6713fbc48196ed6959be60aa3" }, "downloads": -1, "filename": "g2p-0.13.20190822.tar.gz", "has_sig": false, "md5_digest": "05c115b2b2eeeffb7f48ebcb284fb35f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 1520020, "upload_time": "2019-08-22T22:41:55", "url": "https://files.pythonhosted.org/packages/c3/a2/3763d4686eb9bf62c5a681a61aefb32011ef9043cbf4625b96c1767d1176/g2p-0.13.20190822.tar.gz" } ], "0.2.20190919": [ { "comment_text": "", "digests": { "md5": "5ee6f4cc2c03db105dab2c5688e8fa43", "sha256": "9fd574e842a715359dc8dd21201561890bba342a931934b7d3981c56d5c94758" }, "downloads": -1, "filename": "g2p-0.2.20190919-py3-none-any.whl", "has_sig": false, "md5_digest": "5ee6f4cc2c03db105dab2c5688e8fa43", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 2237175, "upload_time": "2019-09-19T19:08:22", "url": "https://files.pythonhosted.org/packages/b4/dd/041de95371a0b181ce20013d8af31974bc33c2fa2be7daf1333d2f9dc906/g2p-0.2.20190919-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1f7b3a4c28c26058d2ae036989eeaf83", "sha256": "184a28b8e068228cc74fd829098b57dd7b40934f0ea9dfbd8ff30db62cbe35a3" }, "downloads": -1, "filename": "g2p-0.2.20190919.tar.gz", "has_sig": false, "md5_digest": "1f7b3a4c28c26058d2ae036989eeaf83", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 1542296, "upload_time": "2019-09-19T19:08:25", "url": "https://files.pythonhosted.org/packages/1a/a1/d6bc95623b0fe596719fd3d822a131966d059e510b796b6089ae9be9a0d7/g2p-0.2.20190919.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2977d927b277b08c4c49b610f4cfee9f", "sha256": "8711e0f1cfc963188616151cdb24562657d8d5c0f2882b907d5b4e8ec92f9905" }, "downloads": -1, "filename": "g2p-0.13.20190822-py3-none-any.whl", "has_sig": false, "md5_digest": "2977d927b277b08c4c49b610f4cfee9f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 2200064, "upload_time": "2019-08-22T22:41:51", "url": "https://files.pythonhosted.org/packages/f2/f3/c0e4e8216e003aa9f8c9c165237ea3a4eca91907208bbf9934399f602b79/g2p-0.13.20190822-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "05c115b2b2eeeffb7f48ebcb284fb35f", "sha256": "d55010ef7702d98cd281455a9a765eb02d2d91c6713fbc48196ed6959be60aa3" }, "downloads": -1, "filename": "g2p-0.13.20190822.tar.gz", "has_sig": false, "md5_digest": "05c115b2b2eeeffb7f48ebcb284fb35f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 1520020, "upload_time": "2019-08-22T22:41:55", "url": "https://files.pythonhosted.org/packages/c3/a2/3763d4686eb9bf62c5a681a61aefb32011ef9043cbf4625b96c1767d1176/g2p-0.13.20190822.tar.gz" } ] }