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

Bahadzie/issue7 #8

Merged
merged 2 commits into from
Apr 17, 2024
Merged

Bahadzie/issue7 #8

merged 2 commits into from
Apr 17, 2024

Conversation

bahadzie
Copy link
Member

@bahadzie bahadzie commented Mar 7, 2024

Fixes #7

Also updates README.Rmd and README.md locally to see if it will avoid triggering render_readme Github Action.

R/numberize.R Outdated
"hundred", "", "", "", "", "", "", "", "",
"hundred", "two hundred", "three hundred", "four hundred",
"five hundred", "six hundred", "seven hundred", "eight hundred",
"nine hundred",
"thousand", "million", "billion", "trillion"
Copy link
Member

Choose a reason for hiding this comment

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

I understand the rest of the changes but could you explain why this is now necessary?

Copy link
Member Author

@bahadzie bahadzie Apr 9, 2024

Choose a reason for hiding this comment

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

If you mean filling out the 20s and 100s below

"twenty one", "twenty two", "twenty three", "twenty four",
      "twenty five", "twenty six", "twenty seven", "twenty eight", "twenty nine",
...
"two hundred", "three hundred", "four hundred",
      "five hundred", "six hundred", "seven hundred", "eight hundred", "nine hundred",

A string I tested was failing to numberize properly and this was the solution.

Now I cannot remember what string it was.

What I've learnt from this is to document any failing string as a test next time to

  • be able to explain why the code changed
  • potentially prevent a bug in future as the code is refactored and new features are added.

In the meantime I will try a few strings and see if I can come up with an example to justify it.

Copy link
Member

Choose a reason for hiding this comment

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

I tested with a bunch of values and could not reproduce. If you don't come up with anything either, I suggest we drop it for now, until we have a specific test case.

@bahadzie bahadzie merged commit fc32825 into main Apr 17, 2024
7 checks passed
@bahadzie bahadzie deleted the bahadzie/issue7 branch April 17, 2024 10:51
bahadzie added a commit that referenced this pull request Oct 7, 2024
* Handles text containing leading or trailing whitespace.
Fixes #7

* Undo unnecessary changes in English word mappings
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.

Handles text containing leading or trailing whitespace.
2 participants