Python interface to ISLEX, an English IPA pronunciation dictionary with syllable and stress marking.

Related tags

Miscellaneouspysle
Overview

pysle

Questions? Comments? Feedback?


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
  2. Common Use Cases
  3. Version History
  4. Requirements
  5. Optional resources
  6. Installation
  7. Example usage
  8. Citing psyle
  9. Acknowledgements

Documentation

Automatically generated pdocs can be found here:

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

The documentation is generated with the following command: pdoc ./pysle -d google -o docs

Common Use Cases

What can you do with this library?

  • look up the list of phones and syllables for canonical pronunciations of a word

    isletool.LexicalTool('ISLEdict.txt').lookup('cat')
  • map an actual pronunciation to a dictionary pronunciation (can be used to automatically find speech errors)

    pronunciationtools.findClosestPronunciation(isleDict, 'cat', ['k', 'æ',])
  • automatically syllabify a praat textgrid containing words and phones (e.g. force-aligned text) -- requires the praatIO library

    pysle.syllabifyTextgrid(isleDict, praatioTextgrid, "words", "phones")
  • search for words based on pronunciation

    isletool.LexicalTool('ISLEdict.txt').search('dVV') # Any word containing a 'd' followed by two vowels

    e.g. Words that start with a sound, or have a sound word medially, or in stressed vowel position, etc.

    see /tests/dictionary_search.py

Version History

Pysle uses semantic versioning (Major.Minor.Patch)

Please view CHANGELOG.md for version history.

Requirements

  • Python 3.7.* or above (or below, probably)

Click here to visit travis-ci and see the specific versions of python that pysle is currently tested under

  • The praatIO library is required IF you want to use the textgrid functionality. It is not required for normal use.

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

Direct link to the ISLEX file used in this project (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

Example usage

Here is a typical usage

from pysle import isletool
isleDict = isletool.LexicalTool('C:\islev2.dict')
print(isleDict.lookup('catatonic')[0]) # Get the first pronunciation
# >> (([['k', 'ˌæ'], ['ɾ', 'ə'], ['t', 'ˈɑ'], ['n', 'ɪ', 'k']], [2, 0], [1, 1]),)

and another

from pysle import isletool
from pysle import pronunciationtools

isleDict = isletool.LexicalTool('C:\islev2.dict')

searchWord = 'another'
phoneList = ['n', '@', 'th', 'r'] # Actually produced (ASCII or IPA ok here)

returnList = pronunciationtools.findBestSyllabification(isleDict, searchWord, phoneList)
syllableList = returnList[2]
print(syllableList)
# >> [["''"], ['n', '@'], ['th', 'r']]

Please see \examples for example usage

Citing pysle

Pysle is general purpose coding and doesn't need to be cited (you should cite the ISLEX project 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).

Owner
Tim
I write tools for working with speech data.
Tim
A simple solution for water overflow problem in Python

Water Overflow problem There is a stack of water glasses in a form of triangle as illustrated. Each glass has a 250ml capacity. When a liquid is poure

Kris 2 Oct 22, 2021
Convert three types of color in your clipboard and paste it to the color property (gamma correct)

ColorPaster [Blender Addon] Convert three types of color in your clipboard and paste it to the color property (gamma correct) How to Use Hover your mo

13 Oct 31, 2022
API wrapper for VCS hosting system.

PythonVCS API wrapper for VCS hosting system. Supported platforms Gitea Github, Gitlab, Bitbucket support will not, until that packages is not updated

MisileLaboratory 1 Apr 02, 2022
A visidata plugin for parsing f5 ltm/gtm/audit logs

F5 Log Visidata Plugin This plugin supports the default log format for: /var/log/ltm* /var/log/gtm* /var/log/apm* /var/log/audit* It extracts common l

James Deucker 1 Jan 06, 2022
Thinky nature dots with python

Thinky Nature Welcome to my rice dotfiles of my ThinkPad X230 You surely will need to change some configs to fit your files and stuff and maybe tweak

Daniel Mironow 26 Dec 02, 2022
Goal: Enable awesome tooling for Bazel users of the C language family.

Hedron's Compile Commands Extractor for Bazel — User Interface What is this project trying to do for me? First, provide Bazel users cross-platform aut

Hedron Vision 290 Dec 26, 2022
Tutorials on advanced python topics, and literate programming framework to write them.

Advanced course on Python3 This course covers several topics Python decorators The python object system / meta classes Also see my text on Python impo

Michael Moser 59 Dec 19, 2022
🐍 A Python lib for (de)serializing Python objects to/from JSON

Turn Python objects into dicts or (json)strings and back No changes required to your objects Easily customizable and extendable Works with dataclasses

Ramon Hagenaars 253 Dec 14, 2022
Vaccine for STOP/DJVU ransomware, prevents encryption

STOP/DJVU Ransomware Vaccine Prevents STOP/DJVU Ransomware from encrypting your files. This tool does not prevent the infection itself. STOP ransomwar

Karsten Hahn 16 May 31, 2022
System Information Utility With Python

System-Information-Utility This is a simple utility, for the terminal, which allows you to find out information about your PC. It's very easy to run t

2 Apr 15, 2022
Addon for Blender 2.8+ that automatically creates NLA tracks for all animations. Useful for GLTF export.

PushDownAll An addon for Blender 2.8+ that runs Push Down on all animations, creating NLA tracks for each. This is useful if you have an object with m

Cory Petkovsek 16 Oct 06, 2022
PwnDatas-DB-Project(PDDP)

PwnDatas-DB-Project PwnDatas-DB-Project(PDDP) 安裝依賴: pip3 install pymediawiki 使用: cd /opt git https://github.com/JustYoomoon/PwnDatas-DB-Project.git c

21 Jul 16, 2021
banking system with python, beginner friendly, preadvanced level

banking-system-python banking system with python, beginner friendly, preadvanced level Used topics Functions else/if/elif dicts methods parameters hol

Razi Falah 1 Feb 03, 2022
A faster copy of nell's comet nuker

Astro a faster copy of nell's comet nuker also nell uses external libraries like it's cocaine man never learned to use ansi color codes (ily nell) (On

horrid 8 Aug 15, 2022
Resources for the 2021 offering of COMP 598

comp598-2021 Resources for the 2021 offering of COMP 598 General submission instructions Important Please read these instructions located in the corre

Derek Ruths 23 May 18, 2022
A dot matrix rendered using braille characters.

⣿ dotmatrix A dot matrix rendered using braille characters. Description This library provides class called Matrix which represents a dot matrix that c

Tim Fischer 25 Dec 12, 2022
Team10 backend - A service which accepts a VRM (Vehicle Registration Mark)

GreenShip - API A service which accepts a VRM (Vehicle Registration Mark) and re

3D Hack 1 Jan 21, 2022
List Less Than Ten with python

List Less Than Ten with python

PyLaboratory 0 Feb 07, 2022
Vector tile server for the Wildfire Predictive Services Unit

wps-tileserver Vector tile server for the Wildfire Predictive Services Unit Overview The intention of this project is to: provide tools to easily spin

Province of British Columbia 6 Dec 20, 2022
Python 3.9.4 Graphics and Compute Shader Framework and Primitives with no external module dependencies

pyshader Python 3.9.4 Graphics and Compute Shader Framework and Primitives with no external module dependencies Fully programmable shader model (even

Alastair Cota 1 Jan 11, 2022