This release is a pre-release and may not be stable for production use.
Silabificador
Silabificador splits a Portuguese word into syllables. It uses hand-crafted rules based on Portuguese phonotactics. It has no runtime dependencies and loads no model.
Features
- Syllabification for Portuguese, derived from the licit onset inventory and the diphthong/hiatus rules, not from a table of special cases.
- Stress, primary and secondary, read from the orthography that encodes it.
- Syllable structure, not just strings: onset, glide, nucleus, coda.
- The output always reconstructs the input. Hyphens, spaces, and apostrophes stay in place and are never dropped.
- No dependencies.
Installation
pip install git+https://github.com/TigreGotico/silabificador
Usage
from silabificador import syllabify
syllabify("computador") # ['com', 'pu', 'ta', 'dor']
syllabify("guarda-chuva") # ['guar', 'da-', 'chu', 'va']
Use analyze for the constituents, or stressed_index for the stress:
from silabificador import analyze, stressed_index
for s in analyze("transportar"):
print(s.onset, s.nucleus, s.coda, s.stressed)
# tr a ns False
# p o r False
# t a r True -> trans.por.TAR
stressed_index("sílaba") # 0 SÍ.la.ba
A compound keeps a stress on every element. The last element takes the primary stress:
[str(s) for s in analyze("guarda-chuva") if s.secondary] # ['guar']
[str(s) for s in analyze("guarda-chuva") if s.stressed] # ['chu']
See docs/api.md for the full API surface and
docs/advanced.md for the rules and the known limits.
Accuracy
Silabificador is measured against the Portuguese Unified Pronunciation Lexicon. This lexicon carries syllabifications from two independent authorities: Infopédia (Porto Editora) and the Portal da Língua Portuguesa.
The gold set is the set of words the two sources independently agree on (35,181 words), after discarding any entry whose syllables do not reconstruct its headword. Every word is scored. There is no sampling and no cap.
| set | exact match | |
|---|---|---|
| agreement (gold) | 99.87% | 35,137 / 35,181 |
| Infopédia | 99.34% | 99,619 / 100,279 |
| Portal | 99.81% | 51,763 / 51,861 |
All 116,959 scoreable words reconstruct exactly.
Where the two authorities disagree (135 words, on morpheme boundaries and on etymological hiatus), the tool scores against neither answer, because there is no fact of the matter to be right about.
Stress is measured against a gold the engine cannot see: the lexicon's IPA
transcriptions, which mark stress with ˈ. Nothing in the engine reads IPA.
| stress accuracy | 99.83% | 43,819 / 43,893 |
| gold self-check | 99.75% | 4,712 / 4,724 |
The self-check gives a reason to trust the gold: on a simple word, a written accent is the stress, by definition of the spelling rules, so the IPA-derived answer must agree with it, and it does.
To reproduce the accuracy numbers and see every remaining failure bucketed by cause, run:
pip install -e ".[benchmark]"
python -m benchmark.report
Related projects
Silabificador is part of the TigreGotico Portuguese phonetics toolchain, alongside:
License
MIT License
Metadata
Release files for silabificador 2.1.1a3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| silabificador-2.1.1a3.tar.gz | 29.4 kB | Without provenance | Details for silabificador-2.1.1a3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| silabificador-2.1.1a3-py3-none-any.whl | Python 3 | none | any | Details for silabificador-2.1.1a3-py3-none-any.whl |
Total release size: 53.0 kB
Release files / silabificador-2.1.1a3.tar.gz
| Download URL | silabificador-2.1.1a3.tar.gz |
|---|---|
| Size | 29.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e852b7da11fb8e7d63cc0dc6aa41f61a9fc8c32a064acce05e8f280e0e2ba23
|
|
BLAKE2b-256 checksum How to use checksums |
3a9d21fa4d9d740a6a1caead5e737371100951c504b9da6cf76c21a9de7100c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / silabificador-2.1.1a3-py3-none-any.whl
| Download URL | silabificador-2.1.1a3-py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b729c9fc689a058ee100cf2cdf49a9774a2b15c15ca1edeee8017e4d30dfceda
|
|
BLAKE2b-256 checksum How to use checksums |
fa2027deb4dc12256c8f6a4d0cda0193d0ecb3e0316938dd22be2d33e539cc4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for silabificador 2.1.1a3
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.