Skip to main content
Pre-release

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

Silabificador is part of the TigreGotico Portuguese phonetics toolchain, alongside:

License

MIT License

Metadata

Release files for silabificador 2.1.1a4

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

Source distribution (sdist)

Source distribution for silabificador 2.1.1a4
File Size Uploaded Provenance Actions
silabificador-2.1.1a4.tar.gz 29.5 kB Without provenance Details for silabificador-2.1.1a4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for silabificador 2.1.1a4
File Interpreter ABI Platform Actions
silabificador-2.1.1a4-py3-none-any.whl Python 3 none any Details for silabificador-2.1.1a4-py3-none-any.whl

Total release size: 53.0 kB

Release files / silabificador-2.1.1a4.tar.gz

Download URL silabificador-2.1.1a4.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f6bd29244a1d36c2be6e131f290ac934231756611b321fc80e20aa4074c4ff3f
BLAKE2b-256 checksum
How to use checksums
61c837d139ab91080301b57e62a7704fe3ac594fc9a758aa2e5666582c30f3b0
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.1a4-py3-none-any.whl

Download URL silabificador-2.1.1a4-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c0db126f7e93acf9363c3442a9b4b842edb03c442554cdb51a6239b771252c5
BLAKE2b-256 checksum
How to use checksums
d80d3ab6c878c37d1878c9600526eebfdf94c86021ccd602bed59423574e0748
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.1a4

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.

Release history Release notifications | RSS feed

This release
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