Phonetic transcription of Spanish
Project description
Fonemas
A Python phonologic transcription library for Spanish
fonemas is a Python library of methods and functions for phonologic and phonetic ranscription of Spanish words.
This library is part of the research project Sound and Meaning in Spanish Golden Age Literature. This library was originally intended to analyse only pohonological features relevant to verse scansion. It has expanded its functionality ever since to become a fully featured phonological and phonetic analyser with IPA and SAMPA support.
Installation
pip3 install fonemas
Use
The library provides the class transcription(sentence, mono, epenthesis, aspiration, sampastr). The class takes the obligatoy argument sentence, which is a string of characters with a Spanish word or words. It optionally takes two Boolean arguments mono, epenthesis and aspiration set to False as default.
-
mono sets whether the output shows graphic stresses for monosyllabic words
-
epenthesis set the behaviour S bfore consonant in onset (spiritu -> es pi ri tu|spi ri tu)
-
aspiration inserts an aspiration modifier 'ʰ' in onset. This may be useful when dealing with ambiguous verses in classic poetry to choose which synaloepha to break.
-
sampastr allows an alternativestress symbol, as '"' to prevent issues e.g. when using in a CSV file.
The class transcription() has three dictionary attributes, each with two keys {sentence, syllables} containing each a list of strings, which may be words or syllables, respectively.
-
phonology for the phonological transcription (requires UNICODE support).
-
phonetics for the phonetic transcription in IPA symbols (requires UNICODE support).
-
sampa for the phonetic transcription SAMPA transliteration.
>>> from fonemas import transcription
>>> object = transcription('Averigüéis')
>>> object.phonology
{'words': ["abeɾig'wejs"], 'syllables': ['a', 'be', 'ɾi', "'gwejs"]}
>>> object.phonetics
{'words': ["aβe'ɾiɣwejs"], 'syllables': ['a', 'βe', "'ɾi", 'ɣwejs']}
>>> object.sampa
{'words': "aBeri'Gwejs", 'syllables': "a Be ri 'Gwejs"}
Description
The transcription is done according to the Spanish phonology and phonotactics described by Quilis (2019).
Contributions
Feel free to contribute using the GitHub Issue Tracker for feedback, suggestions, or bug reports.
Licence
This project is under GNU LGPL 2.1. See LICENCE for details.
References
Quilis, Antonio, Tratado de fonología y fonética españolas. Madrid, Gredos, 2019.
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
Hashes for fonemas-2.0.3.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36e8b089daa34f354ab8c186590a600e5c57ee4a8758dd22d0ecf9e6e6f6b5ba |
|
MD5 | 43716ba4663011eaf30f4068e5a4068a |
|
BLAKE2b-256 | e71c2cb4791755eac8f03bed3953f22e587527991a70d3cb38bc308c6082d83d |