fonemas


Namefonemas JSON
Version 2.1.0 PyPI version JSON
download
home_pagehttps://github.com/fsanzl/fonemas
SummaryPhonetic transcription of Spanish
upload_time2024-09-12 15:09:31
maintainerNone
docs_urlNone
authorFernando Sanz-Lázaro
requires_python>=3.6
licenseLGPL
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![License: LGPL](https://img.shields.io/github/license/fsanzl/fonemas)](https://opensource.org/licenses/LGPL-2.1)
[![Version: 2.1.00](https://img.shields.io/github/v/release/fsanzl/fonemas)](https://pypi.org/project/fonemas/)
[![Python versions: 3.5, 3.6, 3.7, 3.8, 3.9](https://img.shields.io/pypi/pyversions/fonemas)](https://www.python.org/downloads/release/python-390/)


<h2 align="center">Fonemas</h2>
<h3 align="center">A Python phonologic transcription library for Spanish</h2>


*fonemas* is a Python library of methods and functions for phonologic and phonetic transcription of Spanish words.

This library is part of the research project [Sound and Meaning in Spanish Golden Age Literature](https://soundandmeaning.univie.ac.at/). 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

```bash
pip3 install fonemas
```

## Use

The library provides the class  *transcription(sentence, mono, epenthesis, aspiration, rehash, 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.

- *rehash* moves last consonan on last-syllable coda to next's words first-syllable onset if it begins with a vowel.

- *sampastr* allows an alternativestress symbol, as '"' to prevent issues e.g. when using in a CSV file.



The class *transcription()* has three dataclass attributes, each with two attributes *{words, 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.


```python
>>> from fonemas import Transcription
>>> object = Transcription('Averigüéis')
>>> a.phonology.words
['abeɾiˈgwejs']
>>> a.phonology.syllables
['a', 'be', 'ɾi', 'ˈgwejs']
>>> a.phonetics.words
['aβeɾiˈɣwejs']
>>> a.phonetics.syllables
['a', 'be', 'ɾi', 'ˈɣwejs']
>>> a.sampa.words
['aBeri"Gwejs']
>>> a.sampa.syllables
['a', 'Be', 'ri', '"Gwejs']
```

## Description

The transcription is done according to the Spanish phonology and phonotactics described by Quilis (2019).

## Known issues

The phonetic transcription lacks allophones represented in IPA with diacritics. They require double characters, which need a workaround to be evaluated. It can be solved using hacks for 'special cases', which I will do until figure out a general solution.

Non-Spanish languages with different prosodic rules but same spelling will cause problems, e.g.(lat.  'amor', 'amabor', 'amabar', 'amer' vs sp. 'amor'. 'labor', 'acabar', 'temer').

## Contributions

Feel free to contribute using the [GitHub Issue Tracker](https://github.com/fsanzl/fonemas/issues) for feedback, suggestions, or bug reports.


## How to cite *fonemas*

Authors of scientific papers including results generated using *fonemas* are encouraged to cite the following paper.

```bibtex
@article{SanzLazaroF_RHD2023, 
    author    = {Sanz-Lázaro, Fernando},
    title     = {Del fonema al verso: una caja de herramientas digitales de escansión teatral},
    volume    = {8},
    journal   = {Revista de Humanidades Digitales},
    doi       = {https://doi.org/10.5944/rhd.vol.8.2023.37830},
    pages     = {74--89},
    langid    = {Spanish},
}                                                                                                                                                              
```

## Changelog
* 2.1.0
    * ChatGpt optimisation adn documentation
      
* 2.0.20.1
    * Simplified coarticullations with regex

* 2.0.20
    * Solved some issues with nasal coarticulation

* 2.0.19
    * Solved stops/affricates alternance after space, hyphen, stress mark, beginning of line.

* 2.0.18

    * Solved diphthongs contradicting the perceptibility scale.

* 2.0.17

    * hie -> ʝe

* 2.0.16

    * Isolated consonants

## Copyright

Copyright (C) 2022  Fernando Sanz-Lázaro <<fsanzl@gmail.com>>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see <<https://www.gnu.org/licenses/>>.
    
## References

Quilis, Antonio, *Tratado de fonología y fonética españolas*. Madrid, Gredos, 2019.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fsanzl/fonemas",
    "name": "fonemas",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Fernando Sanz-L\u00e1zaro",
    "author_email": "fsanzl@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/53/db/50fd387b5c00ee136569e68567ee8c607d70115445a9b8a511582351828c/fonemas-2.1.0.tar.gz",
    "platform": null,
    "description": "[![License: LGPL](https://img.shields.io/github/license/fsanzl/fonemas)](https://opensource.org/licenses/LGPL-2.1)\n[![Version: 2.1.00](https://img.shields.io/github/v/release/fsanzl/fonemas)](https://pypi.org/project/fonemas/)\n[![Python versions: 3.5, 3.6, 3.7, 3.8, 3.9](https://img.shields.io/pypi/pyversions/fonemas)](https://www.python.org/downloads/release/python-390/)\n\n\n<h2 align=\"center\">Fonemas</h2>\n<h3 align=\"center\">A Python phonologic transcription library for Spanish</h2>\n\n\n*fonemas* is a Python library of methods and functions for phonologic and phonetic transcription of Spanish words.\n\nThis library is part of the research project [Sound and Meaning in Spanish Golden Age Literature](https://soundandmeaning.univie.ac.at/). 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.\n\n## Installation\n\n```bash\npip3 install fonemas\n```\n\n## Use\n\nThe library provides the class  *transcription(sentence, mono, epenthesis, aspiration, rehash, 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.\n\n- *mono* sets whether the output shows graphic stresses for monosyllabic words\n\n- *epenthesis* set the behaviour S bfore consonant in onset (spiritu -> es pi ri tu|spi ri tu)\n\n- *aspiration* inserts an aspiration modifier '\u02b0' in onset. This may be useful when dealing with ambiguous verses in classic poetry to choose which synaloepha to break.\n\n- *rehash* moves last consonan on last-syllable coda to next's words first-syllable onset if it begins with a vowel.\n\n- *sampastr* allows an alternativestress symbol, as '\"' to prevent issues e.g. when using in a CSV file.\n\n\n\nThe class *transcription()* has three dataclass attributes, each with two attributes *{words, syllables}* containing each a list of strings, which may be words or syllables, respectively.\n\n- *phonology* for the phonological transcription (requires UNICODE support).\n\n- *phonetics* for the phonetic transcription in IPA symbols (requires UNICODE support).\n\n- *sampa* for the phonetic transcription SAMPA transliteration.\n\n\n```python\n>>> from fonemas import Transcription\n>>> object = Transcription('Averig\u00fc\u00e9is')\n>>> a.phonology.words\n['abe\u027ei\u02c8gwejs']\n>>> a.phonology.syllables\n['a', 'be', '\u027ei', '\u02c8gwejs']\n>>> a.phonetics.words\n['a\u03b2e\u027ei\u02c8\u0263wejs']\n>>> a.phonetics.syllables\n['a', 'be', '\u027ei', '\u02c8\u0263wejs']\n>>> a.sampa.words\n['aBeri\"Gwejs']\n>>> a.sampa.syllables\n['a', 'Be', 'ri', '\"Gwejs']\n```\n\n## Description\n\nThe transcription is done according to the Spanish phonology and phonotactics described by Quilis (2019).\n\n## Known issues\n\nThe phonetic transcription lacks allophones represented in IPA with diacritics. They require double characters, which need a workaround to be evaluated. It can be solved using hacks for 'special cases', which I will do until figure out a general solution.\n\nNon-Spanish languages with different prosodic rules but same spelling will cause problems, e.g.(lat.  'amor', 'amabor', 'amabar', 'amer' vs sp. 'amor'. 'labor', 'acabar', 'temer').\n\n## Contributions\n\nFeel free to contribute using the [GitHub Issue Tracker](https://github.com/fsanzl/fonemas/issues) for feedback, suggestions, or bug reports.\n\n\n## How to cite *fonemas*\n\nAuthors of scientific papers including results generated using *fonemas* are encouraged to cite the following paper.\n\n```bibtex\n@article{SanzLazaroF_RHD2023, \n    author    = {Sanz-L\u00e1zaro, Fernando},\n    title     = {Del fonema al verso: una caja de herramientas digitales de escansi\u00f3n teatral},\n    volume    = {8},\n    journal   = {Revista de Humanidades Digitales},\n    doi       = {https://doi.org/10.5944/rhd.vol.8.2023.37830},\n    pages     = {74--89},\n    langid    = {Spanish},\n}                                                                                                                                                              \n```\n\n## Changelog\n* 2.1.0\n    * ChatGpt optimisation adn documentation\n      \n* 2.0.20.1\n    * Simplified coarticullations with regex\n\n* 2.0.20\n    * Solved some issues with nasal coarticulation\n\n* 2.0.19\n    * Solved stops/affricates alternance after space, hyphen, stress mark, beginning of line.\n\n* 2.0.18\n\n    * Solved diphthongs contradicting the perceptibility scale.\n\n* 2.0.17\n\n    * hie -> \u029de\n\n* 2.0.16\n\n    * Isolated consonants\n\n## Copyright\n\nCopyright (C) 2022  Fernando Sanz-L\u00e1zaro <<fsanzl@gmail.com>>\n\nThis library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License along with this library. If not, see <<https://www.gnu.org/licenses/>>.\n    \n## References\n\nQuilis, Antonio, *Tratado de fonolog\u00eda y fon\u00e9tica espa\u00f1olas*. Madrid, Gredos, 2019.\n",
    "bugtrack_url": null,
    "license": "LGPL",
    "summary": "Phonetic transcription of Spanish",
    "version": "2.1.0",
    "project_urls": {
        "Homepage": "https://github.com/fsanzl/fonemas",
        "Source": "https://github.com/fsanzl/fonemas/",
        "Tracker": "https://github.com/fsanzl/fonemas/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d8d5f61585d0000e416fe070542ce534ca5ce7003f8c3719ef0d55fd37c090d5",
                "md5": "4725da72699464137e8055d9a0197272",
                "sha256": "15897a490a736159731d273d14c59fc15159244d125c6d7b26afcd4369734321"
            },
            "downloads": -1,
            "filename": "fonemas-2.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4725da72699464137e8055d9a0197272",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 16662,
            "upload_time": "2024-09-12T15:09:29",
            "upload_time_iso_8601": "2024-09-12T15:09:29.366872Z",
            "url": "https://files.pythonhosted.org/packages/d8/d5/f61585d0000e416fe070542ce534ca5ce7003f8c3719ef0d55fd37c090d5/fonemas-2.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53db50fd387b5c00ee136569e68567ee8c607d70115445a9b8a511582351828c",
                "md5": "f50df0d74d070352daf6599531a9665e",
                "sha256": "45614b4389b2215f91cf3bc6070b024a2750ae3f9a1438ce8f3efcf8fb410665"
            },
            "downloads": -1,
            "filename": "fonemas-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f50df0d74d070352daf6599531a9665e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 16493,
            "upload_time": "2024-09-12T15:09:31",
            "upload_time_iso_8601": "2024-09-12T15:09:31.211515Z",
            "url": "https://files.pythonhosted.org/packages/53/db/50fd387b5c00ee136569e68567ee8c607d70115445a9b8a511582351828c/fonemas-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-12 15:09:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fsanzl",
    "github_project": "fonemas",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fonemas"
}
        
Elapsed time: 0.56430s