Skip to content
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

[PT-BR] Some numbers are not being recognize #79

Closed
RafaelMRazeira opened this issue Sep 12, 2022 · 2 comments
Closed

[PT-BR] Some numbers are not being recognize #79

RafaelMRazeira opened this issue Sep 12, 2022 · 2 comments
Assignees

Comments

@RafaelMRazeira
Copy link

Hi there! Before all, great work!!! This lib helps a lot <3

As it happens with Spanish, in "pt" there some numerals which the alpha2digit function is not recognizing. Here is some examples:

_text = "dezenove"
alpha2digit(_text, "pt")
expected: 19
return: "dezenove"

To reproduce just create a env from zero and install text2num==2.4.0.

Until now I found those numbers:

  • "dezenove" (19)
  • "dezessete" (17)
  • "dezesseis" (16)
  • "um" (1) (but in this case the number need to be in a phrase, like "eu tenho um bis" -> "I have one bis").

In the case of "um" I see this issue for "ones" problems, but in Portuguese I don't think this happens...

Some prints to exemplify better:
image
image

@falcaopetri
Copy link

@RafaelMRazeira, support to 19, 17 and 16 was added in #73. These modifications were not released in PyPi yet.

You can install from upstream till then:

$ pip install -U --force-reinstall https://github.com/allo-media/text2num.git

@rtxm I would also love to have the newer improvements from upstream in a release.

Regarding parsing "um" (1), I'd argue that Portuguese suffers from same ambiguity then English/French (#42). Take as an example this sentence: "tome como um exemplo essa sentença".

@rtxm rtxm self-assigned this Oct 31, 2022
@rtxm
Copy link
Collaborator

rtxm commented Dec 20, 2022

2.5.0 Released!

@rtxm rtxm closed this as completed Dec 20, 2022
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

No branches or pull requests

3 participants