Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 102 additions & 4 deletions src/Humanizer/Locales/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,103 @@ surfaces:
- 'septingentésimo'
- 'octingentésimo'
- 'noningentésimo'
parse:
engine: 'token-map'
normalizationProfile: 'LowercaseRemovePeriods'
cardinalMap:
zero: 0
um: 1
dois: 2
três: 3
quatro: 4
cinco: 5
seis: 6
sete: 7
oito: 8
nove: 9
dez: 10
onze: 11
doze: 12
treze: 13
quatorze: 14
quinze: 15
dezesseis: 16
dezessete: 17
dezoito: 18
dezenove: 19
vinte: 20
trinta: 30
quarenta: 40
cinquenta: 50
sessenta: 60
setenta: 70
oitenta: 80
noventa: 90
cem: 100

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add cento/hundreds tokens needed for canonical pt-BR parsing

This cardinal map defines cem but not cento (nor other hundred words), while the same locale’s number-to-words surface emits forms like cento e um and duzentos. With token-map parsing, those words must exist in cardinalMap to be recognized, so many standard pt-BR numbers in the 101–999 range will fail to parse even though they are canonical outputs of the locale.

Useful? React with 👍 / 👎.

cento: 100
duzentos: 200
trezentos: 300
quatrocentos: 400
quinhentos: 500
seiscentos: 600
setecentos: 700
oitocentos: 800
novecentos: 900
mil: 1000
milhão: 1000000

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add missing milhões token to pt-BR cardinal map

The new token-map parser for pt-BR only includes milhão but omits the plural milhões, even though this locale’s number-to-words output uses plural million forms (for example, values like 2,000,000 are rendered with milhões). TokenMapWordsToNumberConverter resolves scale words via exact token lookup, so dois milhões is treated as unrecognized and parsing fails for common million-range inputs.

Useful? React with 👍 / 👎.

milhões: 1000000
bilhão: 1000000000
bilhões: 1000000000
trilhão: 1000000000000
trilhões: 1000000000000
quadrilhão: 1000000000000000
quadrilhões: 1000000000000000
quintilhão: 1000000000000000000
Comment thread
coderabbitai[bot] marked this conversation as resolved.
quintilhões: 1000000000000000000
ordinalMap:
primeiro: 1
segundo: 2
terceiro: 3
quarto: 4
quinto: 5
sexto: 6
sétimo: 7
oitavo: 8
nono: 9
décimo: 10
décimo primeiro: 11
décimo segundo: 12
décimo terceiro: 13
décimo quarto: 14
décimo quinto: 15
décimo sexto: 16
décimo sétimo: 17
décimo oitavo: 18
décimo nono: 19
vigésimo: 20
trigésimo: 30
quadragésimo: 40
quinquagésimo: 50
sexagésimo: 60
septuagésimo: 70
octogésimo: 80
nonagésimo: 90
centésimo: 100
milésimo: 1000
milionésimo: 1000000
bilionésimo: 1000000000
negativePrefixes:
- 'menos '
ignoredTokens:
- 'e'
ordinalAbbreviationSuffixes:
- 'º'
- 'ª'
allowTerminalOrdinalToken: true
useHundredMultiplier: true
allowInvariantIntegerInput: true


ordinal:
date:
pattern: '{day} ''de'' MMMM ''de'' yyyy'
Expand All @@ -350,15 +446,17 @@ surfaces:
hourMode: 'h12'
hourGender: 'feminine'
minuteGender: 'feminine'
singularArticle: 'a'
pluralArticle: 'as'
midnight: 'meia-noite'
midday: 'meio-dia'
min0: '{hour} em ponto'
min15: '{hour} e quinze'
min30: '{hour} e meia'
min40: 'vinte para as {nextHour}'
min45: 'quinze para as {nextHour}'
min50: 'dez para as {nextHour}'
min55: 'cinco para as {nextHour}'
min40: 'vinte para {nextArticle} {nextHour}'
min45: 'quinze para {nextArticle} {nextHour}'
min50: 'dez para {nextArticle} {nextHour}'
min55: 'cinco para {nextArticle} {nextHour}'
defaultTemplate: '{hour} e {minutes}'

compass:
Expand Down
Loading