-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(pt-BR): add number parsing support and ordinal numeric formatting #1785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| cento: 100 | ||
| duzentos: 200 | ||
| trezentos: 300 | ||
| quatrocentos: 400 | ||
| quinhentos: 500 | ||
| seiscentos: 600 | ||
| setecentos: 700 | ||
| oitocentos: 800 | ||
| novecentos: 900 | ||
| mil: 1000 | ||
| milhão: 1000000 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new token-map parser for 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 | ||
|
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' | ||
|
|
@@ -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: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cento/hundreds tokens needed for canonical pt-BR parsingThis cardinal map defines
cembut notcento(nor other hundred words), while the same locale’s number-to-words surface emits forms likecento e umandduzentos. With token-map parsing, those words must exist incardinalMapto 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 👍 / 👎.