Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

desacordo_ortografico

desacordo_ortografico converts Portuguese text between spelling norms: the pre-1911 etymological writing, the Reforma de 1911, the Brazilian norms of 1943 and 1971, the European norms of 1945 and 1973, and the Acordo Ortográfico de 1990 (AO1990) in its European and Brazilian forms. It also detects which norm a text follows, and it flags Mirandese, Galician and Barranquenho text instead of converting it.

A conversion is a path through a graph of eight norms, applied edge by edge. Clean rules handle the regular edges (ph to f, trema, accent drops). Cited word tables handle the lexical ones (which silent consonant drops, which form a norm prefers). Some backward conversions lose information, and the result says so.

Install

pip install desacordo_ortografico

The package needs Python 3.11 or later and tugalex 2.4.9a1 or later, which supplies the word list. The test extra adds pytest. The benchmark extra adds matplotlib, for the plots of the benchmark scripts.

Quick start

>>> from desacordo_ortografico import detect, convert
>>> detect("a pharmacia do theatro").id
'etymological'
>>> detect("o facto é óptimo").id
'pt_1973'
>>> detect("o Antônio é econômico").id
'ao1990-br'
>>> convert("pharmacia", "etymological", "ao1990-br")
'farmácia'
>>> convert("a acção directa", "pre-ao1990-pt", "ao1990-pt")
'a ação direta'
>>> convert("húmido", "ao1990-pt", "ao1990-br")
'úmido'

The command line does the same:

desacordo detect "a pharmacia do theatro"
desacordo convert --from pre-ao1990-pt --to ao1990-pt "a acção directa"
desacordo norms

Norms

id norm
etymological pre-1911 pseudo-etymological spelling
reforma_1911 Reforma Ortográfica de 1911 (Portugal)
br_1943 Formulário Ortográfico de 1943 (Brazil)
pt_1945 Convenção Luso-Brasileira de 1945 (Portugal and PALOP)
br_1971 accent mini-reform, Lei 5.765 (Brazil)
pt_1973 accent mini-reform, Decreto-Lei 32/73 (Portugal)
ao1990-pt, ao1990-br Acordo Ortográfico de 1990, European and Brazilian

The norms form a graph. Each arrow is one edge, and a conversion runs the edges between its two norms.

flowchart LR
    E[etymological] --> R[reforma_1911]
    R --> P45[pt_1945] --> P73[pt_1973] --> APT[ao1990-pt]
    R --> B43[br_1943] --> B71[br_1971] --> ABR[ao1990-br]
    APT <--> ABR

Documentation

The documentation starts at docs/index.md.

Page You get
docs/quickstart.md Detection, conversion and the full result object, with real output
docs/api.md Every public name, its signature and its default
docs/features.md The 28 conversion features and what each one changes
docs/orthographies.md The eight norms and the official source of each rule
docs/data.md The JSON data files and the Hugging Face datasets

License

Apache-2.0.

Metadata

Release files for desacordo-ortografico 0.3.44a1

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

Source distribution (sdist)

Source distribution for desacordo-ortografico 0.3.44a1
File Size Uploaded Provenance Actions
desacordo_ortografico-0.3.44a1.tar.gz 1.2 MB Without provenance Details for desacordo_ortografico-0.3.44a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for desacordo-ortografico 0.3.44a1
File Interpreter ABI Platform Actions
desacordo_ortografico-0.3.44a1-py3-none-any.whl Python 3 none any Details for desacordo_ortografico-0.3.44a1-py3-none-any.whl

Total release size: 2.4 MB

Release files / desacordo_ortografico-0.3.44a1.tar.gz

Download URL desacordo_ortografico-0.3.44a1.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
9ed5e4b0782d6f2180556f26be171233f969448b1a47e26a67b0a26d6c25cd8a
BLAKE2b-256 checksum
How to use checksums
5afa7af10f7b3c34c25014e26b3bf604ac15b37b8523e6bcfd4c0d78b4a10dde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / desacordo_ortografico-0.3.44a1-py3-none-any.whl

Download URL desacordo_ortografico-0.3.44a1-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9c8c841dbfbd97af891c631cf6f7c9b28e08f20da298f95b59fced92e2f2fccb
BLAKE2b-256 checksum
How to use checksums
c433452fa69fda02afbf28d5a55192cf84b78d380fc509f77d774ed3fbff71df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for desacordo-ortografico 0.3.44a1

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