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
Poetry plugin to bundle projects into various formats

Poetry bundle plugin This package is a plugin that allows the bundling of Poetry projects into various formats. Installation The easiest way to instal

Poetry 54 Jan 02, 2023
A collection of online resources to help you on your Tech journey.

Everything Tech Resources & Projects About The Project Coming from an engineering background and looking to up skill yourself on a new field can be di

Mohamed A 396 Dec 31, 2022
💘 Write any Python with 9 Characters: e,x,c,h,r,(,+,1,)

💘 PyFuck exchr(+1) PyFuck is a strange playful code. It uses only nine different characters to write Python3 code. Inspired by aemkei/jsfuck Example

Satoki 10 Dec 25, 2022
Automation of VASP DFT workflows with ASE - application scripts

This repo contains a library that aims at automatizing some Density Functional Theory (DFT) workflows in VASP by using the ASE toolkit.

Frank Niessen 5 Sep 06, 2022
A log likelihood fit for extracting neutrino oscillation parameters

A-log-likelihood-fit-for-extracting-neutrino-oscillation-parameters Minimised the negative log-likelihood fit to extract neutrino oscillation paramete

Vid Homsak 1 Jan 23, 2022
Fly DCS without a joystick

Intro Usage Delete all mouse view axis Install DCSEasyControlExports to your "Saved Games/DCS/" Path python DCSEasyControl/main.py Set DCS to F12 view

XuHao 36 Dec 27, 2022
A refresher for PowerBI Desktop documents

PowerBI_Refresher-NPP Informació Per executar el programa s'ha de tenir instalat el python versio 3 o mes. Requeriments a requirements.txt. El fitxer

Nil Pujol 1 May 02, 2022
AIST++ API This repo contains starter code for using the AIST++ dataset.

Explainability for Vision Transformers (in PyTorch) This repository implements methods for explainability in Vision Transformers

Google 260 Dec 30, 2022
Runtime profiler for Streamlit, powered by pyinstrument

streamlit-profiler 🏄🏼 Runtime profiler for Streamlit, powered by pyinstrument. streamlit-profiler is a Streamlit component that helps you find out w

Johannes Rieke 23 Nov 30, 2022
A beacon generator using Cobalt Strike and a variety of tools.

Beaconator is an aggressor script for Cobalt Strike used to generate either staged or stageless shellcode and packing the generated shellcode using your tool of choice.

Capt. Meelo 441 Dec 17, 2022
Course materials for a 3-day seminar "Machine Learning and NLP: Advances and Applications" at New College of Florida

Machine Learning and NLP: Advances and Applications This repository hosts the course materials used for a 3-day seminar "Machine Learning and NLP: Adv

Yoshi Suhara 11 Jun 22, 2022
Using Python to parse through email logs received through several backup systems.

outlook-automated-backup-control Backup monitoring on a mailbox: In this mailbox there will be backup logs. The identification will based on the follo

Connor 2 Sep 28, 2022
script buat mengcrack

setan script buat mengcrack cara install $ pkg install upgrade && pkg update $ pkg install python $ pkg install git $ pip install requests $ pip insta

1 Nov 03, 2021
Listen Surah, prepare for next and Endless life...

Al-Quran In this repository, I have linked up all Surah with Arabic-Bangla Audio From Youtube. So, you just need to choose and listen. and the ( surah

SpiderX 1 Sep 30, 2022
Tool for working with Direct System Calls in Cobalt Strike's Beacon Object Files (BOF) via Syswhispers2

Tool for working with Direct System Calls in Cobalt Strike's Beacon Object Files (BOF) via Syswhispers2

150 Dec 31, 2022
Learning objective: Use React.js, Axios, and CSS to build a responsive YouTube clone app

Learning objective: Use React.js, Axios, and CSS to build a responsive YouTube clone app to search for YouTube videos, channels, playlists, and live events via wrapper around Google YouTube API.

Dillon 0 May 03, 2022
An end-to-end encrypted chat

An end-to-end encrypted chat, that allows users to anonymously talk without ip logs, personal info, or need for registration.

Privalise 1 Nov 27, 2021
SQL centered, docker process running game

REQUIREMENTS Linux Docker Python/bash set up image "docker build -t game ." create db container "run my_whatever/game_docker/pdb create" # creating po

1 Jan 11, 2022
Rock 💎 Paper 📝 Scissors ✂️ Lizard 🦎 Spock 🖖

Rock 💎 Paper 📝 Scissors ✂️ Lizard 🦎 Spock 🖖 If you’ve seen The Big Bang Theory, you’ve heard of a game called “Rock, Paper, Scissors, Lizard, Spoc

AmirHossein Mohammadi 16 Jun 19, 2022
Blender addon - Breakdown in object mode

Breakdowner Breakdown in object mode Download latest Demo Youtube Description Same breakdown shortcut as in armature mode in object mode Currently onl

Samuel Bernou 4 Mar 30, 2022