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

Carrying last word context forward in a segment #103

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

skiingpacman
Copy link
Contributor

The "last word" context wasn't carried forward within a segment after a number (digits or ordinal) was resolved. This resulted in phrases like the "sixth one" being transposed to the "6th 1". This is in English. This change fixes this so now:
alpha2digit("the sixth one", "en") --> "the 6th one"

>>> from text_to_num import alpha2digit
>>> alpha2digit("the sixth one", "en")
'the 6th one'
>>> alpha2digit("sixth one", "en")
'6th one'
>>> alpha2digit("six one", "en")
'6 1'
>>> alpha2digit("the sixth. one", "en")
'the 6th. 1'

The "last word" context wasn't carried forward within a segment after a
number (digits or ordinal) was resolved. This resulted in phrases like
the "sixth one" being transposed to the "6th 1". This is in English.
Change fixes this so now:
`alpha2digits("the sixth one") --> "the 6th one"`
@skiingpacman
Copy link
Contributor Author

Addresses issue #101

Copy link
Collaborator

@rtxm rtxm left a comment

Choose a reason for hiding this comment

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

LGTM

@rtxm rtxm merged commit 6d173a8 into allo-media:master Nov 27, 2023
1 check passed
@rtxm
Copy link
Collaborator

rtxm commented Nov 28, 2023

Thank you for your contribution.

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.

2 participants