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

does not convert simple numbers in English sentences #31

Closed
farmeh opened this issue May 6, 2020 · 4 comments
Closed

does not convert simple numbers in English sentences #31

farmeh opened this issue May 6, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@farmeh
Copy link

farmeh commented May 6, 2020

Hi,
I am using python 3.7.

text_to_num.alpha2digit("she is one foot taller than me.", "en")
returns 'she is one foot taller than me.', so 'one' is not converted.

if I change it slightly to:
text_to_num.alpha2digit("she is two feet taller than me.", "en")
then it returns 'she is 2 feet taller than me.'

So, a simple conversion does not happen in this case and I don't know why?

thanks!

@rtxm
Copy link
Collaborator

rtxm commented May 7, 2020

one is quite special, as it is also a pronoun:

  • "The first one"
  • "Another one"
  • "No one"

We cannot easily identify between a number and a pronoun when one is isolated, so we only convert it when it is part of a sequence, that is, when another number precedes of follows it.

I'm wondering: maybe we should do that for all single digit numbers, shouldn't we?

@itzsimpl
Copy link

itzsimpl commented May 8, 2020

I would advise against having all small numbers left in text form, let the user decide how he wants the conversion done. Perhaps via a flag, eg. CMS, could follow the guidelines of the Chicago Manual of Style, https://getitwriteonline.com/articles/using-numbers/. Its absence would have all numbers converted to digits.

@rtxm rtxm added the enhancement New feature or request label May 12, 2020
@NightMachinery
Copy link

@rtxm commented on May 7, 2020, 1:12 PM GMT+4:30:

one is quite special, as it is also a pronoun:

  • "The first one"
  • "Another one"
  • "No one"

We cannot easily identify between a number and a pronoun when one is isolated, so we only convert it when it is part of a sequence, that is, when another number precedes of follows it.

I'm wondering: maybe we should do that for all single digit numbers, shouldn't we?

That's even more "buggy" than this current predicament with one.

@rtxm
Copy link
Collaborator

rtxm commented Sep 30, 2022

See #42

@rtxm rtxm closed this as completed Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants