numerizer
numerizer copied to clipboard
Include 'an's along with 'a's as an article
Problem
In many places the indefinite article 'a' is manipulated, either by stripping it away or treating it as 1. The article 'an' should be processed in the same way.
In all these regexes a
should be replaced with an?
to cover both articles.
Occurrences
https://github.com/jduff/numerizer/blob/31c1b1f32cc446be50ca6d3b735fe73fd867b466/lib/providers/english_provider.rb#L110 https://github.com/jduff/numerizer/blob/31c1b1f32cc446be50ca6d3b735fe73fd867b466/lib/providers/english_provider.rb#L124 https://github.com/jduff/numerizer/blob/31c1b1f32cc446be50ca6d3b735fe73fd867b466/lib/providers/english_provider.rb#L126
Resolution
I could make a PR if there's consensus that this needs to be fixed.
Can you give a few examples of the test cases you would make pass with this change? I can't think of the cases where you would have an
instead of a
and want it treated the same way. I also haven't spent much time with this codebase in awhile now so may just be missing the context for this.
Sure, I can give some examples.
Words | Numerized |
---|---|
an eighth | 1/8 |
an eleventh | 1/11 |
You wouldn't use "a" as the article on words starting with vowels.
I forgot about fractions lol.
If you want to submit a PR for this I'll take a look, thanks!