2 of 3 files were uploaded without provenance metadata. View details.
LibEscansión
libEscansión
A Python library for for metrical scansion of mixed Spanish verses
libEscansión is a state-of-the-art Python library for analysing Spanish mixed verses. It parses the verse to find syllabic nuclei, rhythmic pattern, assonance, and consonance, as well as to provide a phonological transcription of the syllables. It scores 98.64% accuracy against the manually annotated corpus [ADSO 100] with the option adso=True, which forces considering interjections as non-stressed to meet ADSO's annotation criteria. This tops the until-now state-of-the-art. Nevertheless, vanilla scansion – i.e., stressing interjections – still outperforms the state-of-the art, achieving 97.01% accuracy. Furthermore, after evaluating the corpus' manual scansion and spelling, we found that the disagreement was in most cases due to an improper spelling or even to non-standard human analysis (unstressed interjections, adverbd in -mente lacking secondary stress, etc.). With a corrected corpus, the agreement reaches 99.13 %, being the resting 0.87% non-erroneus disagreements.
This library is part of the research project Sound and Meaning in Spanish Golden Age Literature. It was created as a means to generate a corpus of parsed metres, which is publicicily accessible here
Installation
pip install libEscansion
Requeriments
Following libraries are required:
- stanza >= 1.7 with Spanish language models
- fonemas >= 2.0.18
- silabeador >= 1.1.11.post6
Usage example
The library provides the class VerseMetre. It accepts an obligatory string for the verse and an optional list of integers with possibles syllable-counts. If a second argment is not provided, it performs a regular scansion, i.e., with all natural dialoephas.
>>> import libEscansion
>>> verse = verse = libscansion.VerseMetre('Cerrar podrá mis ojos la postrera ', [11,8,7])
>>> verse.count
11
>>> verse.syllables
['θe', 'rAɾ', 'po', 'dɾA', 'mis', 'O', 'xos', 'la', 'pos', 'tɾE', 'ɾa']
>>> verse.nuclei
'eAoAiOoaoEa'
>>> verse.rhyme
'eɾa'
>>> verse.asson
'ea'
>>> verse.rhythm
'-+-+-+---+-'
The directory 'utils' contains a file that can be used to test the library against ADSO 100 (or any other corpus of sonnets whasoever as long as they are encoded as XML-TEI with their metres are annotated). In the same directory containing the XML files, type:
./adso100test.py *xml
Release History
1.1.0 (02/09/2024)
- Optimisation and documentation with AI
1.0.0 (24/07/2023)
- First public version
1.0.0pre5 (5/07/2023)
- Solved bug with fewer syllables than expected
1.0.0pre4 (20/06/2023)
- Rules diphthong vs perception for triphthong
1.0.0pre2 (17/04/2023)
- Solved diaereses identification issue
1.0.0pre1
- Initial arrangement of the directory tree, metadata, &c. to make the mess more presentable in public
How to cite libEscansión
Authors of scientific papers including results generated using libEscansión are encouraged to cite the following paper.
@article{SanzLazaroF_DHQ2024183,
author = {Sanz-Lázaro, Fernando},
title = {libEscansión: A Recursive Precedence Approach to Metrical Scansion},
volume = {18},
number = {3},
date = {2024},
journal = {Digital Humanities Quarterly},
url = {[https://doi.org/10.5944/rhd.vol.8.2023.37830](https://digitalhumanities.org/dhq/vol/18/3/000739/000739.html)}
}
Meta
Copyright 2023 Fernando Sanz-Lázaro – @FerdlSanz – fsanzl@gmail.com
Distributed under the LGPL 2.1 license. See LICENSE for more information.
https://github.com/fsanzl/libEscansion
Contributing
- Fork it (https://github.com/fsanzl/libEscansion/fork)
- Create your feature branch (
git checkout -b feature/fooBar) - Commit your changes (
git commit -am 'Add some fooBar') - Push to the branch (
git push origin feature/fooBar) - Create a new Pull Request
Copyright
Copyright (C) 2023 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
ADSO 100: Navarro-Colorado, Borja; Ribes Lafoz, María, and Sánchez, Noelia (2015) "Metrical annotation of a large corpus of Spanish sonnets: representation, scansion and evaluation" 10th edition of the Language Resources and Evaluation Conference 2016 Portorož, Slovenia. (PDF)
Metadata
Release files for libEscansion 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Incomplete provenance, with file added late
2 of 3 files were uploaded without provenance metadata.
1 file was also added more than 14 days after the first file in this release.
These two factors together may indicate that the files have been compromised.
We recommend further investigation before installing these files. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| libescansion-1.1.0.tar.gz | 24.9 kB | Without provenance | Details for libescansion-1.1.0.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| libescansion-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for libescansion-1.1.0-py3-none-any.whl |
| libEscansion-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for libEscansion-1.1.0-py3-none-any.whl |
Total release size: 70.2 kB
Release files / libescansion-1.1.0.tar.gz
Incomplete provenance
This file belongs to a release with incomplete provenance: while other files in this release have provenance metadata, this file does not.
We recommend further investigation before installing this file. View details.
| Download URL | libescansion-1.1.0.tar.gz |
|---|---|
| Size | 24.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3d35defffb7709725e308f76616e96c6b93c9c50ff444d4562b4631162f9904
|
|
BLAKE2b-256 checksum How to use checksums |
822c635bf12981e0adde6e9eab2766dff52912c23773a719c1d27e04b415cb85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Release files / libescansion-1.1.0-py3-none-any.whl
Incomplete provenance, with file added late
This file belongs to a release with incomplete provenance: while this file has provenance metadata, other files in this release do not.
The file was also added more than 14 days after the first file in this release.
These two factors together may indicate that this file has been compromised.
We recommend further investigation before installing this file. View details.
| Download URL | libescansion-1.1.0-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aba6c8a6ac5f5588cf64c06619f284d999b7dbf2d6737c4a00987967d4c5337c
|
|
BLAKE2b-256 checksum How to use checksums |
bbabc644bbae18877f3e7982cfd361270a372153ea3c1cd458f620efa0f68868
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 8, 2026.
Transparency logRelease files / libEscansion-1.1.0-py3-none-any.whl
Incomplete provenance
This file belongs to a release with incomplete provenance: while other files in this release have provenance metadata, this file does not.
We recommend further investigation before installing this file. View details.
| Download URL | libEscansion-1.1.0-py3-none-any.whl |
|---|---|
| Size | 22.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c290763804d1a4eff7ec91468f33415a4abf4d633c3cb88de58ceed071b1756
|
|
BLAKE2b-256 checksum How to use checksums |
ff86baa02f75e81a928c06fb39c13fec507b795529e28f349a8b699c6bd99bca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Security for libEscansion 1.1.0
Upload timing
File added late
1 file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Incomplete provenance
2 of 3 files were uploaded without provenance metadata.
Attestations for libescansion-1.1.0.tar.gz
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.