An interface to ISLEX, an IPA pronunciation dictionary for English with stress and syllable markings.
Project description
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
- Documentation
- Tutorials
- Version History
- Requirements
- ISLE Dictionary
- Installation
- Upgrading
- Usage
- Common Use Cases
- Citing psyle
- 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
Tutorial 2: Pronunciationtools
Version History
Pysle uses semantic versioning (Major.Minor.Patch)
Please view 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.
Python 3.7.*
or above
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.
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
Upgrading
Please view UPGRADING.md for detailed information about how to upgrade from earlier versions.
Usage
Here is a typical usage
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
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
isletool.LexicalTool('ISLEdict.txt').lookup('cat')
-
map an actual pronunciation to a dictionary pronunciation (can be used to automatically find speech errors)
pronunciationtools.findClosestEntryForPhones(isleDict, 'cat', ['k', 'æ',])
-
automatically syllabify a praat textgrid (see praatIO) containing words and phones (e.g. force-aligned text)
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 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).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pysle-4.0.2.tar.gz
.
File metadata
- Download URL: pysle-4.0.2.tar.gz
- Upload date:
- Size: 2.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4800b4a8dfcff1eaace8eaa224062655273125d6c7eecebcf7aa9d632b94e621 |
|
MD5 | e51493f7660879d848b14bd795fc0fa8 |
|
BLAKE2b-256 | 4185081b974ab52d631f88ef8016edd4076659d6f94ecd91e495ea4c9d03d308 |
File details
Details for the file pysle-4.0.2-py3-none-any.whl
.
File metadata
- Download URL: pysle-4.0.2-py3-none-any.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 224b7d2d955c70a58aba7c153c513bbdf2f3a47212030d6edcbbcb229c041018 |
|
MD5 | 6d8aa405dac7806926e1f518806423b0 |
|
BLAKE2b-256 | ee3e9b822f45af5206726627ce09f7eb108c3c5d307be5cfe6891dc6243cc752 |