Skip to content

feat(normalizer): add Brazilian Portuguese normalization - #553

Open
Udbhav-regadamilli wants to merge 1 commit into
remsky:masterfrom
Udbhav-regadamilli:codex/portuguese-normalization
Open

Udbhav-regadamilli wants to merge 1 commit into
remsky:masterfrom
Udbhav-regadamilli:codex/portuguese-normalization

Conversation

@Udbhav-regadamilli

Copy link
Copy Markdown

Summary

  • Add Brazilian Portuguese number, currency, time, and common unit normalization.
  • Register language code p and add focused regression cases.
  • Leave invalid times and long identifier-like digit runs unchanged.

Closes #392

Validation

  • py_compile passed for the implementation and test module.
  • Direct normalization smoke checks passed for integers, currencies, times, units, and long digit runs.
  • The pytest suite could not be run here: pytest and ruff were unavailable, and installing test dependencies failed because the local Python/SDK build environment could not compile pydantic-core.

@remsky

remsky commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Hey @Udbhav-regadamilli, thanks for this. A few things before it can go in:

  • CI is failing on the two unit cases. unit_normalization is off by default (same as English), so those cases need NormalizationOptions(unit_normalization=True). Worth keeping one default case showing km left alone too
  • Needs a rebase, or I can resolve on this end; just the CHANGELOG section.
  • num2words only comes in through misaki right now, can you add it to the deps in pyproject.toml directly
  • We'd want to add a few Portuguese floods to test_normalizer_redos.py (digit runs, 1.000 runs, R$1, runs etc) through get_normalizer("p"), since these regexes run on request text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Portuguese language normalization

2 participants