This release is a pre-release and may not be stable for production use.
TugaLex 🗣️
TugaLex is a comprehensive lexicon handler and linguistic utility for Portuguese dialects. It provides deep data on phoneme transcription (IPA), syllable segmentation, and historical/modern orthographic rules.
Designed for NLP pipelines and linguistics research, it allows you to handle the complexities of Portuguese across different regions and historical agreements with a unified API.
🌍 Supported Dialects
TugaLex maps standard ISO codes to internal regional datasets:
| ISO Code | Internal Code | Region |
|---|---|---|
pt-PT |
lbx |
Portugal |
pt-BR |
rjx |
Brazil |
pt-AO |
lda |
Angola |
pt-MZ |
mpx |
Mozambique |
pt-TL |
dli |
Timor-Leste |
✨ Key Features
1. Phonemes & Syllables
Retrieve IPA transcriptions and syllable breaks based on the word's Part-of-Speech (POS) and specific region.
from tugalex import TugaLexicon
lex = TugaLexicon()
# Get both syllables and phonemes
info = lex.get("acordo", pos="NOUN", region="lbx")
# Output: {'syllables': ['a', 'cor', 'do'], 'phonemes': 'ɐˈkoɾdu'}
# POS matters!
verb_phonemes = lex.get_phonemes("acordo", pos="VERB")
# Output: 'ɐˈkɔɾdu'
verb_phonemes = lex.get_phonemes("acordo", pos="NOUN")
# Output: 'ɐˈkoɾdu'
2. Orthographic Agreement (AO1990)
Effortlessly convert text between pre-agreement and post-agreement (AO1990) standards for both Portugal and Brazil.
- Normalize: Old spelling → Modern spelling.
- Reverse: Modern spelling → Old regional spelling (PT or BR).
normalized = lex.normalize_ao1900(sentence)
3. Linguistic Insights
TugaLex identifies specific linguistic phenomena programmatically:
- Homographs: Words that change pronunciation based on POS (e.g., sede (thirst) vs sede (headquarters)).
- Archaic Words: Mapping 19th-century etymological spellings to modern ones.
- Silent Letters: Identifying words with silent 'p' or 'c' common before the 1990 agreement.
- Voiced 'u': Detecting words where 'u' is pronounced in 'gue/gui/que/qui' clusters (formerly marked with a trema
ü).
📂 Datasets
TugaLex ships the following datasets which contain over 100,000 entries sourced from the Portal da Língua Portuguesa.
regional_dict.csv: Phoneme and syllable mappings.heterophonic_homographs.csv: words pronounced differently depending on postag.acordo_ortografico_pt_PT.csv: Portugal old orthographic spellings.acordo_ortografico_pt_BR.csv: Brazil old orthographic spellings.archaisms.csv: normalized words from before the 20th century.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tugalex-0.1.0a1.tar.gz.
File metadata
- Download URL: tugalex-0.1.0a1.tar.gz
- Upload date:
- Size: 6.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ff64875079c7def1c52278f24ddd67d084c869d7cb908f56e9fde12a81b3dd8
|
|
| MD5 |
b759d7892d8950dd54cb2e4ddb46c75f
|
|
| BLAKE2b-256 |
7cd338b0083f3116e253472e434b65964e6f36127fb9c6c097b868eff87a6111
|
File details
Details for the file tugalex-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: tugalex-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 6.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07b1fdeedec00c501da1b9fa43c061d19c21bd860dd79f52630df120eddcc06f
|
|
| MD5 |
475e9d0352ff7e8278d756e3a29a9c56
|
|
| BLAKE2b-256 |
f8fa86ce40917c50cb380b892b5683b5bf1a05e1bc73ececc0778655d8c95ce2
|