Skip to main content

Rule-based grapheme-to-phoneme converter for Barranquenho

Project description

g2p_barranquenho - Barranquenho Phonemizer

This repository provides a rule-based Grapheme-to-Phoneme (G2P) converter for the Barranquenho language.

Barranquenho is an Ibero-Romance language (often classified as a dialect) spoken in the municipality of Barrancos, Portugal, which shares many features with the nearby Spanish dialects of Extremadura and Andalusia.

The rules implemented in the phonemize function are based on the three official 2025 normative sources listed in the Sources section below.

Architecture

phonemize builds on the shared orthography2ipa pronunciation lattice rather than a private tokenizer:

  • Tokenization is done by the language-agnostic orthography2ipa.phonetok.PhonetokTokenizer — a maximal-munch trie over the Barranquenho grapheme set (the consonant multigraphs tch ch nh lh rr ss plus the single letters). There is no hand-rolled digraph detection or index arithmetic.
  • Vowel identity is decided by orthography2ipa.vowels.is_orthographic_vowel (which recognises the ẽ ĩ ũ nasal vowels), so the engine shares one vowel inventory with the spec instead of keeping a private copy.
  • Barranquenho-specific rules — coda-conditioned nasalization, nasal diphthongs, stress-conditioned vowel quality, ⟨qu⟩/⟨gu⟩ glide elision, ⟨s⟩[h] coda aspiration, and the three-way ⟨x⟩ rule — are each expressed as an orthography2ipa.rescorer.LatticeRescorer re-costing the shared per-grapheme lattice slots, instead of a parallel private cascade.

Nasal vowels are emitted as a single atomic phoneme carrying the IPA/Unicode nasalization diacritic COMBINING TILDE (U+0303), e.g. [ɐ̃]. The coda ⟨m⟩/⟨n⟩ is absorbed into the preceding nasal vowel rather than surfacing as its own segment, so a nasal vowel is one list item, not a vowel followed by a separate tilde.

🚀 Usage

The core functionality is provided by the phonemize function, which takes a word (string) and returns a list of International Phonetic Alphabet (IPA) phonemes.

from g2p_barranquenho import phonemize

for word in [...]:
    phonemes = phonemize(word)
    print(word, phonemes)
    
# paraba ['p', 'ɐ', 'ɾ', 'a', 'b', 'ɐ']
# pássaru ['p', 'a', 's', 'ɐ', 'ɾ', 'u']
# biba ['b', 'i', 'b', 'ɐ']
# cahtelu ['k', 'ɐ', 'h', 't', 'e', 'l', 'u']
# boca ['b', 'o', 'k', 'ɐ']
# ambu ['ɐ̃', 'b', 'u']
# cantá ['k', 'ɐ̃', 't', 'a']
# manhán ['m', 'ɐ', 'ɲ', 'ɐ̃']
# que ['k', 'ɨ']
# aquí ['ɐ', 'k', 'i']

Sources

The phoneme rules are derived from the coordinated normative suite produced under the Programa de Preservação e Valorização da Língua e Cultura Barranquenhas:

  • Convenção Ortográfica do Barranquenho (June 2025). Câmara Municipal de Barrancos / II Congresso Barranquenho working group. Available at: https://cm-barrancos.pt/upload_files/1/3/Noticias/2025/II%20Congresso%20Barranquenho/Conven%C3%A7%C3%A3o%20Ortogr%C3%A1fica%20do%20Barranquenho%20junho%202025%20final.pdf
  • Gramática Básica de Barranquenho (July 2025). Maria Filomena Gonçalves (Universidade de Évora / CIDEHUS-UÉ / FCT / Cátedra UNESCO em Património Imaterial e Saber-Fazer Tradicional), María Victoria Navas (Universidad Complutense de Madrid / CLUL), Victor M. Diogo Correia (Universidade de Évora / CIDEHUS-UÉ / FCT). Universidade de Évora, 1ª edição. ISBN 978-972-778-464-6.
  • Dicionário de Barranquenho (2025). Maria Filomena Gonçalves (Universidade de Évora / CIDEHUS-UÉ / FCT / Cátedra UNESCO), María Victoria Navas (Universidad Complutense de Madrid / CLUL), Vera Ferreira (CIDLeS — Centro de Documentação Linguística e Social). Universidade de Évora, 1ª edição. ISBN 978-972-778-460-8.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

g2p_barranquenho-0.1.2a3.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

g2p_barranquenho-0.1.2a3-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file g2p_barranquenho-0.1.2a3.tar.gz.

File metadata

  • Download URL: g2p_barranquenho-0.1.2a3.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for g2p_barranquenho-0.1.2a3.tar.gz
Algorithm Hash digest
SHA256 f88a36b215710594e0b748451e3cf1343c075c63ea2f630836656499abb0c7c0
MD5 2b181c1b567b7c51a3e5934675b0e099
BLAKE2b-256 bc6fe22f9c30c5c6c74290bd33222dc9a2f9070f8fb7d3b77a7948b43c931e91

See more details on using hashes here.

File details

Details for the file g2p_barranquenho-0.1.2a3-py3-none-any.whl.

File metadata

File hashes

Hashes for g2p_barranquenho-0.1.2a3-py3-none-any.whl
Algorithm Hash digest
SHA256 1d2477fa24c990c7f2ac1523d85d96be3b62cde172573c4ea2e945abe72134be
MD5 c6b9c1801ec9333cdc54c0ea5655c507
BLAKE2b-256 557c77a6895b07e733b0cab98da5e5f122186f80d596f04a367ed4b4fc8d6e3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page