Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

g2p_barranquenho - Barranquenho Phonemizer

This repository holds a grapheme-to-phoneme (G2P) converter for the Barranquenho language. Give it written Barranquenho text and it returns IPA.

Barranquenho is an Ibero-Romance variety spoken in the municipality of Barrancos, Portugal. It shares several features with the neighbouring Extremaduran and Andalusian varieties of Spanish: coda-/s/ aspiration, betacism (v becomes [b]), the alveolar trill, and southern vowel reduction.

Install

pip install -e .

This pulls in orthography2ipa automatically.

Architecture

The phonology lives in the shared orthography2ipa language spec ext-PT-x-barrancos. That spec holds the grapheme table, the allophone rules, the stress model, and the cross-word sandhi rules. It is the single source of truth for how Barranquenho is realised. This package is a thin wrapper around orthography2ipa.G2P, driven by that spec:

  • transcribe(text) phonemises a whole utterance, so the spec's cross-word sandhi applies (coda-/s/ aspiration and deletion, article and conjunction destressing, vowel elision at word boundaries).
  • phonemize(word) phonemises one word and returns its phones as a list.
  • The package handles only caller-side text handling (case and Unicode normalisation) and this stable surface. The linguistic rules belong to the spec, so a rule improvement is an upstream edit that every consumer shares.

Lexical stress is marked with ˈ before the stressed syllable. Nasal vowels carry the combining tilde U+0303 (ɐ̃). A coda m or n is absorbed into the preceding nasal vowel rather than surfacing as its own segment.

Usage

phonemize takes one word and returns a list of IPA phones. Join the list for a compact string.

from g2p_barranquenho import phonemize

phonemize("boca")      # ['ˈb', 'ɔ', 'k', 'ɐ']
phonemize("manhán")    # ['m', 'ɐ', 'ˈɲ', 'ɐ̃']
phonemize("ambu")      # ['ˈɐ̃', 'b', 'u']

"".join(phonemize("cahtelu"))   # 'kɐˈhtɛlu'

transcribe takes a whole utterance and applies cross-word sandhi.

from g2p_barranquenho import transcribe

transcribe("O tempu não ehtá nada bom agora.")
# 'o ˈtẽpu ˈnɐ̃w̃ eˈhta ˈnadɐ ˈbõ ɐˈɡɔɾɐ'

transcribe("Comprámos pão e vinho na feira de Barrancos.")
# 'kõˈpɾamu ˈpɐ̃w̃ i ˈbiɲu nɐ ˈfejɾɐ dɨ bɐˈrɐ̃ku'

The BarranquenhoG2PPlugin class in g2p_barranquenho.plugin exposes the same engine behind the string-returning transcribe and transcribe_word methods other components in the toolchain expect.

Numbers

Digits carry no orthography the lattice can read, so the normalizer stage spells numeric tokens out into Barranquenho words before transcription. This runs by default in transcribe. Pass expand_numbers=False to leave digits as they are.

from g2p_barranquenho import transcribe
from g2p_barranquenho.number_utils import normalize_numbers, BarranquenhoNumberParser

transcribe("tenho 3 gatu")                       # 3 -> 'treh', then transcribed
transcribe("tenho 3 gatu", expand_numbers=False)  # digit left to the spec

# spell numbers to text without phonemising
normalize_numbers("tenho 20 anu")                # 'tenho binti anu'
normalize_numbers("la casa 1ª")                  # 'la casa primeira' (º masc / ª fem)

# the verbaliser directly
p = BarranquenhoNumberParser()
p.cardinal(256)              # 'duzentuh e cinquenta e seih'
p.cardinal(2, "feminine")    # 'duah'
p.ordinal(1, "feminine")     # 'primeira'
p.pronounce_token("3,5")     # 'treh birgula cincu'

Numeral groups join with the copulative e ("and"). Navas Sánchez-Élez (2011) documents no numeral paradigm, so most forms come from the Convenção Ortográfica do Barranquenho (2025) spelling rules: final -o becomes -u, final -e becomes -i, coda -s is written -h, and v becomes b. The lexemes Navas does attest (2 douh, 3 treh, 6 seih, 7 seti, 10 deh, 14 catorzi, 20 binti, 100 cien, 1000 mil, 1st primeiru) live in number_utils.ATTESTED. Everything else lives in number_utils.DERIVED, so a reader can tell citation from reconstruction.

Documentation

Related projects

Sources

The ext-PT-x-barrancos spec derives from the coordinated normative suite produced under the Programa de Preservação e Valorização da Língua e Cultura Barranquenhas, plus the phonetic descriptions of Navas Sánchez-Élez:

  • Convenção Ortográfica do Barranquenho (June 2025). Câmara Municipal de Barrancos / II Congresso Barranquenho working group.
  • Gramática Básica de Barranquenho (July 2025). Maria Filomena Gonçalves, María Victoria Navas, Victor M. Diogo Correia. Universidade de Évora, 1ª edição. ISBN 978-972-778-464-6.
  • Dicionário de Barranquenho (2025). Maria Filomena Gonçalves, María Victoria Navas, Vera Ferreira. Universidade de Évora, 1ª edição. ISBN 978-972-778-460-8.
  • Navas Sánchez-Élez, M. V. (2011). El barranqueño: un modelo de lenguas en contacto. Madrid: Editorial Complutense.

License

Apache-2.0. See LICENSE.

Metadata

Release files for g2p-barranquenho 0.2.1a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for g2p-barranquenho 0.2.1a1
File Size Uploaded Provenance Actions
g2p_barranquenho-0.2.1a1.tar.gz 21.1 kB Without provenance Details for g2p_barranquenho-0.2.1a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for g2p-barranquenho 0.2.1a1
File Interpreter ABI Platform Actions
g2p_barranquenho-0.2.1a1-py3-none-any.whl Python 3 none any Details for g2p_barranquenho-0.2.1a1-py3-none-any.whl

Total release size: 37.2 kB

Release files / g2p_barranquenho-0.2.1a1.tar.gz

Download URL g2p_barranquenho-0.2.1a1.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1ac79dcf1c487fe1c1dafa47dd24d96f846c965f64c65297f140d372f45f2bc8
BLAKE2b-256 checksum
How to use checksums
b00522c2922b47d123d8506d64dde30f91b7226d8581f13e543a7dc92672911c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / g2p_barranquenho-0.2.1a1-py3-none-any.whl

Download URL g2p_barranquenho-0.2.1a1-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
282abba4e2cc1874e8802de044f76c0a5cf9b44ef5ac0e114e3f994b2e8f8e0b
BLAKE2b-256 checksum
How to use checksums
1efa4e1f40f4d11a0d4dc2b44c34e52303735170eeacbce701b004b67a64f2ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for g2p-barranquenho 0.2.1a1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page