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

Treat "an"s equal to "a"s #22

Closed
wants to merge 1 commit into from
Closed

Treat "an"s equal to "a"s #22

wants to merge 1 commit into from

Conversation

dhruvkb
Copy link
Contributor

@dhruvkb dhruvkb commented Jan 30, 2021

This PR adds n? to all occurrences of "a" so that "an" is also processed equivalently.

Fixes #19.

@@ -101,7 +103,7 @@ def test_compatability
assert_equal '1/2', Numerizer.numerize('1/2')
assert_equal '05/06', Numerizer.numerize('05/06')
assert_equal "3.5 hours", Numerizer.numerize("three and a half hours")
assert_equal "1/2 an hour", Numerizer.numerize("half an hour")
assert_equal "1/2 1 hour", Numerizer.numerize("half an hour")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jduff this might be an unintentional consequence of this change.

Copy link
Owner

Choose a reason for hiding this comment

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

hm, I don't really like that this changes, a fraction next to 1 is kind of weird. Can you look into it and see if there's a way to make this work without it affecting this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest, this problem existed earlier with "a".

assert_equal "1/2 a kilo", Numerizer.numerize("half a kilo")

Screenshot 2021-02-18 at 11 30 57 AM

@@ -101,7 +103,7 @@ def test_compatability
assert_equal '1/2', Numerizer.numerize('1/2')
assert_equal '05/06', Numerizer.numerize('05/06')
assert_equal "3.5 hours", Numerizer.numerize("three and a half hours")
assert_equal "1/2 an hour", Numerizer.numerize("half an hour")
assert_equal "1/2 1 hour", Numerizer.numerize("half an hour")
Copy link
Owner

Choose a reason for hiding this comment

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

hm, I don't really like that this changes, a fraction next to 1 is kind of weird. Can you look into it and see if there's a way to make this work without it affecting this test?

@dhruvkb dhruvkb closed this Mar 11, 2021
@dhruvkb dhruvkb deleted the article_an branch March 11, 2021 04:17
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.

Include 'an's along with 'a's as an article
2 participants