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

Fixed Amharic Infinite Loop for 568476685 and Other Large Numbers #598

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cheng-jess
Copy link

@cheng-jess cheng-jess commented Dec 2, 2024

Fixes #591 by eliminating infinite loop

Changes proposed in this pull request:

  • Added return statement in merge function after the elifs to ensure that recursive combinations are resolved properly. Any situation not explicitly handled by the existing conditions will be covered by the added return statement, which will prevent the merge logic from entering an undefined or recursive state.
  • Added tests in tests_am.py to ensure the bug was fixed as well as added additional tests to ensure proper handling of large numbers and ones with irregular splits in the Amharic language.

Status

  • READY
  • HOLD
  • WIP (Work-In-Progress)

How to verify this change

Test with num2words(568476685, lang="am") or "num2words 568476685 -l am" in the command line. Can also run the test_am.py file to check with test case/assert statement.

Additional notes

Fixed Issue #591

@cheng-jess
Copy link
Author

@mrodriguezg1991
Per Mohammed's email, I'm tagging you so that you can review it. Thank you.

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.

Calling num2words(568476685, lang="am") results in an infinite loop
1 participant