pysle


Namepysle JSON
Version 4.0.2 PyPI version JSON
download
home_pagehttps://github.com/timmahrt/pysle
SummaryAn interface to ISLEX, an IPA pronunciation dictionary for English with stress and syllable markings.
upload_time2023-12-23 06:12:09
maintainer
docs_urlNone
authorTim Mahrt
requires_python>3.6.0
licenseLICENSE
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            
# pysle

[![](https://app.travis-ci.com/timmahrt/pysle.svg?branch=main)](https://app.travis-ci.com/github/timmahrt/pysle) [![](https://coveralls.io/repos/github/timmahrt/pysle/badge.svg?)](https://coveralls.io/github/timmahrt/pysle?branch=main) [![](https://img.shields.io/badge/license-MIT-blue.svg?)](http://opensource.org/licenses/MIT) [![](https://img.shields.io/pypi/v/pysle.svg)](https://pypi.org/project/pysle/)

*Questions?  Comments?  Feedback? [![](https://badges.gitter.im/pysle/Lobby.svg)](https://gitter.im/pysle/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)*

-----

Pronounced like 'p' + 'isle'.

An interface to a pronunciation dictionary with stress markings
(ISLEX - the international speech lexicon),
along with some tools for working with comparing and aligning
pronunciations (e.g. a list of phones someone said versus a standard or
canonical dictionary pronunciation).


# Table of contents
1. [Documentation](#documentation)
2. [Tutorials](#tutorials)
3. [Version History](#version-history)
4. [Requirements](#requirements)
5. [ISLE Dictionary](#isle-dictionary)
6. [Installation](#installation)
7. [Upgrading](#upgrading)
8. [Usage](#usage)
9. [Common Use Cases](#common-use-cases)
10. [Citing psyle](#citing-pysle)
11. [Acknowledgements](#acknowledgements)


## Documentation

Automatically generated pdocs can be found here:

http://timmahrt.github.io/pysle/

## Tutorials

There are tutorials available for learning how to use Pysle.  These
are in the form of IPython Notebooks which can be found in the /tutorials/
folder distributed with Pysle.

You can view them online using the external website Jupyter:

[Tutorial 1: Introduction to Pysle](<https://nbviewer.jupyter.org/github/timmahrt/pysle/blob/main/tutorials/tutorial1_intro_to_pysle.ipynb>)

[Tutorial 2: Pronunciationtools](<https://nbviewer.jupyter.org/github/timmahrt/pysle/blob/main/tutorials/tutorial2_pronunciationtools.ipynb>)

## Version History

*Pysle uses semantic versioning (Major.Minor.Patch)*

Please view [CHANGELOG.md](https://github.com/timmahrt/pysle/blob/main/CHANGELOG.md) for version history.


## Requirements

The following python modules are required.  They should be installed automatically but you can 
install them manually if you have any problems.
- [typing-extensions](`https://pypi.org/project/typing-extensions/`)
- [praatIO](<https://github.com/timmahrt/praatIO>) 

``Python 3.7.*`` or above

[Click here to visit travis-ci and see the specific versions of python that pysle is currently tested under](<https://app.travis-ci.com/github/timmahrt/pysle>)

If you are using ``Python 2.x`` or ``Python < 3.7``, you can use `Pysle 3.x`.

## ISLE Dictionary

pysle requires the ISLEdict pronunciation dictionary
(copyright Mark Hasegawa-Johnson, licensed under the MIT open source license).
This is bundled with psyle.  However, you may want to use a subset of the pronunciations
or you may want to add your own pronunciations.

In that case, please get the original file.

  [ISLEX github page](<https://github.com/uiuc-sst/g2ps>)

  [Direct link to the ISLEX file used in this project](<https://raw.githubusercontent.com/uiuc-sst/g2ps/master/English/ISLEdict.txt>) (ISLEdict.txt)

See `examples/isletool_examples.py` for an example of how to load a custom ISLEdict file.


## Installation

Pysle is on pypi and can be installed or upgraded from the command-line shell with pip like so

    python -m pip install pysle --upgrade

Otherwise, to manually install, after downloading the source from github, from a command-line shell, navigate to the directory containing setup.py and type

    python setup.py install

If python is not in your path, you'll need to enter the full path e.g.

    C:\Python36\python.exe setup.py install

## Upgrading

Please view [UPGRADING.md](https://github.com/timmahrt/pysle/blob/main/UPGRADING.md) for detailed information about how to upgrade from earlier versions.

## Usage

Here is a typical usage

```python
from pysle import isletool
isle = isletool.Isle()
print(isle.lookup('catatonic')[0].toList()) # Get the first entry's pronunciation
# >> [[['k', 'ˌæ'], ['ɾ', 'ə'], ['t', 'ˈɑ'], ['n', 'ɪ', 'k']]]
```

and another

```python
from pysle import isletool
from pysle import pronunciationtools

isle = isletool.Isle()

searchWord = 'another'
phoneList = ['n', 'ʌ', 'ð', 'ɚ']

returnList = pronunciationtools.findBestSyllabification(isle, searchWord, phoneList)
syllableList = returnList[2]
print(syllableList)
# >> [["''"], ['n', 'ʌ'], ['ð', 'ɚ']]
```

Please see \\examples for example usage


## Common Use Cases


What can you do with this library?

- look up the list of phones and syllables for canonical pronunciations
  of a word
    ```python
    isletool.LexicalTool('ISLEdict.txt').lookup('cat')
    ```

- map an actual pronunciation to a dictionary pronunciation (can be used
  to automatically find speech errors)
    ```python
    pronunciationtools.findClosestEntryForPhones(isleDict, 'cat', ['k', 'æ',])
    ```

- automatically syllabify a praat textgrid (see [praatIO](<https://github.com/timmahrt/praatIO>))
   containing words and phones (e.g. force-aligned text)
    ```python
    pysle.syllabifyTextgrid(isleDict, praatioTextgrid, "words", "phones")
    ```

## Citing pysle


Pysle is general purpose coding and doesn't need to be cited
(you should cite the
[ISLEX project](<http://www.isle.illinois.edu/speech_web_lg/data/g2ps/>)
instead) but if you would like to, it can be cited like so:

Tim Mahrt. Pysle. https://github.com/timmahrt/pysle, 2016.


## Acknowledgements


Development of Pysle was possible thanks to NSF grant **IIS 07-03624**
to Jennifer Cole and Mark Hasegawa-Johnson, NSF grant **BCS 12-51343**
to Jennifer Cole, José Hualde, and Caroline Smith, and
to the A*MIDEX project (n° **ANR-11-IDEX-0001-02**) to James Sneed German
funded by the Investissements d'Avenir French Government program, managed
by the French National Research Agency (ANR).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/timmahrt/pysle",
    "name": "pysle",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">3.6.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Tim Mahrt",
    "author_email": "timmahrt@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/41/85/081b974ab52d631f88ef8016edd4076659d6f94ecd91e495ea4c9d03d308/pysle-4.0.2.tar.gz",
    "platform": null,
    "description": "\n# pysle\n\n[![](https://app.travis-ci.com/timmahrt/pysle.svg?branch=main)](https://app.travis-ci.com/github/timmahrt/pysle) [![](https://coveralls.io/repos/github/timmahrt/pysle/badge.svg?)](https://coveralls.io/github/timmahrt/pysle?branch=main) [![](https://img.shields.io/badge/license-MIT-blue.svg?)](http://opensource.org/licenses/MIT) [![](https://img.shields.io/pypi/v/pysle.svg)](https://pypi.org/project/pysle/)\n\n*Questions?  Comments?  Feedback? [![](https://badges.gitter.im/pysle/Lobby.svg)](https://gitter.im/pysle/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)*\n\n-----\n\nPronounced like 'p' + 'isle'.\n\nAn interface to a pronunciation dictionary with stress markings\n(ISLEX - the international speech lexicon),\nalong with some tools for working with comparing and aligning\npronunciations (e.g. a list of phones someone said versus a standard or\ncanonical dictionary pronunciation).\n\n\n# Table of contents\n1. [Documentation](#documentation)\n2. [Tutorials](#tutorials)\n3. [Version History](#version-history)\n4. [Requirements](#requirements)\n5. [ISLE Dictionary](#isle-dictionary)\n6. [Installation](#installation)\n7. [Upgrading](#upgrading)\n8. [Usage](#usage)\n9. [Common Use Cases](#common-use-cases)\n10. [Citing psyle](#citing-pysle)\n11. [Acknowledgements](#acknowledgements)\n\n\n## Documentation\n\nAutomatically generated pdocs can be found here:\n\nhttp://timmahrt.github.io/pysle/\n\n## Tutorials\n\nThere are tutorials available for learning how to use Pysle.  These\nare in the form of IPython Notebooks which can be found in the /tutorials/\nfolder distributed with Pysle.\n\nYou can view them online using the external website Jupyter:\n\n[Tutorial 1: Introduction to Pysle](<https://nbviewer.jupyter.org/github/timmahrt/pysle/blob/main/tutorials/tutorial1_intro_to_pysle.ipynb>)\n\n[Tutorial 2: Pronunciationtools](<https://nbviewer.jupyter.org/github/timmahrt/pysle/blob/main/tutorials/tutorial2_pronunciationtools.ipynb>)\n\n## Version History\n\n*Pysle uses semantic versioning (Major.Minor.Patch)*\n\nPlease view [CHANGELOG.md](https://github.com/timmahrt/pysle/blob/main/CHANGELOG.md) for version history.\n\n\n## Requirements\n\nThe following python modules are required.  They should be installed automatically but you can \ninstall them manually if you have any problems.\n- [typing-extensions](`https://pypi.org/project/typing-extensions/`)\n- [praatIO](<https://github.com/timmahrt/praatIO>) \n\n``Python 3.7.*`` or above\n\n[Click here to visit travis-ci and see the specific versions of python that pysle is currently tested under](<https://app.travis-ci.com/github/timmahrt/pysle>)\n\nIf you are using ``Python 2.x`` or ``Python < 3.7``, you can use `Pysle 3.x`.\n\n## ISLE Dictionary\n\npysle requires the ISLEdict pronunciation dictionary\n(copyright Mark Hasegawa-Johnson, licensed under the MIT open source license).\nThis is bundled with psyle.  However, you may want to use a subset of the pronunciations\nor you may want to add your own pronunciations.\n\nIn that case, please get the original file.\n\n  [ISLEX github page](<https://github.com/uiuc-sst/g2ps>)\n\n  [Direct link to the ISLEX file used in this project](<https://raw.githubusercontent.com/uiuc-sst/g2ps/master/English/ISLEdict.txt>) (ISLEdict.txt)\n\nSee `examples/isletool_examples.py` for an example of how to load a custom ISLEdict file.\n\n\n## Installation\n\nPysle is on pypi and can be installed or upgraded from the command-line shell with pip like so\n\n    python -m pip install pysle --upgrade\n\nOtherwise, to manually install, after downloading the source from github, from a command-line shell, navigate to the directory containing setup.py and type\n\n    python setup.py install\n\nIf python is not in your path, you'll need to enter the full path e.g.\n\n    C:\\Python36\\python.exe setup.py install\n\n## Upgrading\n\nPlease view [UPGRADING.md](https://github.com/timmahrt/pysle/blob/main/UPGRADING.md) for detailed information about how to upgrade from earlier versions.\n\n## Usage\n\nHere is a typical usage\n\n```python\nfrom pysle import isletool\nisle = isletool.Isle()\nprint(isle.lookup('catatonic')[0].toList()) # Get the first entry's pronunciation\n# >> [[['k', '\u02cc\u00e6'], ['\u027e', '\u0259'], ['t', '\u02c8\u0251'], ['n', '\u026a', 'k']]]\n```\n\nand another\n\n```python\nfrom pysle import isletool\nfrom pysle import pronunciationtools\n\nisle = isletool.Isle()\n\nsearchWord = 'another'\nphoneList = ['n', '\u028c', '\u00f0', '\u025a']\n\nreturnList = pronunciationtools.findBestSyllabification(isle, searchWord, phoneList)\nsyllableList = returnList[2]\nprint(syllableList)\n# >> [[\"''\"], ['n', '\u028c'], ['\u00f0', '\u025a']]\n```\n\nPlease see \\\\examples for example usage\n\n\n## Common Use Cases\n\n\nWhat can you do with this library?\n\n- look up the list of phones and syllables for canonical pronunciations\n  of a word\n    ```python\n    isletool.LexicalTool('ISLEdict.txt').lookup('cat')\n    ```\n\n- map an actual pronunciation to a dictionary pronunciation (can be used\n  to automatically find speech errors)\n    ```python\n    pronunciationtools.findClosestEntryForPhones(isleDict, 'cat', ['k', '\u00e6',])\n    ```\n\n- automatically syllabify a praat textgrid (see [praatIO](<https://github.com/timmahrt/praatIO>))\n   containing words and phones (e.g. force-aligned text)\n    ```python\n    pysle.syllabifyTextgrid(isleDict, praatioTextgrid, \"words\", \"phones\")\n    ```\n\n## Citing pysle\n\n\nPysle is general purpose coding and doesn't need to be cited\n(you should cite the\n[ISLEX project](<http://www.isle.illinois.edu/speech_web_lg/data/g2ps/>)\ninstead) but if you would like to, it can be cited like so:\n\nTim Mahrt. Pysle. https://github.com/timmahrt/pysle, 2016.\n\n\n## Acknowledgements\n\n\nDevelopment of Pysle was possible thanks to NSF grant **IIS 07-03624**\nto Jennifer Cole and Mark Hasegawa-Johnson, NSF grant **BCS 12-51343**\nto Jennifer Cole, Jos\u00e9 Hualde, and Caroline Smith, and\nto the A*MIDEX project (n\u00b0 **ANR-11-IDEX-0001-02**) to James Sneed German\nfunded by the Investissements d'Avenir French Government program, managed\nby the French National Research Agency (ANR).\n",
    "bugtrack_url": null,
    "license": "LICENSE",
    "summary": "An interface to ISLEX, an IPA pronunciation dictionary for English with stress and syllable markings.",
    "version": "4.0.2",
    "project_urls": {
        "Homepage": "https://github.com/timmahrt/pysle"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ee3e9b822f45af5206726627ce09f7eb108c3c5d307be5cfe6891dc6243cc752",
                "md5": "6d8aa405dac7806926e1f518806423b0",
                "sha256": "224b7d2d955c70a58aba7c153c513bbdf2f3a47212030d6edcbbcb229c041018"
            },
            "downloads": -1,
            "filename": "pysle-4.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6d8aa405dac7806926e1f518806423b0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">3.6.0",
            "size": 2860407,
            "upload_time": "2023-12-23T06:12:06",
            "upload_time_iso_8601": "2023-12-23T06:12:06.082917Z",
            "url": "https://files.pythonhosted.org/packages/ee/3e/9b822f45af5206726627ce09f7eb108c3c5d307be5cfe6891dc6243cc752/pysle-4.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4185081b974ab52d631f88ef8016edd4076659d6f94ecd91e495ea4c9d03d308",
                "md5": "e51493f7660879d848b14bd795fc0fa8",
                "sha256": "4800b4a8dfcff1eaace8eaa224062655273125d6c7eecebcf7aa9d632b94e621"
            },
            "downloads": -1,
            "filename": "pysle-4.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e51493f7660879d848b14bd795fc0fa8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">3.6.0",
            "size": 2809536,
            "upload_time": "2023-12-23T06:12:09",
            "upload_time_iso_8601": "2023-12-23T06:12:09.150001Z",
            "url": "https://files.pythonhosted.org/packages/41/85/081b974ab52d631f88ef8016edd4076659d6f94ecd91e495ea4c9d03d308/pysle-4.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-23 06:12:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "timmahrt",
    "github_project": "pysle",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "pysle"
}
        
Elapsed time: 0.82360s