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.1a2

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.1a2
File Size Uploaded Provenance Actions
silabificador-2.1.1a2.tar.gz 29.4 kB Without provenance Details for silabificador-2.1.1a2.tar.gz

Built distribution (wheel)

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

Total release size: 53.0 kB

Release files / silabificador-2.1.1a2.tar.gz

Download URL silabificador-2.1.1a2.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
085b3440b934f826bd57e7bd8ddc177c00784f0d5b3a5b575813a9d561f63e10
BLAKE2b-256 checksum
How to use checksums
5a00911e928566522b11efe73753c8adb02ce9e7e48dc814d25bcb55765a6114
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.1a2-py3-none-any.whl

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

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