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
Union oichecklists For Python

OI Checklist Union Auto-Union user's OI Checklists. Just put your checklist's ID in and it works. How to use it? Put all your OI Checklist IDs (that i

FHVirus 4 Mar 30, 2022
An Advent calendar of small programming puzzles for a variety of skill sets and skill levels.

Advent of Code 2021 The Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be sol

Evan Cope 0 Feb 13, 2022
Parametric Bottle in CADQuery

Parametric Bottle using CADQuery The proposed code makes it possible to generate different types and sizes of 3D bottles in order to train Pixel2mesh

Ayoub EL HOUDRI 1 May 22, 2022
Python Multilingual Ucrel Semantic Analysis System

PymUSAS Python Multilingual Ucrel Semantic Analysis System, it currently is a rule based token level semantic tagger which can be added to any spaCy p

UCREL 13 Nov 18, 2022
A chain of stores wants a 3-month demand forecast for its 10 different stores and 50 different products.

Demand Forecasting Objective A chain store wants a machine learning project for a 3-month demand forecast for 10 different stores and 50 different pro

2 Jan 06, 2022
🛠️ Learn a technology X by doing a project - Search engine of project-based learning

Learn X by doing Y 🛠️ Learn a technology X by doing a project Y Website You can contribute by adding projects to the CSV file.

William 408 Dec 20, 2022
Edorado93 - Unraveling a Rockstar! -- Too much? Fine, Unraveling a humble programmer then?

Hi, I'm Sachin Malhotra ( ⛄ 💻 🎃 🍺 ) Let me set the records straight. Roger Federer is the GOAT and I will not hear otherwise! Now that we have that

Sachin Malhotra 7 Dec 25, 2022
Open slidebook .sldy files in Python

Work in progress slidebook-python Open slidebook .sldy files in Python To install slidebook-python requires Python = 3.9 pip install slidebook-python

The Institute of Cancer Research 2 May 04, 2022
Allows you to purge all reply comments left by a user on a YouTube channel or video.

YouTube Spammer Purge Allows you to purge all reply comments left by a user on a YouTube channel or video. Purpose Recently, there has been a massive

4.3k Jan 09, 2023
Liquid Rocket Engine Cooling Simulation

Liquid Rocket Engine Cooling Simulation NASA CEA The implemented class calls NASA CEA via RocketCEA. INSTALL GUIDE In progress install instructions fo

John Salib 1 Jan 30, 2022
A python script for combining multiple native SU2 format meshes into one mesh file for multi-zone simulations.

A python script for combining multiple native SU2 format meshes into one mesh file for multi-zone simulations.

MKursatUzuner 1 Jan 20, 2022
A Python wrapper for Matrix Synapse admin API

Synapse-admin-api-python A Python wrapper for Matrix Synapse admin API. Versioning This library now supports up to Synapse 1.45.0, any Admin API intro

Knugi 9 Sep 28, 2022
A short course on Julia and open-source software development

Advanced Scientific Computing: producing better code This course is taught as a 6-session "nanocourse" at Washington University in St. Louis. See the

Tim Holy 230 Jan 07, 2023
A Python application that simulates the rolling of a dice, randomly picking one of the 6 faces and then displaying it.

dice-roller-app This is an application developed in Python that shuffles between the 6 faces of a dice, using buttons to shuffle and close the applica

Paddy Costelloe 0 Jul 20, 2021
ChronoRace is a tool to accurately perform timed race conditions to circumvent application business logic.

ChronoRace is a tool to accurately perform timed race conditions to circumvent application business logic. I've found in my research that w

Tanner 64 Aug 04, 2022
Cobalt Strike Sleep Python Bridge

This project is 'bridge' between the sleep and python language. It allows the control of a Cobalt Strike teamserver through python without the need for for the standard GUI client. NOTE: This project

Cobalt Strike 140 Jan 04, 2023
Iss-tracker - ISS tracking script in python using NASA's API

ISS Tracker Tracking International Space Station using NASA's API and plotting i

Partho 9 Nov 29, 2022
🪄 Auto-generate Streamlit UI from Pydantic Models and Dataclasses.

Streamlit Pydantic Auto-generate Streamlit UI elements from Pydantic models. Getting Started • Documentation • Support • Report a Bug • Contribution •

Lukas Masuch 103 Dec 25, 2022
Emulate and Dissect MSF and *other* attacks

Need help in analyzing Windows shellcode or attack coming from Metasploit Framework or Cobalt Strike (or may be also other malicious or obfuscated code)? Do you need to automate tasks with simple scr

123 Dec 16, 2022
App to decide weekly winners in H2H 1 Win (9 Cat)

Fantasy Weekly Winner for H2H 1 Win (9 Cat) Yahoo Fantasy API Read

Sai Atmakuri 1 Dec 31, 2021